output_description
stringlengths 15
956
| submission_id
stringlengths 10
10
| status
stringclasses 3
values | problem_id
stringlengths 6
6
| input_description
stringlengths 9
2.55k
| attempt
stringlengths 1
13.7k
| problem_description
stringlengths 7
5.24k
| samples
stringlengths 2
2.72k
|
---|---|---|---|---|---|---|---|
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s166856242 | Runtime Error | p02576 | Input is given from Standard Input in the following format:
N X T | from collections import Counter
pas = 0
H, W, M = map(int, input().split())
hn = []
wn = []
tli = []
for _ in range(M):
h, w = map(int, input().split())
tli.append([h, w])
hn.append(h)
wn.append(w)
hcnt = Counter(hn)
wcnt = Counter(wn)
ha, cha = zip(*hcnt.most_common())
wa, cwa = zip(*wcnt.most_common())
hli = [int(ha[0])]
wli = [int(wa[0])]
for i in range(len(cha) - 1):
if cha[i] == cha[i + 1]:
hli.append(int(ha[i + 1]))
else:
break
for i in range(len(cwa) - 1):
if cwa[i] == cwa[i + 1]:
wli.append(int(wa[i + 1]))
else:
break
for i in range(len(hli)):
if pas == 1:
break
for k in range(len(wli)):
if [hli[i], wli[k]] not in tli:
ans = cha[i] + cwa[k]
pas = 1
break
if pas == 0:
print(cha[0] + cwa[0] - 1)
else:
print(ans)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s028673108 | Runtime Error | p02576 | Input is given from Standard Input in the following format:
N X T | n, n, x = input().strip()
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s600248999 | Runtime Error | p02576 | Input is given from Standard Input in the following format:
N X T | print("Yes" if int(input()) % 9 == 0 else "No")
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s250082338 | Accepted | p02576 | Input is given from Standard Input in the following format:
N X T | nks = input("").split(" ")
n = int(nks[0])
k = int(nks[1])
s = int(nks[2])
a = n // k
if n % k != 0:
a += 1
print(a * s)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s513606097 | Wrong Answer | p02576 | Input is given from Standard Input in the following format:
N X T | n, k, t = map(int, input().split())
count = 0
while n < 0:
n -= k
count += 1
print(count * t)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s805350477 | Accepted | p02576 | Input is given from Standard Input in the following format:
N X T | X = list(map(int, input().split()))
n = X[0]
x = X[1]
t = X[2]
s = 1
while n > x:
n = n - x
s += 1
print(s * t)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s540967857 | Accepted | p02576 | Input is given from Standard Input in the following format:
N X T | ss = list(map(int, input().strip().split()))
total = 0
N = ss[0]
X = ss[1]
T = ss[2]
kaisuu = -(-N // X)
createtime = kaisuu * T
print(createtime)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s091018658 | Runtime Error | p02576 | Input is given from Standard Input in the following format:
N X T | h, w, m = map(int, input().split())
mp = []
hp = [0] * h
wp = [0] * w
for i in range(m):
l = list(map(int, input().split()))
mp.append(l)
hp[l[0] - 1] += 1
wp[l[1] - 1] += 1
maxhp = max(hp)
maxwp = max(wp)
hpdex = [i for i, x in enumerate(hp) if x == maxhp]
wpdex = [i for i, x in enumerate(wp) if x == maxwp]
for i in range(len(hpdex)):
for j in range(len(wpdex)):
if [hpdex[i] + 1, wpdex[j] + 1] not in mp:
print(maxhp + maxwp)
exit()
print(maxhp + maxwp - 1)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s076090017 | Runtime Error | p02576 | Input is given from Standard Input in the following format:
N X T | h, w, m = map(int, input().split())
row = [0] * (h + 1)
col = [0] * (w + 1)
bombs = set([])
for i in range(m):
a, b = map(int, input().split())
row[a] += 1
col[b] += 1
bombs.add((a, b))
r, c = max(row), max(col)
rcnt, ccnt = 0, 0
for v in row:
if v == r:
rcnt += 1
for v in col:
if v == c:
ccnt += 1
doubled = 0
for i, j in bombs:
if row[i] == r and col[j] == c:
doubled += 1
if doubled == rcnt * ccnt:
print(r + c - 1)
else:
print(r + c)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s888563260 | Wrong Answer | p02576 | Input is given from Standard Input in the following format:
N X T | line = input().split()
n = int(line[0])
x = int(line[1])
t = int(line[2])
print(-(n // x) * t)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s509213190 | Runtime Error | p02576 | Input is given from Standard Input in the following format:
N X T | N = int(input())
k = 0
x = 0
while N > 1:
N = N / 10
k += 1
for i in range(k):
N = N * 10
a = N // 10
x = x + a
N = N - a
if x // 9 == 0:
print("yes")
else:
print("no")
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s480797439 | Wrong Answer | p02576 | Input is given from Standard Input in the following format:
N X T | def calculate(N, X, T):
return N / X * T
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s026195737 | Runtime Error | p02576 | Input is given from Standard Input in the following format:
N X T | H, W = map(int, input().split())
Ch, Cw = map(int, input().split())
Dh, Dw = map(int, input().split())
S = [list(map(str, list(input()))) for i in range(H)]
ah = Ch
aw = Cw
count = 0
while (ah != Dh) or (aw != Dw):
h = Dh - ah
w = Dw - aw
if h > 0:
if S[ah + 1][aw] == ".":
ah = ah + 1
if h < 0:
if S[ah - 1][aw] == ".":
ah = ah - 1
if w > 0:
if S[ah][aw + 1] == ".":
aw = aw + 1
if w < 0:
if S[ah][aw - 1] == ".":
aw = aw - 1
print(count)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s539210538 | Wrong Answer | p02576 | Input is given from Standard Input in the following format:
N X T | l = list(map(int, input().split()))
a = l[0]
b = l[1]
c = l[2]
d = b // c
if d <= 0:
print(a * c)
else:
if d != 0:
e = b / d
if b > e:
print(b)
else:
print(e)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s658705050 | Wrong Answer | p02576 | Input is given from Standard Input in the following format:
N X T | N, X, Y = map(int, input().split())
print((N // X + 1) * Y)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s461879396 | Runtime Error | p02576 | Input is given from Standard Input in the following format:
N X T | N=int(input())
X=int(input())
T=int(input())
print((int(N//X)+1)*T)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s985039782 | Wrong Answer | p02576 | Input is given from Standard Input in the following format:
N X T | want, max, time = map(int, input().split())
required = int(want / max + 1)
print(required * time)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s364622410 | Accepted | p02576 | Input is given from Standard Input in the following format:
N X T | lst = input()
lst = lst.split()
for i in range(len(lst)):
lst[i] = int(lst[i])
i = lst[0] // lst[1]
if lst[0] % lst[1] != 0:
i += 1
q = lst[2] * i
print(q)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s179728560 | Accepted | p02576 | Input is given from Standard Input in the following format:
N X T | n,x,t=map(int,input().split())
if n%x==0:print(t*(n//x))
else:print(t*(n//x+1)) | Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s370986884 | Accepted | p02576 | Input is given from Standard Input in the following format:
N X T | n, x, t = map(int,input().split())
if (n%x == 0):
y = n//x*t
print(y)
else:
y = n//x + 1
y = y*t
print(y) | Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s763494208 | Accepted | p02576 | Input is given from Standard Input in the following format:
N X T | nxt = input().split()
# print(nxt)
N = int(nxt[0])
X = int(nxt[1])
T = int(nxt[2])
# print(N,X,T)
tmp = N / X - int(N / X)
if tmp == 0:
counter = int(N / X)
else:
counter = int(N / X) + 1
# print(counter)
print(counter * T)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s405012561 | Runtime Error | p02576 | Input is given from Standard Input in the following format:
N X T | import sys
import os
from collections import deque
def _S():
return sys.stdin.readline().rstrip()
def I():
return int(_S())
def LS():
return list(_S().split())
def LI():
return list(map(int, LS()))
if os.getenv("LOCAL"):
inputFile = basename_without_ext = (
os.path.splitext(os.path.basename(__file__))[0] + ".txt"
)
sys.stdin = open(inputFile, "r")
INF = float("inf")
H, W = LI()
C = LI()
D = LI()
maze = [list(_S()) for i in range(H)]
def bfs():
# すべてのマスを INF で初期化
d = [[INF] * W for i in range(H)]
sx = C[0] - 1
sy = C[1] - 1
gx = D[0] - 1
gy = D[1] - 1
# スタート地点をキューに入れ、ワープ数を0にする
que = deque([])
que.append((sx, sy))
d[sx][sy] = 0
# ワープ対象
que2 = deque([])
# 移動4方向のベクトル
dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]
# ワープのベクトル
dx2 = [-2, -2, -2, -2, -2, -1, -1, -1, -1, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2]
dy2 = [-2, -1, 0, 1, 2, -2, -1, 1, 2, -2, 2, 2, 1, -1, -2, 2, 1, 0, -1, -2]
while que:
while que:
p = que.popleft()
# 取り出してきた状態がゴールなら探索をやめる
if p[0] == gx and p[1] == gy:
ans = d[p[0]][p[1]]
print(ans)
exit()
que2.append((p[0], p[1]))
# 移動4方向をループ
for i in range(4):
# 移動した後の点を (nx, ny) とする
nx = p[0] + dx[i]
ny = p[1] + dy[i]
# 移動可否判定、d[nx][ny] == INF であれば訪れたことがない
if (
0 <= nx < H
and 0 <= ny < W
and maze[nx][ny] != "#"
and d[nx][ny] == INF
):
# 移動できるならキューに入れ、その点のワープ回数を p までのワープ回数で確定する
que.append((nx, ny))
d[nx][ny] = d[p[0]][p[1]]
while que2:
# キューの先頭を取り出す
p = que2.popleft()
for i in range(20):
# for dxi in range(-2,3):
# for dyi in range(-2,3):
nx = p[0] + dx2[i]
ny = p[1] + dy2[i]
if (
0 <= nx < H
and 0 <= ny < W
and maze[nx][ny] != "#"
and d[nx][ny] == INF
):
# 移動できるならキューに入れ、その点のワープ回数を p からのワープ回数 +1 で確定する
que.append((nx, ny))
d[nx][ny] = d[p[0]][p[1]] + 1
# print('after que2: ',d)
return
bfs()
print(-1)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s337624165 | Accepted | p02576 | Input is given from Standard Input in the following format:
N X T | x = list(map(int, input().split()))
a = x[0] / x[1]
a //= 1
b = x[0] % x[1]
if b > 0:
a += 1
print(int(a * x[2]))
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s977616984 | Wrong Answer | p02576 | Input is given from Standard Input in the following format:
N X T | print("hello world")
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s301738529 | Wrong Answer | p02576 | Input is given from Standard Input in the following format:
N X T | N, X, T = 100, 20, 30
N / X * T
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s554248519 | Wrong Answer | p02576 | Input is given from Standard Input in the following format:
N X T | n = list(map(int, input().split()))
a = n[0] // n[1]
print((a + 1) * n[2])
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s384774184 | Accepted | p02576 | Input is given from Standard Input in the following format:
N X T | N, X, T = (int(T) for T in input().split())
print(((N // X) + (N % X != 0)) * T)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s343092858 | Wrong Answer | p02576 | Input is given from Standard Input in the following format:
N X T | N,X,T=map(int,input().split())
a= N/X
b = int(a)
if a-b > 0:
a = b+1
res = b*T
print(res) | Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s002404641 | Accepted | p02576 | Input is given from Standard Input in the following format:
N X T | class UnionFind:
def __init__(self, n):
self.n = n
self.parents = [-1] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.parents[x]
def union(self, x, y):
x = self.find(x)
y = self.find(y)
if x == y:
return
if self.parents[x] > self.parents[y]:
x, y = y, x
self.parents[x] += self.parents[y]
self.parents[y] = x
def size(self, x):
return -self.parents[self.find(x)]
def same(self, x, y):
return self.find(x) == self.find(y)
def members(self, x):
root = self.find(x)
return [i for i in range(self.n) if self.find(i) == root]
def roots(self):
return [i for i, x in enumerate(self.parents) if x < 0]
def group_count(self):
return len(self.roots())
def all_group_members(self):
return {r: self.members(r) for r in self.roots()}
def __str__(self):
return "\n".join("{}: {}".format(r, self.members(r)) for r in self.roots())
xkd = input().split()
N = int(xkd[0])
X = int(xkd[1])
T = int(xkd[2])
times = int(N / X)
if N % X != 0:
times += 1
ans = T * times
print(ans)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s698920209 | Accepted | p02576 | Input is given from Standard Input in the following format:
N X T | import sys
def input():
return sys.stdin.readline().strip()
def list2d(a, b, c):
return [[c] * b for i in range(a)]
def list3d(a, b, c, d):
return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e):
return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1):
return int(-(-x // y))
def INT():
return int(input())
def MAP():
return map(int, input().split())
def LIST(N=None):
return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes():
print("Yes")
def No():
print("No")
def YES():
print("YES")
def NO():
print("NO")
sys.setrecursionlimit(10**9)
INF = 10**19
MOD = 10**19 + 7
EPS = 10**-10
N, X, T = MAP()
ans = ceil(N, X) * T
print(ans)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s338559125 | Runtime Error | p02576 | Input is given from Standard Input in the following format:
N X T | import sys
input = sys.stdin.readline
h, w, m = map(int, input().rstrip().split())
hw = [list(map(int, input().rstrip().split())) for _ in range(m)]
tate = [0] * (h + 1)
yoko = [0] * (w + 1)
bombpoint = set()
for x, y in hw:
tate[x] += 1
yoko[y] += 1
bombpoint.add((x, y))
ans_x = []
ans_y = []
x_max = max(tate)
y_max = max(yoko)
for i in range(len(tate)):
if tate[i] == x_max:
ans_x.append(i)
for i in range(len(yoko)):
if yoko[i] == y_max:
ans_y.append(i)
ans = x_max + y_max
for x in ans_x:
for y in ans_y:
if (x, y) not in bombpoint:
print(ans)
exit()
print(ans - 1)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s309493000 | Runtime Error | p02576 | Input is given from Standard Input in the following format:
N X T | def resolve():
from collections import deque
h, w = map(int, input().split())
c_h, c_w = map(int, input().split())
c_h -= 1
c_w -= 1
d_h, d_w = map(int, input().split())
d_h -= 1
d_w -= 1
dist = [[10**18 for i in range(w)] for i in range(h)]
dist[c_h][c_w] = 0
C = []
for _ in range(h):
C.append(list(input()))
D = [(-1, 0), (1, 0), (0, -1), (0, 1)]
queue = deque([(c_h, c_w)])
while queue:
(x, y) = queue.popleft()
d = dist[x][y]
for dx, dy in D:
new_x, new_y = x + dx, y + dy
if -1 < new_x < h and -1 < new_y < w:
if C[new_x][new_y] == "." and dist[new_x][new_y] > d:
dist[new_x][new_y] = d
queue.appendleft((new_x, new_y))
for dx in range(-2, 3):
for dy in range(-2, 3):
if -1 < x + dx < h and -1 < y + dy < w and (dx != 0 or dy != 0):
if C[x + dx][y + dy] == "." and dist[x + dx][y + dy] > d:
dist[x + dx][y + dy] = d + 1
queue.append((x + dx, y + dy))
ans = dist[d_h][d_w]
if ans == 10**18:
print(-1)
else:
print(ans)
resolve()
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
Print an integer representing the minimum number of minutes needed to make N
pieces of takoyaki.
* * * | s651776528 | Wrong Answer | p02576 | Input is given from Standard Input in the following format:
N X T | n, x, y = list(map(int, input().split()))
print((n // x + 1) * y)
| Statement
Takahashi loves takoyaki - a ball-shaped snack.
With a takoyaki machine, he can make at most X pieces of takoyaki at a time,
taking T minutes regardless of the number of pieces to make.
How long does it take to make N takoyaki? | [{"input": "20 12 6", "output": "12\n \n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the\nnext 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1\nminute.\n\n* * *"}, {"input": "1000 1 1000", "output": "1000000\n \n\nIt seems to take a long time to make this kind of takoyaki."}] |
If the required domino placement doesn't exist, print a single integer `-1`.
Otherwise, output your placement as N strings of N characters each. If a
square is not covered, the corresponding character must be `.` (a dot).
Otherwise, it must contain a lowercase English letter. Squares covered by the
same domino piece must contain the same letter. If two squares have a common
side but belong to different pieces, they must contain different letters.
* * * | s521448326 | Accepted | p02825 | Input is given from Standard Input in the following format:
N | N = int(input())
state = [list("." * N) for _ in range(N)]
def fill_block3_1(h, w):
state[h][w] = "a"
state[h][w + 1] = "a"
state[h + 1][w + 2] = "b"
state[h + 2][w + 2] = "b"
def fill_block3_2(h, w):
state[h][w] = "c"
state[h + 1][w] = "c"
state[h][w + 1] = "d"
state[h][w + 2] = "d"
state[h + 2][w] = "e"
state[h + 2][w + 1] = "e"
state[h + 1][w + 2] = "f"
state[h + 2][w + 2] = "f"
def solve_5_6n(start_h, start_w, k, s1, s2):
cycle = 2 * k + 1
size = 3 * cycle + 2
num_2 = k
for h3 in range(cycle):
for w3 in range(cycle):
if (h3 + w3) % cycle < num_2:
fill_block3_2(start_h + 3 * h3 + 1, start_w + 3 * w3 + 1)
else:
fill_block3_1(start_h + 3 * h3 + 1, start_w + 3 * w3 + 1)
for x in range(size - 1):
if x % 4 in [0, 1]:
state[start_h][start_w + x] = s1
state[start_h + size - 2 - x][start_w + size - 1] = s2
state[start_h + size - 1][start_w + size - 1 - x] = s1
state[start_h + 1 + x][start_w] = s2
else:
state[start_h][start_w + x] = s2
state[start_h + size - 2 - x][start_w + size - 1] = s1
state[start_h + size - 1][start_w + size - 1 - x] = s2
state[start_h + 1 + x][start_w] = s1
def solve_2_6n(start_h, start_w, k, s1, s2):
cycle = 2 * k
size = 3 * cycle + 2
num_2 = k - 2
if k == 1:
fill_block3_1(start_h + 1, start_w + 1)
fill_block3_1(start_h + 4, start_w + 4)
else:
for h3 in range(cycle):
for w3 in range(cycle):
if (h3 + w3) % cycle < num_2:
fill_block3_2(start_h + 3 * h3 + 1, start_w + 3 * w3 + 1)
else:
fill_block3_1(start_h + 3 * h3 + 1, start_w + 3 * w3 + 1)
for x in range(1, size - 1):
if x % 4 in [1, 2]:
state[start_h][start_w + x] = s1
state[start_h + x][start_w] = s1
state[start_h + size - 1][start_w + x] = s1
state[start_h + x][start_w + size - 1] = s1
else:
state[start_h][start_w + x] = s2
state[start_h + x][start_w] = s2
state[start_h + size - 1][start_w + x] = s2
state[start_h + x][start_w + size - 1] = s2
def solve_1_6n(start_h, start_w, k, s1, s2):
cycle = 2 * k
size = 3 * cycle + 1
for h3 in range(cycle):
for w3 in range(cycle):
if (h3 + w3) % cycle < k - 1:
fill_block3_2(start_h + 3 * h3 + 1, start_w + 3 * w3 + 1)
else:
fill_block3_1(start_h + 3 * h3 + 1, start_w + 3 * w3 + 1)
for x in range(1, size):
if x % 4 in [1, 2]:
state[start_h][start_w + x] = s1
state[start_h + x][start_w] = s1
else:
state[start_h][start_w + x] = s2
state[start_h + x][start_w] = s2
def main():
if N == 2:
return -1
if N == 4:
state = [
["a", "a", "c", "d"],
["b", "b", "c", "d"],
["e", "f", "g", "g"],
["e", "f", "h", "h"],
]
return state
if N % 3 == 0:
l = N // 3
for h in range(l):
for w in range(l):
fill_block3_1(3 * h, 3 * w)
return
elif N % 6 == 5:
k = (N - 5) // 6
solve_5_6n(0, 0, k, "x", "y")
return
elif N % 6 == 2:
k = (N - 2) // 6
solve_2_6n(0, 0, k, "x", "y")
return
elif N % 6 == 1:
solve_1_6n(0, 0, (N - 1) // 6, "x", "y")
return
else:
l = (N // 2 - 2) // 3
if l % 2 == 1:
solve_5_6n(0, 0, (l - 1) // 2, "s", "t")
solve_5_6n(N // 2, 0, (l - 1) // 2, "u", "v")
solve_5_6n(0, N // 2, (l - 1) // 2, "w", "x")
solve_5_6n(N // 2, N // 2, (l - 1) // 2, "y", "z")
else:
solve_2_6n(0, 0, l // 2, "s", "t")
solve_2_6n(N // 2, 0, l // 2, "u", "v")
solve_2_6n(0, N // 2, l // 2, "w", "x")
solve_2_6n(N // 2, N // 2, l // 2, "y", "z")
return
if __name__ == "__main__":
ret = main()
if ret == -1:
print(-1)
elif not ret is None:
for h in range(N):
print("".join(ret[h]))
else:
for h in range(N):
print("".join(state[h]))
| Statement
Let us consider a grid of squares with N rows and N columns. You want to put
some domino pieces on this grid. Each domino piece covers two squares that
have a common side. Each square can be covered by at most one piece.
For each row of the grid, let's define its quality as the number of domino
pieces that cover at least one square in this row. We define the quality of
each column similarly.
Find a way to put at least one domino piece on the grid so that the quality of
every row is equal to the quality of every column, or determine that such a
placement doesn't exist. | [{"input": "6", "output": "aabb..\n b..zz.\n ba....\n .a..aa\n ..a..b\n ..a..b\n \n\nThe quality of every row and every column is 2.\n\n* * *"}, {"input": "2", "output": "-1"}] |
If the required domino placement doesn't exist, print a single integer `-1`.
Otherwise, output your placement as N strings of N characters each. If a
square is not covered, the corresponding character must be `.` (a dot).
Otherwise, it must contain a lowercase English letter. Squares covered by the
same domino piece must contain the same letter. If two squares have a common
side but belong to different pieces, they must contain different letters.
* * * | s860400622 | Wrong Answer | p02825 | Input is given from Standard Input in the following format:
N | n = int(input())
if n == 2:
print(-1)
elif n == 3:
print("aab")
print("d.b")
print("dcc")
elif n % 4 == 0:
for i in range(n // 4):
temp = ["." * n] * 4
temp[0] = temp[0][: 4 * i] + "aabd" + temp[0][(i + 1) * 4 + 1 :]
temp[1] = temp[1][: 4 * i] + "ccbd" + temp[1][(i + 1) * 4 + 1 :]
temp[2] = temp[2][: 4 * i] + "efgg" + temp[2][(i + 1) * 4 + 1 :]
temp[3] = temp[3][: 4 * i] + "efhh" + temp[3][(i + 1) * 4 + 1 :]
print(temp[0])
print(temp[1])
print(temp[2])
print(temp[3])
elif n % 4 == 1:
temp = [""] * 5
temp[0] = "aabbc" + "." * (n - 5)
temp[1] = "fg..c" + "." * (n - 5)
temp[2] = "fg..d" + "." * (n - 5)
temp[3] = "h.jjd" + "." * (n - 5)
temp[4] = "hiiee" + "." * (n - 5)
print(temp[0])
print(temp[1])
print(temp[2])
print(temp[3])
print(temp[4])
for i in range(n // 4 - 1):
temp = ["." * n] * 4
temp[0] = temp[0][: 4 * i + 5] + "aabd" + temp[0][(i + 1) * 4 + 6 :]
temp[1] = temp[1][: 4 * i + 5] + "ccbd" + temp[1][(i + 1) * 4 + 6 :]
temp[2] = temp[2][: 4 * i + 5] + "efgg" + temp[2][(i + 1) * 4 + 6 :]
temp[3] = temp[3][: 4 * i + 5] + "efhh" + temp[3][(i + 1) * 4 + 6 :]
print(temp[0])
print(temp[1])
print(temp[2])
print(temp[3])
elif n % 4 == 2:
temp = [""] * 6
temp[0] = "a.ccaa" + "." * (n - 6)
temp[1] = "ab.bb." + "." * (n - 6)
temp[2] = "cb...c" + "." * (n - 6)
temp[3] = "c...bc" + "." * (n - 6)
temp[4] = ".bb.ba" + "." * (n - 6)
temp[5] = "aacc.a" + "." * (n - 6)
print(temp[0])
print(temp[1])
print(temp[2])
print(temp[3])
print(temp[4])
print(temp[5])
for i in range(n // 4 - 1):
temp = ["." * n] * 4
temp[0] = temp[0][: 4 * i + 6] + "aabd" + temp[0][(i + 1) * 4 + 7 :]
temp[1] = temp[1][: 4 * i + 6] + "ccbd" + temp[1][(i + 1) * 4 + 7 :]
temp[2] = temp[2][: 4 * i + 6] + "efgg" + temp[2][(i + 1) * 4 + 7 :]
temp[3] = temp[3][: 4 * i + 6] + "efhh" + temp[3][(i + 1) * 4 + 7 :]
print(temp[0])
print(temp[1])
print(temp[2])
print(temp[3])
else:
temp = [""] * 7
temp[0] = "a.aa.aa" + "." * (n - 7)
temp[1] = "a...bc." + "." * (n - 7)
temp[2] = "....bcd" + "." * (n - 7)
temp[3] = "a..ee.d" + "." * (n - 7)
temp[4] = "abb..a." + "." * (n - 7)
temp[5] = ".cc..ab" + "." * (n - 7)
temp[6] = "dd.aa.b" + "." * (n - 7)
print(temp[0])
print(temp[1])
print(temp[2])
print(temp[3])
print(temp[4])
print(temp[5])
print(temp[6])
for i in range(n // 4 - 1):
temp = ["." * n] * 4
temp[0] = temp[0][: 4 * i + 7] + "aabd" + temp[0][(i + 1) * 4 + 8 :]
temp[1] = temp[1][: 4 * i + 7] + "ccbd" + temp[1][(i + 1) * 4 + 8 :]
temp[2] = temp[2][: 4 * i + 7] + "efgg" + temp[2][(i + 1) * 4 + 8 :]
temp[3] = temp[3][: 4 * i + 7] + "efhh" + temp[3][(i + 1) * 4 + 8 :]
print(temp[0])
print(temp[1])
print(temp[2])
print(temp[3])
| Statement
Let us consider a grid of squares with N rows and N columns. You want to put
some domino pieces on this grid. Each domino piece covers two squares that
have a common side. Each square can be covered by at most one piece.
For each row of the grid, let's define its quality as the number of domino
pieces that cover at least one square in this row. We define the quality of
each column similarly.
Find a way to put at least one domino piece on the grid so that the quality of
every row is equal to the quality of every column, or determine that such a
placement doesn't exist. | [{"input": "6", "output": "aabb..\n b..zz.\n ba....\n .a..aa\n ..a..b\n ..a..b\n \n\nThe quality of every row and every column is 2.\n\n* * *"}, {"input": "2", "output": "-1"}] |
If the required domino placement doesn't exist, print a single integer `-1`.
Otherwise, output your placement as N strings of N characters each. If a
square is not covered, the corresponding character must be `.` (a dot).
Otherwise, it must contain a lowercase English letter. Squares covered by the
same domino piece must contain the same letter. If two squares have a common
side but belong to different pieces, they must contain different letters.
* * * | s578778622 | Accepted | p02825 | Input is given from Standard Input in the following format:
N | N = int(input())
if N == 2:
print(-1)
exit()
elif N == 3:
print("a..")
print("a..")
print(".aa")
exit()
ans = [["."] * N for _ in range(N)]
u = [["a", "a"], ["b", "b"]]
v = [["c", "d"], ["c", "d"]]
if N % 4 == 0:
for i in range(0, N, 2):
for h in range(2):
for w in range(2):
ans[i + h][i + w] = u[h][w]
for h in range(2):
for w in range(2):
ans[i + h][N - i - w - 1] = v[h][w]
elif N % 4 == 1:
for i in range(0, N // 2 - 2, 2):
for h in range(2):
for w in range(2):
ans[i + h][i + w] = u[h][w]
for h in range(2):
for w in range(2):
ans[i + h][N - i - w - 1] = v[h][w]
for i in range(N // 2 + 3, N, 2):
for h in range(2):
for w in range(2):
ans[i + h][i + w] = u[h][w]
for h in range(2):
for w in range(2):
ans[i + h][N - i - w - 1] = v[h][w]
a = [
["c", "c", "d", "d", "e"],
["f", "g", ".", ".", "e"],
["f", "g", ".", ".", "h"],
["i", ".", "k", "k", "h"],
["i", "j", "j", "l", "l"],
]
i0 = N // 2 - 2
for h in range(5):
for w in range(5):
ans[i0 + h][i0 + w] = a[h][w]
elif N % 4 == 2:
for i in range(0, N // 2 - 3, 2):
for h in range(2):
for w in range(2):
ans[i + h][i + w] = u[h][w]
for h in range(2):
for w in range(2):
ans[i + h][N - i - w - 1] = v[h][w]
for i in range(N // 2 + 3, N, 2):
for h in range(2):
for w in range(2):
ans[i + h][i + w] = u[h][w]
for h in range(2):
for w in range(2):
ans[i + h][N - i - w - 1] = v[h][w]
a = [
["c", ".", "d", "d", "e", "e"],
["c", "f", ".", "g", "g", "."],
["h", "f", ".", ".", ".", "i"],
["h", ".", ".", ".", "k", "i"],
[".", "j", "j", ".", "k", "n"],
["l", "l", "m", "m", ".", "n"],
]
i0 = N // 2 - 3
for h in range(6):
for w in range(6):
ans[i0 + h][i0 + w] = a[h][w]
elif N % 4 == 3:
for i in range(0, N // 2 - 3, 2):
for h in range(2):
for w in range(2):
ans[i + h][i + w] = u[h][w]
for h in range(2):
for w in range(2):
ans[i + h][N - i - w - 1] = v[h][w]
for i in range(N // 2 + 4, N, 2):
for h in range(2):
for w in range(2):
ans[i + h][i + w] = u[h][w]
for h in range(2):
for w in range(2):
ans[i + h][N - i - w - 1] = v[h][w]
a = [
["c", ".", ".", "d", "d", "e", "e"],
["c", "f", ".", ".", "g", "g", "."],
["h", "f", "i", ".", ".", ".", "."],
["h", ".", "i", ".", ".", ".", "k"],
[".", ".", ".", "j", "j", "m", "k"],
[".", "l", "l", ".", ".", "m", "p"],
["n", "n", "o", "o", ".", ".", "p"],
]
i0 = N // 2 - 3
for h in range(7):
for w in range(7):
ans[i0 + h][i0 + w] = a[h][w]
[print("".join(ans[i])) for i in range(N)]
| Statement
Let us consider a grid of squares with N rows and N columns. You want to put
some domino pieces on this grid. Each domino piece covers two squares that
have a common side. Each square can be covered by at most one piece.
For each row of the grid, let's define its quality as the number of domino
pieces that cover at least one square in this row. We define the quality of
each column similarly.
Find a way to put at least one domino piece on the grid so that the quality of
every row is equal to the quality of every column, or determine that such a
placement doesn't exist. | [{"input": "6", "output": "aabb..\n b..zz.\n ba....\n .a..aa\n ..a..b\n ..a..b\n \n\nThe quality of every row and every column is 2.\n\n* * *"}, {"input": "2", "output": "-1"}] |
If the required domino placement doesn't exist, print a single integer `-1`.
Otherwise, output your placement as N strings of N characters each. If a
square is not covered, the corresponding character must be `.` (a dot).
Otherwise, it must contain a lowercase English letter. Squares covered by the
same domino piece must contain the same letter. If two squares have a common
side but belong to different pieces, they must contain different letters.
* * * | s033410587 | Accepted | p02825 | Input is given from Standard Input in the following format:
N | import sys
N = int(input())
if N == 2:
print(-1)
sys.exit()
ans = [["."] * N for i in range(N)]
if N % 4 == 0:
k = N // 4
for i in range(k):
num = 4 * i
for j in range(2):
ans[j + num][0 + num] = "a"
ans[j + num][1 + num] = "b"
for j in range(2, 4):
ans[j + num][2 + num] = "a"
ans[j + num][3 + num] = "b"
for j in range(2):
ans[2 + num][j + num] = "c"
ans[3 + num][j + num] = "d"
for j in range(2, 4):
ans[0 + num][j + num] = "c"
ans[1 + num][j + num] = "d"
for u in ans:
print("".join(u))
sys.exit()
n = N
while n % 2 == 0:
n //= 2
k = N // n
for i in range(k):
num = n * i
for j in range(2):
ans[j + num][num] = "a"
ans[j + num][(n - 2) // 2 + num] = "b"
ans[j + num][n - 3 + num] = "c"
for j in range(n - 2, n):
ans[2 + num][j + num] = "a"
ans[(n + 1) // 2 + num][j + num] = "b"
ans[n - 1 + num][j + num] = "c"
lsls = ["d", "e"]
for j in range(2, (n + 1) // 2):
ans[j + num][j - 2 + num] = lsls[j % 2]
ans[j + num][j - 1 + num] = lsls[j % 2]
for j in range((n + 3) // 2, n):
ans[j + num][j - 2 + num] = lsls[j % 2]
ans[j + num][j - 3 + num] = lsls[j % 2]
lsls = ["f", "g"]
for j in range(2, (n + 1) // 2):
ans[j + num][n - 1 - j + num] = lsls[j % 2]
ans[j + 1 + num][n - 1 - j + num] = lsls[j % 2]
for j in range((n + 3) // 2, n):
ans[j + num][n - 1 - j + num] = lsls[j % 2]
ans[j - 1 + num][n - 1 - j + num] = lsls[j % 2]
for u in ans:
print("".join(u))
| Statement
Let us consider a grid of squares with N rows and N columns. You want to put
some domino pieces on this grid. Each domino piece covers two squares that
have a common side. Each square can be covered by at most one piece.
For each row of the grid, let's define its quality as the number of domino
pieces that cover at least one square in this row. We define the quality of
each column similarly.
Find a way to put at least one domino piece on the grid so that the quality of
every row is equal to the quality of every column, or determine that such a
placement doesn't exist. | [{"input": "6", "output": "aabb..\n b..zz.\n ba....\n .a..aa\n ..a..b\n ..a..b\n \n\nThe quality of every row and every column is 2.\n\n* * *"}, {"input": "2", "output": "-1"}] |
If the required domino placement doesn't exist, print a single integer `-1`.
Otherwise, output your placement as N strings of N characters each. If a
square is not covered, the corresponding character must be `.` (a dot).
Otherwise, it must contain a lowercase English letter. Squares covered by the
same domino piece must contain the same letter. If two squares have a common
side but belong to different pieces, they must contain different letters.
* * * | s241318273 | Wrong Answer | p02825 | Input is given from Standard Input in the following format:
N | N = int(input())
lst = [["."] * N for _ in range(N)]
def calc3(x, y): # 基準x, yから3×3マスを塗る
lst[x][y] = "a"
lst[x][y + 1] = "a"
lst[x][y + 2] = "b"
lst[x + 1][y + 2] = "b"
lst[x + 2][y + 2] = "c"
lst[x + 2][y + 1] = "c"
lst[x + 2][y] = "d"
lst[x + 1][y] = "d"
if N % 3 == 0:
for h in range(0, N, 3):
for w in range(0, N, 3):
calc3(h, w)
for i in lst:
print(*i, sep="")
exit()
def calc4(x, y):
lst[x][y] = "a"
lst[x][y + 1] = "a"
lst[x + 1][y] = "b"
lst[x + 1][y + 1] = "b"
lst[x + 2][y + 2] = "c"
lst[x + 2][y + 3] = "c"
lst[x + 3][y + 2] = "d"
lst[x + 3][y + 3] = "d"
lst[x + 2][y] = "e"
lst[x + 3][y] = "e"
lst[x + 2][y + 1] = "f"
lst[x + 3][y + 1] = "f"
lst[x][y + 2] = "g"
lst[x + 1][y + 2] = "g"
lst[x][y + 3] = "h"
lst[x + 1][y + 3] = "h"
if N % 4 == 0:
for h in range(0, N, 4):
for w in range(0, N, 4):
calc4(h, w)
for i in lst:
print(*i, sep="")
exit()
| Statement
Let us consider a grid of squares with N rows and N columns. You want to put
some domino pieces on this grid. Each domino piece covers two squares that
have a common side. Each square can be covered by at most one piece.
For each row of the grid, let's define its quality as the number of domino
pieces that cover at least one square in this row. We define the quality of
each column similarly.
Find a way to put at least one domino piece on the grid so that the quality of
every row is equal to the quality of every column, or determine that such a
placement doesn't exist. | [{"input": "6", "output": "aabb..\n b..zz.\n ba....\n .a..aa\n ..a..b\n ..a..b\n \n\nThe quality of every row and every column is 2.\n\n* * *"}, {"input": "2", "output": "-1"}] |
If the required domino placement doesn't exist, print a single integer `-1`.
Otherwise, output your placement as N strings of N characters each. If a
square is not covered, the corresponding character must be `.` (a dot).
Otherwise, it must contain a lowercase English letter. Squares covered by the
same domino piece must contain the same letter. If two squares have a common
side but belong to different pieces, they must contain different letters.
* * * | s167742234 | Wrong Answer | p02825 | Input is given from Standard Input in the following format:
N | def solve(n):
if n % 3 != 0 and n % 4 != 0:
return -1
else:
while True:
pass
return 0
def main():
n = int(input())
res = solve(n)
print(res)
def test():
assert solve() == 0
assert solve() == 0
assert solve() == 0
if __name__ == "__main__":
# test()
main()
| Statement
Let us consider a grid of squares with N rows and N columns. You want to put
some domino pieces on this grid. Each domino piece covers two squares that
have a common side. Each square can be covered by at most one piece.
For each row of the grid, let's define its quality as the number of domino
pieces that cover at least one square in this row. We define the quality of
each column similarly.
Find a way to put at least one domino piece on the grid so that the quality of
every row is equal to the quality of every column, or determine that such a
placement doesn't exist. | [{"input": "6", "output": "aabb..\n b..zz.\n ba....\n .a..aa\n ..a..b\n ..a..b\n \n\nThe quality of every row and every column is 2.\n\n* * *"}, {"input": "2", "output": "-1"}] |
If the required domino placement doesn't exist, print a single integer `-1`.
Otherwise, output your placement as N strings of N characters each. If a
square is not covered, the corresponding character must be `.` (a dot).
Otherwise, it must contain a lowercase English letter. Squares covered by the
same domino piece must contain the same letter. If two squares have a common
side but belong to different pieces, they must contain different letters.
* * * | s299879301 | Wrong Answer | p02825 | Input is given from Standard Input in the following format:
N | N = int(input())
lst = [["."] * N for _ in range(N)]
def calc3(x, y): # 基準x, yから3×3マスを塗る
lst[x][y] = "a"
lst[x][y + 1] = "a"
lst[x][y + 2] = "b"
lst[x + 1][y + 2] = "b"
lst[x + 2][y + 2] = "c"
lst[x + 2][y + 1] = "c"
lst[x + 2][y] = "d"
lst[x + 1][y] = "d"
if N % 3 == 0:
for h in range(0, N, 3):
for w in range(0, N, 3):
calc3(h, w)
for i in lst:
print(*i, sep="")
exit()
def calc4(x, y):
lst[x][y] = "a"
lst[x][y + 1] = "a"
lst[x + 1][y] = "b"
lst[x + 1][y + 1] = "b"
lst[x + 2][y + 2] = "c"
lst[x + 2][y + 3] = "c"
lst[x + 3][y + 2] = "d"
lst[x + 3][y + 3] = "d"
lst[x + 2][y] = "e"
lst[x + 3][y] = "e"
lst[x + 2][y + 1] = "f"
lst[x + 3][y + 1] = "f"
lst[x][y + 2] = "g"
lst[x + 1][y + 2] = "g"
lst[x][y + 3] = "h"
lst[x + 1][y + 3] = "h"
if N % 4 == 0:
for h in range(0, N, 4):
for w in range(0, N, 4):
calc4(h, w)
for i in lst:
print(*i, sep="")
exit()
def calc5(x, y):
lst[x][y] = "a"
lst[x][y + 1] = "a"
lst[x][y + 2] = "b"
lst[x][y + 3] = "b"
lst[x][y + 4] = "c"
lst[x + 1][y + 4] = "c"
lst[x + 1][y] = "d"
lst[x + 2][y] = "d"
lst[x + 1][y + 1] = "e"
lst[x + 2][y + 1] = "e"
lst[x + 2][y + 4] = "f"
lst[x + 3][y + 4] = "f"
lst[x + 3][y] = "g"
lst[x + 4][y] = "g"
lst[x + 3][y + 2] = "h"
lst[x + 3][y + 3] = "h"
lst[x + 4][y + 1] = "i"
lst[x + 4][y + 2] = "i"
lst[x + 4][y + 3] = "j"
lst[x + 4][y + 4] = "j"
if N % 5 == 0:
for h in range(0, N, 5):
for w in range(0, N, 5):
calc5(h, w)
for i in lst:
print(*i, sep="")
exit()
def calc7(x, y):
lst[x][y + 1] = "a"
lst[x][y + 2] = "a"
lst[x][y + 3] = "b"
lst[x][y + 4] = "b"
lst[x][y + 5] = "c"
lst[x][y + 6] = "c"
lst[x + 1][y] = "d"
lst[x + 2][y] = "d"
lst[x + 1][y + 3] = "e"
lst[x + 1][y + 4] = "e"
lst[x + 1][y + 5] = "f"
lst[x + 1][y + 6] = "f"
lst[x + 3][y] = "g"
lst[x + 4][y] = "g"
lst[x + 3][y + 1] = "h"
lst[x + 4][y + 1] = "h"
lst[x + 3][y + 2] = "i"
lst[x + 4][y + 2] = "i"
lst[x + 5][y] = "j"
lst[x + 6][y] = "j"
lst[x + 5][y + 1] = "k"
lst[x + 6][y + 1] = "k"
lst[x + 5][y + 2] = "l"
lst[x + 6][y + 2] = "l"
lst[x + 2][y + 3] = "m"
lst[x + 2][y + 4] = "m"
lst[x + 2][y + 5] = "n"
lst[x + 2][y + 6] = "n"
if N % 7 == 0:
for h in range(0, N, 7):
for w in range(0, N, 7):
calc7(h, w)
for i in lst:
print(*i, sep="")
exit()
print(-1)
| Statement
Let us consider a grid of squares with N rows and N columns. You want to put
some domino pieces on this grid. Each domino piece covers two squares that
have a common side. Each square can be covered by at most one piece.
For each row of the grid, let's define its quality as the number of domino
pieces that cover at least one square in this row. We define the quality of
each column similarly.
Find a way to put at least one domino piece on the grid so that the quality of
every row is equal to the quality of every column, or determine that such a
placement doesn't exist. | [{"input": "6", "output": "aabb..\n b..zz.\n ba....\n .a..aa\n ..a..b\n ..a..b\n \n\nThe quality of every row and every column is 2.\n\n* * *"}, {"input": "2", "output": "-1"}] |
If the required domino placement doesn't exist, print a single integer `-1`.
Otherwise, output your placement as N strings of N characters each. If a
square is not covered, the corresponding character must be `.` (a dot).
Otherwise, it must contain a lowercase English letter. Squares covered by the
same domino piece must contain the same letter. If two squares have a common
side but belong to different pieces, they must contain different letters.
* * * | s508819427 | Wrong Answer | p02825 | Input is given from Standard Input in the following format:
N | n = int(input())
if n % 4 == 0:
k = n // 4
for _ in range(k):
s = ""
for _ in range(k):
s += "aabc"
print(s)
s = ""
for _ in range(k):
s += "ddbc"
print(s)
s = ""
for _ in range(k):
s += "efgg"
print(s)
s = ""
for _ in range(k):
s += "efhh"
print(s)
exit()
if n % 3 == 0:
k = n // 3
for _ in range(k):
s = ""
for _ in range(k):
s += "aab"
print(s)
s = ""
for _ in range(k):
s += "c.b"
print(s)
s = ""
for _ in range(k):
s += "cdd"
print(s)
exit()
print(-1)
| Statement
Let us consider a grid of squares with N rows and N columns. You want to put
some domino pieces on this grid. Each domino piece covers two squares that
have a common side. Each square can be covered by at most one piece.
For each row of the grid, let's define its quality as the number of domino
pieces that cover at least one square in this row. We define the quality of
each column similarly.
Find a way to put at least one domino piece on the grid so that the quality of
every row is equal to the quality of every column, or determine that such a
placement doesn't exist. | [{"input": "6", "output": "aabb..\n b..zz.\n ba....\n .a..aa\n ..a..b\n ..a..b\n \n\nThe quality of every row and every column is 2.\n\n* * *"}, {"input": "2", "output": "-1"}] |
If the required domino placement doesn't exist, print a single integer `-1`.
Otherwise, output your placement as N strings of N characters each. If a
square is not covered, the corresponding character must be `.` (a dot).
Otherwise, it must contain a lowercase English letter. Squares covered by the
same domino piece must contain the same letter. If two squares have a common
side but belong to different pieces, they must contain different letters.
* * * | s678078601 | Accepted | p02825 | Input is given from Standard Input in the following format:
N | N = int(input())
if N == 2:
print(-1)
exit()
if N == 3:
print("aa.")
print("..a")
print("..a")
exit()
def f(n, m):
a = ""
b = ""
for i in range(n):
if i == 2 * m - 2 or i == 2 * m - 1:
a += "a"
b += "b"
elif i == n - 2 * m:
a += "a"
b += "a"
elif i == n - 2 * m + 1:
a += "b"
b += "b"
else:
a += "."
b += "."
print(a)
print(b)
def g(n, m):
a = ""
b = ""
for i in range(n):
if i == 2 * m - 2:
a += "a"
b += "a"
elif i == 2 * m - 1:
a += "b"
b += "b"
elif i == n - 2 * m or i == n - 2 * m + 1:
a += "a"
b += "b"
else:
a += "."
b += "."
print(a)
print(b)
if N % 4 == 0:
for i in range(N // 4 - 1):
f(N, i + 1)
a = ""
b = ""
c = ""
d = ""
for i in range(N):
if i == (N // 2) - 2:
a += "a"
b += "d"
c += "c"
d += "c"
elif i == (N // 2) - 1:
a += "a"
b += "d"
c += "b"
d += "b"
elif i == N // 2:
a += "b"
b += "b"
c += "a"
d += "d"
elif i == (N // 2) + 1:
a += "c"
b += "c"
c += "a"
d += "d"
else:
a += "."
b += "."
c += "."
d += "."
print(a)
print(b)
print(c)
print(d)
for i in range(N // 4 - 1):
g(N, (N // 4) - i - 1)
if N % 4 == 1:
for i in range(N // 4 - 1):
f(N, i + 1)
a = ""
b = ""
c = ""
d = ""
e = ""
for i in range(N):
if i == (N // 2) - 2:
a += "a"
b += "a"
c += "b"
d += "b"
e += "a"
elif i == (N // 2) - 1:
a += "b"
b += "c"
c += "."
d += "."
e += "a"
elif i == N // 2:
a += "b"
b += "c"
c += "."
d += "."
e += "b"
elif i == (N // 2) + 1:
a += "a"
b += "."
c += "a"
d += "a"
e += "b"
elif i == (N // 2) + 2:
a += "a"
b += "b"
c += "b"
d += "c"
e += "c"
else:
a += "."
b += "."
c += "."
d += "."
e += "."
print(a)
print(b)
print(c)
print(d)
print(e)
for i in range(N // 4 - 1):
g(N, (N // 4) - i - 1)
if N % 4 == 2:
for i in range(N // 4 - 1):
f(N, i + 1)
a = ""
b = ""
c = ""
d = ""
e = ""
f = ""
for i in range(N):
if i == (N // 2) - 3:
a += "a"
b += "a"
c += "b"
d += "b"
e += "a"
f += "a"
elif i == (N // 2) - 2:
a += "b"
b += "b"
c += "a"
d += "a"
e += "b"
f += "b"
elif i == (N // 2) - 1:
a += "a"
b += "."
c += "b"
d += "."
e += "a"
f += "."
elif i == N // 2:
a += "a"
b += "."
c += "b"
d += "."
e += "a"
f += "."
elif i == (N // 2) + 1:
a += "."
b += "b"
c += "."
d += "a"
e += "."
f += "b"
elif i == (N // 2) + 2:
a += "."
b += "b"
c += "."
d += "a"
e += "."
f += "b"
else:
a += "."
b += "."
c += "."
d += "."
e += "."
f += "."
print(a)
print(b)
print(c)
print(d)
print(e)
print(f)
for i in range(N // 4 - 1):
g(N, (N // 4) - i - 1)
if N % 4 == 3:
for i in range(N // 4 - 1):
f(N, i + 1)
a = ""
b = ""
c = ""
d = ""
e = ""
f = ""
h = ""
for i in range(N):
if i == (N // 2) - 3:
a += "a"
b += "b"
c += "a"
d += "."
e += "."
f += "."
h += "."
elif i == (N // 2) - 2:
a += "a"
b += "b"
c += "a"
d += "."
e += "."
f += "."
h += "."
elif i == (N // 2) - 1:
a += "b"
b += "a"
c += "b"
d += "."
e += "."
f += "."
h += "."
elif i == N // 2:
a += "b"
b += "a"
c += "b"
d += "."
e += "."
f += "."
h += "."
elif i == (N // 2) + 1:
a += "c"
b += "c"
c += "."
d += "b"
e += "b"
f += "a"
h += "a"
elif i == (N // 2) + 2:
a += "."
b += "."
c += "c"
d += "a"
e += "a"
f += "b"
h += "b"
elif i == (N // 2) + 3:
a += "."
b += "."
c += "c"
d += "b"
e += "b"
f += "a"
h += "a"
else:
a += "."
b += "."
c += "."
d += "."
e += "."
f += "."
h += "."
print(a)
print(b)
print(c)
print(d)
print(e)
print(f)
print(h)
for i in range(N // 4 - 1):
g(N, (N // 4) - i - 1)
| Statement
Let us consider a grid of squares with N rows and N columns. You want to put
some domino pieces on this grid. Each domino piece covers two squares that
have a common side. Each square can be covered by at most one piece.
For each row of the grid, let's define its quality as the number of domino
pieces that cover at least one square in this row. We define the quality of
each column similarly.
Find a way to put at least one domino piece on the grid so that the quality of
every row is equal to the quality of every column, or determine that such a
placement doesn't exist. | [{"input": "6", "output": "aabb..\n b..zz.\n ba....\n .a..aa\n ..a..b\n ..a..b\n \n\nThe quality of every row and every column is 2.\n\n* * *"}, {"input": "2", "output": "-1"}] |
Print the answer.
* * * | s244041921 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | a = list(map(str, input().split()))
b = [a[i][0] for i in range(3)]
c = [b[i].upper() for i in range(3)]
print("".join(c))
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s656839119 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | import sys
import math
import collections
import itertools
import array
import inspect
# Set max recursion limit
sys.setrecursionlimit(1000000)
# Debug output
def chkprint(*args):
names = {id(v): k for k, v in inspect.currentframe().f_back.f_locals.items()}
print(", ".join(names.get(id(arg), "???") + " = " + repr(arg) for arg in args))
# Binary converter
def to_bin(x):
return bin(x)[2:]
def li_input():
return [int(_) for _ in input().split()]
def gcd(n, m):
if n % m == 0:
return m
else:
return gcd(m, n % m)
def gcd_list(L):
v = L[0]
for i in range(1, len(L)):
v = gcd(v, L[i])
return v
def lcm(n, m):
return (n * m) // gcd(n, m)
def lcm_list(L):
v = L[0]
for i in range(1, len(L)):
v = lcm(v, L[i])
return v
# Width First Search (+ Distance)
def wfs_d(D, N, K):
"""
D: 隣接行列(距離付き)
N: ノード数
K: 始点ノード
"""
dfk = [-1] * (N + 1)
dfk[K] = 0
cps = [(K, 0)]
r = [False] * (N + 1)
r[K] = True
while len(cps) != 0:
n_cps = []
for cp, cd in cps:
for i, dfcp in enumerate(D[cp]):
if dfcp != -1 and not r[i]:
dfk[i] = cd + dfcp
n_cps.append((i, cd + dfcp))
r[i] = True
cps = n_cps[:]
return dfk
# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
"""
v: 現在のノード
pre: 1つ前のノード
dist: 現在の距離
以下は別途用意する
D: 隣接リスト(行列ではない)
D_dfs_d: dfs_d関数で用いる,始点ノードから見た距離リスト
"""
global D
global D_dfs_d
D_dfs_d[v] = dist
for next_v, d in D[v]:
if next_v != pre:
dfs_d(next_v, v, dist + d)
return
def sigma(N):
ans = 0
for i in range(1, N + 1):
ans += i
return ans
def comb(n, r):
if n - r < r:
r = n - r
if r == 0:
return 1
if r == 1:
return n
numerator = [n - r + k + 1 for k in range(r)]
denominator = [k + 1 for k in range(r)]
for p in range(2, r + 1):
pivot = denominator[p - 1]
if pivot > 1:
offset = (n - r) % p
for k in range(p - 1, r, p):
numerator[k - offset] /= pivot
denominator[k] /= pivot
result = 1
for k in range(r):
if numerator[k] > 1:
result *= int(numerator[k])
return result
def bisearch(L, target):
low = 0
high = len(L) - 1
while low <= high:
mid = (low + high) // 2
guess = L[mid]
if guess == target:
return True
elif guess < target:
low = mid + 1
elif guess > target:
high = mid - 1
if guess != target:
return False
# --------------------------------------------
dp = None
def main():
S = input().split()
print(S[0][0].upper() + S[1][0].upper() + S[2][0].upper())
main()
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s170648974 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | a, b, c = map(int, input().split())
acnt = 0
bcnt = 0
ccnt = 0
cnt = 0
if a == b and a == c and a % 2 == 0:
print(-1)
exit()
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
cnt += 1
acnt = (b + c) // 2
bcnt = (a + c) // 2
ccnt = (a + b) // 2
a = acnt
b = bcnt
c = ccnt
print(cnt)
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s682419140 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | ss = input().split()
print(ss[0][0].upper() + ss[1][0].upper() + ss[2][0].upper())
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s076907673 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | x, y, z = map(str, input().split())
print(x[0].upper() + y[0].upper() + z[0].upper())
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s882591714 | Wrong Answer | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | i = input().split()
print(i[0][0].upper(), i[1][0].upper(), i[2][0].upper())
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s050132348 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | print(*map(lambda s: s[0].upper(), input().split()), sep="")
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s550429135 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | print("".join([i[0].upper() for i in input().split()]))
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s078844997 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | print(*[*zip(*input().upper().split())][0], sep="")
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s652363544 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | print("".join(list(map(lambda x: x[0], input().split()))).upper())
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s054003111 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | print("".join([c[0] for c in input().split()]).upper())
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s574490168 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | print("".join(s[0] for s in input().split()).upper())
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s777269123 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | a,b,c===input().split()
print((a[0]+b[0]+c[0]).upper()) | Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s742639165 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | strs = input.split()
print("".join([a[0].upper() for a in strs]))
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s473544170 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | x, y, z = map(string, input().split())
print(x[:1] + y[:1] + z[:1])
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s518803935 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | print([*zip(*input().split())][0].upper())
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s896776295 | Wrong Answer | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | print("".join(map(lambda x: x[0], input().split())))
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s515276359 | Wrong Answer | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | print("".join(list(map(lambda s: s[:1], input().split(" ")))))
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s704964252 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | # your code goes here
data = input().split(" ")
print("".join([n[0].upper() for n in data]))
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s695945467 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | def c(ints):
for i in range(len(ints)):
if ints[i] != 0:
sig = 1 if ints[i] > 0 else -1
total = ints[i]
mov = i + 1
j = i
break
if i == len(ints) - 1:
return i + 1
for i_ in ints[j + 1 :]:
tmp = total + i_
if tmp == 0:
mov += 1
tmp = -sig
elif sig * tmp > 0:
mov += abs(tmp) + 1
tmp = -sig
sig *= -1
total = tmp
return mov
_ = input()
inp = input()
inp = inp.split(" ")
inp = [int(i_) for i_ in inp]
print(c(inp))
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s193754549 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | n = int(input())
b = list(map(int, input().split()))
a = b
condition = ""
cnt = 0
wa = 0
for i in range(n):
wa += a[i]
if i == 0:
if a[i] > 0:
condition = "minus"
else:
condition = "plus"
elif condition == "plus":
condition = "minus"
if wa <= 0:
cnt += abs(wa) + 1
a[i] += abs(wa) + 1
wa += abs(wa) + 1
elif condition == "minus":
condition = "plus"
if wa >= 0:
cnt += abs(wa) + 1
a[i] -= abs(wa) + 1
wa -= abs(wa) + 1
cnt1 = cnt
a = b
condition = ""
cnt = 0
wa = 0
for i in range(n):
a[i] = a[i] / abs(a[i]) * (-1)
cnt += abs(a[i]) + 1
wa += a[i]
if i == 0:
if a[i] > 0:
condition = "minus"
else:
condition = "plus"
elif condition == "plus":
condition = "minus"
if wa <= 0:
cnt += abs(wa) + 1
a[i] += abs(wa) + 1
wa += abs(wa) + 1
elif condition == "minus":
condition = "plus"
if wa >= 0:
cnt += abs(wa) + 1
a[i] -= abs(wa) + 1
wa -= abs(wa) + 1
cnt2 = cnt
print(min(cnt1, cnt2))
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s764287841 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | n = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
total = 0
fugo = 0
count = 0
for i in a:
total += i
if fugo == 0:
total = i
if total > 0:
fugo = 1
else:
fugo = -1
continue
elif fugo > 0:
fugo = -1
if total >= 0:
while total >= 0:
count += 1
total -= 1
elif fugo < 0:
fugo = 1
if total <= 0:
while total <= 0:
count += 1
total += 1
print(count)
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s916150968 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | ; | Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s529150476 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | a, b, c = map(str, input().split())
first = a[0].upper()
second = b[0].upper()
third = c[0].upper()
print(first + second + third)
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s284010623 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | A, B, C = list(map(str, input().split()))
print((chr(-32 + ord(A[0]))) + (chr(-32 + ord(B[0]))) + (chr(-32 + ord(C[0]))))
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s319182067 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | small = "abcdefghijklmnopqrstuvwxyz"
big = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
a, b, c = map(str, input().split())
i = small.find(a[0])
j = small.find(b[0])
k = small.find(c[0])
print(big[i] + big[j] + big[k])
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s481586917 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | N = int(input())
seq = [int(x) for x in input().split()]
a_sum = seq[0]
op = 0
for a in seq[1:]:
tmp = a_sum + a
if tmp * a_sum < 0:
a_sum = tmp
elif a_sum < 0:
diff = 1 - a_sum - a
a_sum = 1
op += abs(diff)
elif a_sum > 0:
diff = -1 - a_sum - a
a_sum = -1
op += abs(diff)
print(op)
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s194002428 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | a=input()
b=input()
if a>b:
print("GREATER")
elif a=b:
print("EQUAL")
else:
print("LESS") | Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s552626000 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | # -*- coding: utf-8 -*-
s,t,u = map(str,input().split())
S = s[0]
T = t[0]
U = u[0]
print("{}".format(S+T+U.upper()) | Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s896764778 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | a = list(map(str,input().split()))
c = str()
for i in range(3):
c += a[i]a[0].upper()
print(c)
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s665272574 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <climits>
#include <math.h>
#include <utility>
using namespace std;
typedef long long ll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<long long> vll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<bool>> vvb;
typedef vector<vector<int>> vvi;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define all(a) a.begin(),a.end()
int main() {
vs s(3);
rep(i, 3)cin >> s.at(i);
rep(i, 3) {
cout << char(s.at(i).at(0) - 32);
}
cout << endl;
return 0;
}
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s529385807 | Wrong Answer | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | b, c, d = list(map(str, input().split()))
print(b[0].upper, end="")
print(c[0].upper, end="")
print(d[0].upper)
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s140871751 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | a=input()
b=input()
if a>b:
print("GREATER")
elif a=b:
print("EQUAL")
else:
print("LESS") | Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s434777855 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 |
import numpy as np
import math
s=" "+input()
for i in range(len(s)):
if(s[i]==" "):
print(char((ord)s[i+1]-(ord)'a'+(ord)'A'),end="")
print() | Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s061111732 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | コードテスト
解説
提出 #6259010
ソースコード 拡げる
Copy
Copy
n=int(input())
b=list(map(int,input().split()))
a=b
condition=''
cnt=0
wa=0
for i in range(n):
wa+=a[i]
if i == 0:
if a[i]>0:
condition='minus'
else:
condition='plus'
elif condition == 'plus':
condition='minus'
if wa<=0:
cnt+=abs(wa)+1
a[i]+=abs(wa)+1
wa+=abs(wa)+1
elif condition == 'minus':
condition='plus'
if wa>=0:
cnt+=abs(wa)+1
a[i]-=abs(wa)-1
wa-=abs(wa)-1
print(cnt) | Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s346711400 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | s1,s2,s3 = map(int,input().split())
print(s1[0].capitalize() + s2[0].capitalize() + s3[0]capitalize()) | Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s497325210 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | // スタックサイズ: 100MB
#define _USE_MATH_DEFINES
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <unordered_map>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <numeric>
#include <iomanip>
#include <queue>
#include <list>
#include <set>
using namespace std;
typedef int64_t ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
const ll INF = 1e18;
const double EPS = 1e-10;
const ll mod = 1e9 + 7;
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define fori(i, a, b) for (ll i = (a); i < (b); ++i)
#define ford(i, a, b) for (ll i = (b - 1); (a) <= i; --i)
#define rep(i, n) fori(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define fst first
#define snd second
ll pw(ll x, ll y) { ll r = 1; rep(i, y) { r *= x; }; return r; }
int main() {
fastio;
string a, b, c;
cin >> a >> b >> c;
cout << char(a[0] + 'A' - 'a') << char(b[0] + 'A' - 'a') << char(c[0] + 'A' - 'a') << endl;
} | Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s914586974 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | num = input().split()
print(num[0][0].upper() + num[1][0].upper() + num[2][0].upper())
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s413999280 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | s_li = input().split()
print(s_li[0][0].upper() + s_li[1][0].upper() + s_li[2][0].upper())
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s335402235 | Wrong Answer | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | line = input("")
# words=line.split()
letters = [line[0] for word in line]
print("".join(letters))
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s174736958 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | s1, s2, s3 = input().split(" ")
print(s1[0].upper()+s2[0].upper()+s3[0].upper()) | Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s061765240 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | nums = input().split()
print(nums[0][0].upper()+nums[1][0].upper()+nums[2][0].upper | Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s280171891 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | s1, s2, s3 = input().split())
print(s1[0].upper() + s2[0].upper() + s3[0].upper()) | Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s876603358 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | s = list(map(int,input().split())
print(s[0][0].upper()+s[1][0].upper()+s[2][0].upper()) | Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s068822618 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | s,t,u = map(str,input().spilt())
print(str.upper(s[0]+str.upper(t[0]+str.upper(u[0]))
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s287617222 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | ls = input().upper().split()
print(ls[0][0] + ls[1][0] + ls[2][0])
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s583414083 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | List = list(input().split())
for n in List:
print(n[0].Upper(), end="")
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s457882529 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | s1 s2 s3=input().split()
print(s1[0].upper()+s2[0].upper()+s3[0].upper())
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s823183475 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | a,b,c = input().split()
print(a[0].upper() +b[0].upper() + c[0]upper()) | Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s045641779 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | a,b,c = input().split()
print(a[0].upper() + b[0].upper() + c[0]upper()) | Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s474421260 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | A.upper(), B.upper(), C.upper() = input().split()
print(A[0] + B[0] + C[0])
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s668702427 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 |
s1, s2, s3 = input().split())
print(str.upper(s1[0]+" "+s2[0]+" "+s3[0])) | Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s574229264 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | List = list(input().upper().split())
for s in List:
print(n[0], end="")
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s103349267 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | print("".join([x[0].title() for x in input().split()]))
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s335055474 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | print("".join(map(lambda x: x[0].upper(), input().split(" "))))
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s814621527 | Accepted | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | print(*[s[0].upper() for s in input().split()], sep="")
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s908264052 | Wrong Answer | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | print(str.upper("".join(input().split())))
| Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |
Print the answer.
* * * | s306374780 | Runtime Error | p03737 | Input is given from Standard Input in the following format:
s_1 s_2 s_3 | print(a[0],end=""for a in input().upper().split()) | Statement
You are given three words s_1, s_2 and s_3, each composed of lowercase English
letters, with spaces in between. Print the acronym formed from the uppercased
initial letters of the words. | [{"input": "atcoder beginner contest", "output": "ABC\n \n\nThe initial letters of `atcoder`, `beginner` and `contest` are `a`, `b` and\n`c`. Uppercase and concatenate them to obtain `ABC`.\n\n* * *"}, {"input": "resident register number", "output": "RRN\n \n\n* * *"}, {"input": "k nearest neighbor", "output": "KNN\n \n\n* * *"}, {"input": "async layered coding", "output": "ALC"}] |