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 the maximum number of friendly pairs.
* * *
|
s968534041
|
Wrong Answer
|
p03411
|
Input is given from Standard Input in the following format:
N
a_1 b_1
a_2 b_2
:
a_N b_N
c_1 d_1
c_2 d_2
:
c_N d_N
|
N = int(input())
ab = [tuple(map(int, input().split())) for i in range(N)]
cd = [tuple(map(int, input().split())) for i in range(N)]
result = []
for i in range(N):
xr, yr = ab[i]
xb, yb = cd[i]
if xr < xb or yr < yb:
result.append("BINGO!!!")
print(len(result))
|
Statement
On a two-dimensional plane, there are N red points and N blue points. The
coordinates of the i-th red point are (a_i, b_i), and the coordinates of the
i-th blue point are (c_i, d_i).
A red point and a blue point can form a _friendly pair_ when, the x-coordinate
of the red point is smaller than that of the blue point, and the y-coordinate
of the red point is also smaller than that of the blue point.
At most how many friendly pairs can you form? Note that a point cannot belong
to multiple pairs.
|
[{"input": "3\n 2 0\n 3 1\n 1 3\n 4 2\n 0 4\n 5 5", "output": "2\n \n\nFor example, you can pair (2, 0) and (4, 2), then (3, 1) and (5, 5).\n\n* * *"}, {"input": "3\n 0 0\n 1 1\n 5 2\n 2 3\n 3 4\n 4 5", "output": "2\n \n\nFor example, you can pair (0, 0) and (2, 3), then (1, 1) and (3, 4).\n\n* * *"}, {"input": "2\n 2 2\n 3 3\n 0 0\n 1 1", "output": "0\n \n\nIt is possible that no pair can be formed.\n\n* * *"}, {"input": "5\n 0 0\n 7 3\n 2 2\n 4 8\n 1 6\n 8 5\n 6 9\n 5 4\n 9 1\n 3 7", "output": "5\n \n\n* * *"}, {"input": "5\n 0 0\n 1 1\n 5 5\n 6 6\n 7 7\n 2 2\n 3 3\n 4 4\n 8 8\n 9 9", "output": "4"}]
|
Print the maximum number of friendly pairs.
* * *
|
s188044638
|
Runtime Error
|
p03411
|
Input is given from Standard Input in the following format:
N
a_1 b_1
a_2 b_2
:
a_N b_N
c_1 d_1
c_2 d_2
:
c_N d_N
|
N = int(input())
ab = [tuple(map(int,input().split())) for i in range(N)]
cd = [tuple(map(int,input().split())) for i in range(N)]
result = []
for i in range(N):
xr , yr = ab[i]
xb, yb = cd[i]
if xr < xb or yr < yb:
print(xr, yr, xb, yb)
result.append('BINGO!!!')
print(len(result))
|
Statement
On a two-dimensional plane, there are N red points and N blue points. The
coordinates of the i-th red point are (a_i, b_i), and the coordinates of the
i-th blue point are (c_i, d_i).
A red point and a blue point can form a _friendly pair_ when, the x-coordinate
of the red point is smaller than that of the blue point, and the y-coordinate
of the red point is also smaller than that of the blue point.
At most how many friendly pairs can you form? Note that a point cannot belong
to multiple pairs.
|
[{"input": "3\n 2 0\n 3 1\n 1 3\n 4 2\n 0 4\n 5 5", "output": "2\n \n\nFor example, you can pair (2, 0) and (4, 2), then (3, 1) and (5, 5).\n\n* * *"}, {"input": "3\n 0 0\n 1 1\n 5 2\n 2 3\n 3 4\n 4 5", "output": "2\n \n\nFor example, you can pair (0, 0) and (2, 3), then (1, 1) and (3, 4).\n\n* * *"}, {"input": "2\n 2 2\n 3 3\n 0 0\n 1 1", "output": "0\n \n\nIt is possible that no pair can be formed.\n\n* * *"}, {"input": "5\n 0 0\n 7 3\n 2 2\n 4 8\n 1 6\n 8 5\n 6 9\n 5 4\n 9 1\n 3 7", "output": "5\n \n\n* * *"}, {"input": "5\n 0 0\n 1 1\n 5 5\n 6 6\n 7 7\n 2 2\n 3 3\n 4 4\n 8 8\n 9 9", "output": "4"}]
|
Print the maximum number of friendly pairs.
* * *
|
s921283320
|
Runtime Error
|
p03411
|
Input is given from Standard Input in the following format:
N
a_1 b_1
a_2 b_2
:
a_N b_N
c_1 d_1
c_2 d_2
:
c_N d_N
|
N = int(input())
ab = [tuple(map(int,input().split())) for i in range(N)]
cd = [tuple(map(int,input().split())) for i in range(N)]
result = []
for i in range(N):
xr , yr = ab[i]
xb, yb = cd[i]
if xr < xb and yr < yb:
result.append('BINGO!!!')
print(len(result))
|
Statement
On a two-dimensional plane, there are N red points and N blue points. The
coordinates of the i-th red point are (a_i, b_i), and the coordinates of the
i-th blue point are (c_i, d_i).
A red point and a blue point can form a _friendly pair_ when, the x-coordinate
of the red point is smaller than that of the blue point, and the y-coordinate
of the red point is also smaller than that of the blue point.
At most how many friendly pairs can you form? Note that a point cannot belong
to multiple pairs.
|
[{"input": "3\n 2 0\n 3 1\n 1 3\n 4 2\n 0 4\n 5 5", "output": "2\n \n\nFor example, you can pair (2, 0) and (4, 2), then (3, 1) and (5, 5).\n\n* * *"}, {"input": "3\n 0 0\n 1 1\n 5 2\n 2 3\n 3 4\n 4 5", "output": "2\n \n\nFor example, you can pair (0, 0) and (2, 3), then (1, 1) and (3, 4).\n\n* * *"}, {"input": "2\n 2 2\n 3 3\n 0 0\n 1 1", "output": "0\n \n\nIt is possible that no pair can be formed.\n\n* * *"}, {"input": "5\n 0 0\n 7 3\n 2 2\n 4 8\n 1 6\n 8 5\n 6 9\n 5 4\n 9 1\n 3 7", "output": "5\n \n\n* * *"}, {"input": "5\n 0 0\n 1 1\n 5 5\n 6 6\n 7 7\n 2 2\n 3 3\n 4 4\n 8 8\n 9 9", "output": "4"}]
|
Print the maximum number of friendly pairs.
* * *
|
s017059308
|
Wrong Answer
|
p03411
|
Input is given from Standard Input in the following format:
N
a_1 b_1
a_2 b_2
:
a_N b_N
c_1 d_1
c_2 d_2
:
c_N d_N
|
count = int(input())
a = [0] * count
b = [0] * count
c = 0
p = 0
m = 0
for i in range(count):
a[i] = list(map(int, input().split()))
for j in range(count):
b[j] = list(map(int, input().split()))
for k in range(count):
if p == 1:
break
for l in range(m, count):
if p == 1:
break
if a[k][0] < b[l][0]:
if p == 1:
break
if a[k][1] < b[l][1]:
if p == 1:
break
if l < count - 1:
m = l + 1
c += 1
if l == count - 1:
p = 1
break
break
print(c)
|
Statement
On a two-dimensional plane, there are N red points and N blue points. The
coordinates of the i-th red point are (a_i, b_i), and the coordinates of the
i-th blue point are (c_i, d_i).
A red point and a blue point can form a _friendly pair_ when, the x-coordinate
of the red point is smaller than that of the blue point, and the y-coordinate
of the red point is also smaller than that of the blue point.
At most how many friendly pairs can you form? Note that a point cannot belong
to multiple pairs.
|
[{"input": "3\n 2 0\n 3 1\n 1 3\n 4 2\n 0 4\n 5 5", "output": "2\n \n\nFor example, you can pair (2, 0) and (4, 2), then (3, 1) and (5, 5).\n\n* * *"}, {"input": "3\n 0 0\n 1 1\n 5 2\n 2 3\n 3 4\n 4 5", "output": "2\n \n\nFor example, you can pair (0, 0) and (2, 3), then (1, 1) and (3, 4).\n\n* * *"}, {"input": "2\n 2 2\n 3 3\n 0 0\n 1 1", "output": "0\n \n\nIt is possible that no pair can be formed.\n\n* * *"}, {"input": "5\n 0 0\n 7 3\n 2 2\n 4 8\n 1 6\n 8 5\n 6 9\n 5 4\n 9 1\n 3 7", "output": "5\n \n\n* * *"}, {"input": "5\n 0 0\n 1 1\n 5 5\n 6 6\n 7 7\n 2 2\n 3 3\n 4 4\n 8 8\n 9 9", "output": "4"}]
|
Print the maximum number of friendly pairs.
* * *
|
s447861231
|
Runtime Error
|
p03411
|
Input is given from Standard Input in the following format:
N
a_1 b_1
a_2 b_2
:
a_N b_N
c_1 d_1
c_2 d_2
:
c_N d_N
|
N = int(input())
ab = sorted([ tuple(map(int, input().split())) for x in range(N)], key=lambda x:x[1], reverse=True)
cd = sorted([ tuple(map(int, input().split())) for x in range(N)])
resultx = []
resulty = []
for xb, yb in list(cd):
for xr, yr in list(ab):
if (xr, yr) in resultx:
continue
if xr < xb and yr < yb:
resultx.append((xr,yr))
resulty.append((xb,yb))
break
print(len(resultx))
|
Statement
On a two-dimensional plane, there are N red points and N blue points. The
coordinates of the i-th red point are (a_i, b_i), and the coordinates of the
i-th blue point are (c_i, d_i).
A red point and a blue point can form a _friendly pair_ when, the x-coordinate
of the red point is smaller than that of the blue point, and the y-coordinate
of the red point is also smaller than that of the blue point.
At most how many friendly pairs can you form? Note that a point cannot belong
to multiple pairs.
|
[{"input": "3\n 2 0\n 3 1\n 1 3\n 4 2\n 0 4\n 5 5", "output": "2\n \n\nFor example, you can pair (2, 0) and (4, 2), then (3, 1) and (5, 5).\n\n* * *"}, {"input": "3\n 0 0\n 1 1\n 5 2\n 2 3\n 3 4\n 4 5", "output": "2\n \n\nFor example, you can pair (0, 0) and (2, 3), then (1, 1) and (3, 4).\n\n* * *"}, {"input": "2\n 2 2\n 3 3\n 0 0\n 1 1", "output": "0\n \n\nIt is possible that no pair can be formed.\n\n* * *"}, {"input": "5\n 0 0\n 7 3\n 2 2\n 4 8\n 1 6\n 8 5\n 6 9\n 5 4\n 9 1\n 3 7", "output": "5\n \n\n* * *"}, {"input": "5\n 0 0\n 1 1\n 5 5\n 6 6\n 7 7\n 2 2\n 3 3\n 4 4\n 8 8\n 9 9", "output": "4"}]
|
Print the maximum number of friendly pairs.
* * *
|
s841495989
|
Runtime Error
|
p03411
|
Input is given from Standard Input in the following format:
N
a_1 b_1
a_2 b_2
:
a_N b_N
c_1 d_1
c_2 d_2
:
c_N d_N
|
N=int(input())
p_x=[0]*(2*N)
p_y=[0]*(2*N)
//N未満は赤い点
for i in range(N):
x, y =map(int, input().split())
p_x[x]=i
p_y[y]=i
//N以上は青い点
for j in range(N):
x, y =map(int, input().split())
p_x[x]=N+j
p_y[y]=N+j
pairs=N
done_point=[]
for i in range(2*N-1, 0, -1):
if p_x[i]<N:
pairs -= 1
continue
else:
blue_x=i
blue_y=p_y.index(p_x[i])
for j in range(i-1, -1, -1)
if p_x[j] < N:
if p_x.index(p_x[j]) < blue_y:
if p_x[j] not in done_point:
done_point.append(p_x[j])
break
else:
pair -= 1
continue
else:
pair -= 1
continue
print(pairs)
|
Statement
On a two-dimensional plane, there are N red points and N blue points. The
coordinates of the i-th red point are (a_i, b_i), and the coordinates of the
i-th blue point are (c_i, d_i).
A red point and a blue point can form a _friendly pair_ when, the x-coordinate
of the red point is smaller than that of the blue point, and the y-coordinate
of the red point is also smaller than that of the blue point.
At most how many friendly pairs can you form? Note that a point cannot belong
to multiple pairs.
|
[{"input": "3\n 2 0\n 3 1\n 1 3\n 4 2\n 0 4\n 5 5", "output": "2\n \n\nFor example, you can pair (2, 0) and (4, 2), then (3, 1) and (5, 5).\n\n* * *"}, {"input": "3\n 0 0\n 1 1\n 5 2\n 2 3\n 3 4\n 4 5", "output": "2\n \n\nFor example, you can pair (0, 0) and (2, 3), then (1, 1) and (3, 4).\n\n* * *"}, {"input": "2\n 2 2\n 3 3\n 0 0\n 1 1", "output": "0\n \n\nIt is possible that no pair can be formed.\n\n* * *"}, {"input": "5\n 0 0\n 7 3\n 2 2\n 4 8\n 1 6\n 8 5\n 6 9\n 5 4\n 9 1\n 3 7", "output": "5\n \n\n* * *"}, {"input": "5\n 0 0\n 1 1\n 5 5\n 6 6\n 7 7\n 2 2\n 3 3\n 4 4\n 8 8\n 9 9", "output": "4"}]
|
Print the maximum number of friendly pairs.
* * *
|
s773232868
|
Wrong Answer
|
p03411
|
Input is given from Standard Input in the following format:
N
a_1 b_1
a_2 b_2
:
a_N b_N
c_1 d_1
c_2 d_2
:
c_N d_N
|
#!/usr/bin/python3
# -*- coding:utf-8 -*-
def main():
n = int(input())
lr = [list(map(int, input().split())) + [0] for _ in range(n)]
lb = [list(map(int, input().split())) + [1] for _ in range(n)]
lrb = sorted(lr + lb, key=lambda x: x[0])
ignore = []
rcnt = 0
for x, y, c in lrb:
if c == 0:
rcnt += 1
if c == 1:
if rcnt == 0:
ignore.append([x, y, c])
else:
rcnt -= 1
# lrb = sorted(lr + lb, key=lambda x: x[1])
# rcnt = 0
# for x, y, c in lrb:
# if [x, y, c] in ignore:
# continue
# if c == 0:
# rcnt += 1
# if c == 1:
# if rcnt == 0:
# ignore.append([x, y, c])
# else:
# rcnt -= 1
print(n - len(ignore))
if __name__ == "__main__":
main()
|
Statement
On a two-dimensional plane, there are N red points and N blue points. The
coordinates of the i-th red point are (a_i, b_i), and the coordinates of the
i-th blue point are (c_i, d_i).
A red point and a blue point can form a _friendly pair_ when, the x-coordinate
of the red point is smaller than that of the blue point, and the y-coordinate
of the red point is also smaller than that of the blue point.
At most how many friendly pairs can you form? Note that a point cannot belong
to multiple pairs.
|
[{"input": "3\n 2 0\n 3 1\n 1 3\n 4 2\n 0 4\n 5 5", "output": "2\n \n\nFor example, you can pair (2, 0) and (4, 2), then (3, 1) and (5, 5).\n\n* * *"}, {"input": "3\n 0 0\n 1 1\n 5 2\n 2 3\n 3 4\n 4 5", "output": "2\n \n\nFor example, you can pair (0, 0) and (2, 3), then (1, 1) and (3, 4).\n\n* * *"}, {"input": "2\n 2 2\n 3 3\n 0 0\n 1 1", "output": "0\n \n\nIt is possible that no pair can be formed.\n\n* * *"}, {"input": "5\n 0 0\n 7 3\n 2 2\n 4 8\n 1 6\n 8 5\n 6 9\n 5 4\n 9 1\n 3 7", "output": "5\n \n\n* * *"}, {"input": "5\n 0 0\n 1 1\n 5 5\n 6 6\n 7 7\n 2 2\n 3 3\n 4 4\n 8 8\n 9 9", "output": "4"}]
|
Print the maximum number of friendly pairs.
* * *
|
s469973780
|
Runtime Error
|
p03411
|
Input is given from Standard Input in the following format:
N
a_1 b_1
a_2 b_2
:
a_N b_N
c_1 d_1
c_2 d_2
:
c_N d_N
|
N = int(input())
A = list(map(int, input().split()))
sum_even = sum(map(lambda i: A[i] if A[i] > 0 else 0, range(1, N, 2)))
sum_odd = sum(map(lambda i: A[i] if A[i] > 0 else 0, range(0, N, 2)))
if sum_even == 0 and sum_odd == 0:
max_ = max(A)
print(max_)
index = A.index(max_)
print(len(A) - 1)
for _ in range(index):
print(1)
for j in range(N - index - 1):
print(N - index - j)
exit()
print(max(sum_even, sum_odd))
EVEN = sum_even >= sum_odd
ans = []
if EVEN:
A = A[1:]
ans.append(1)
if len(A) % 2 == 0:
ans.append(len(A))
A = A[:-1]
while len(A) > 1:
if A[0] <= 0:
ans.append(1)
ans.append(1)
A = A[2:]
else:
if A[2] <= 0:
ans.append(3)
A.pop(2)
if len(A) == 2:
ans.append(2)
A.pop(1)
else:
ans.append(3)
A.pop(2)
else:
ans.append(2)
A.pop(1)
A[0] += A.pop(1)
print(len(ans))
for a in ans:
print(a)
|
Statement
On a two-dimensional plane, there are N red points and N blue points. The
coordinates of the i-th red point are (a_i, b_i), and the coordinates of the
i-th blue point are (c_i, d_i).
A red point and a blue point can form a _friendly pair_ when, the x-coordinate
of the red point is smaller than that of the blue point, and the y-coordinate
of the red point is also smaller than that of the blue point.
At most how many friendly pairs can you form? Note that a point cannot belong
to multiple pairs.
|
[{"input": "3\n 2 0\n 3 1\n 1 3\n 4 2\n 0 4\n 5 5", "output": "2\n \n\nFor example, you can pair (2, 0) and (4, 2), then (3, 1) and (5, 5).\n\n* * *"}, {"input": "3\n 0 0\n 1 1\n 5 2\n 2 3\n 3 4\n 4 5", "output": "2\n \n\nFor example, you can pair (0, 0) and (2, 3), then (1, 1) and (3, 4).\n\n* * *"}, {"input": "2\n 2 2\n 3 3\n 0 0\n 1 1", "output": "0\n \n\nIt is possible that no pair can be formed.\n\n* * *"}, {"input": "5\n 0 0\n 7 3\n 2 2\n 4 8\n 1 6\n 8 5\n 6 9\n 5 4\n 9 1\n 3 7", "output": "5\n \n\n* * *"}, {"input": "5\n 0 0\n 1 1\n 5 5\n 6 6\n 7 7\n 2 2\n 3 3\n 4 4\n 8 8\n 9 9", "output": "4"}]
|
Print the maximum number of friendly pairs.
* * *
|
s278591301
|
Accepted
|
p03411
|
Input is given from Standard Input in the following format:
N
a_1 b_1
a_2 b_2
:
a_N b_N
c_1 d_1
c_2 d_2
:
c_N d_N
|
# 2d plane 2n points
n = int(input())
cnt = 0
red = []
blue = []
for _ in range(n):
x, y = map(int, input().split())
red.append((x, y))
for _ in range(n):
x, y = map(int, input().split())
blue.append((x, y))
red = sorted(red, key=lambda x: x[0])
blue = sorted(blue, key=lambda x: x[0])
blue = blue[::-1]
for i in range(n - 1, -1, -1):
x, y = red[i][0], red[i][1]
d = []
for some in blue:
X, Y = some[0], some[1]
if X > x:
d.append((X, Y))
if d:
d = sorted(d, key=lambda x: x[1])
node = 0
for some in d:
if some[1] > y:
node = some
cnt += 1
break
if node != 0:
blue.remove(node)
print(cnt)
|
Statement
On a two-dimensional plane, there are N red points and N blue points. The
coordinates of the i-th red point are (a_i, b_i), and the coordinates of the
i-th blue point are (c_i, d_i).
A red point and a blue point can form a _friendly pair_ when, the x-coordinate
of the red point is smaller than that of the blue point, and the y-coordinate
of the red point is also smaller than that of the blue point.
At most how many friendly pairs can you form? Note that a point cannot belong
to multiple pairs.
|
[{"input": "3\n 2 0\n 3 1\n 1 3\n 4 2\n 0 4\n 5 5", "output": "2\n \n\nFor example, you can pair (2, 0) and (4, 2), then (3, 1) and (5, 5).\n\n* * *"}, {"input": "3\n 0 0\n 1 1\n 5 2\n 2 3\n 3 4\n 4 5", "output": "2\n \n\nFor example, you can pair (0, 0) and (2, 3), then (1, 1) and (3, 4).\n\n* * *"}, {"input": "2\n 2 2\n 3 3\n 0 0\n 1 1", "output": "0\n \n\nIt is possible that no pair can be formed.\n\n* * *"}, {"input": "5\n 0 0\n 7 3\n 2 2\n 4 8\n 1 6\n 8 5\n 6 9\n 5 4\n 9 1\n 3 7", "output": "5\n \n\n* * *"}, {"input": "5\n 0 0\n 1 1\n 5 5\n 6 6\n 7 7\n 2 2\n 3 3\n 4 4\n 8 8\n 9 9", "output": "4"}]
|
Print the maximum number of friendly pairs.
* * *
|
s521255266
|
Accepted
|
p03411
|
Input is given from Standard Input in the following format:
N
a_1 b_1
a_2 b_2
:
a_N b_N
c_1 d_1
c_2 d_2
:
c_N d_N
|
# 2部マッチング
N = int(input())
A = [list(map(int, input().split())) for _ in range(N)]
B = [list(map(int, input().split())) for _ in range(N)]
def dfs(v, visited):
for u in edge[v]:
if u in visited:
continue
visited.add(u)
if matched[u] == -1 or dfs(matched[u], visited):
matched[u] = v
return True
return False
matched = [-1] * N
edge = [set() for _ in range(N)]
for i, a in enumerate(A):
for j, b in enumerate(B):
if a[0] < b[0] and a[1] < b[1]:
edge[i].add(j)
print(sum(dfs(v, set()) for v in range(N)))
|
Statement
On a two-dimensional plane, there are N red points and N blue points. The
coordinates of the i-th red point are (a_i, b_i), and the coordinates of the
i-th blue point are (c_i, d_i).
A red point and a blue point can form a _friendly pair_ when, the x-coordinate
of the red point is smaller than that of the blue point, and the y-coordinate
of the red point is also smaller than that of the blue point.
At most how many friendly pairs can you form? Note that a point cannot belong
to multiple pairs.
|
[{"input": "3\n 2 0\n 3 1\n 1 3\n 4 2\n 0 4\n 5 5", "output": "2\n \n\nFor example, you can pair (2, 0) and (4, 2), then (3, 1) and (5, 5).\n\n* * *"}, {"input": "3\n 0 0\n 1 1\n 5 2\n 2 3\n 3 4\n 4 5", "output": "2\n \n\nFor example, you can pair (0, 0) and (2, 3), then (1, 1) and (3, 4).\n\n* * *"}, {"input": "2\n 2 2\n 3 3\n 0 0\n 1 1", "output": "0\n \n\nIt is possible that no pair can be formed.\n\n* * *"}, {"input": "5\n 0 0\n 7 3\n 2 2\n 4 8\n 1 6\n 8 5\n 6 9\n 5 4\n 9 1\n 3 7", "output": "5\n \n\n* * *"}, {"input": "5\n 0 0\n 1 1\n 5 5\n 6 6\n 7 7\n 2 2\n 3 3\n 4 4\n 8 8\n 9 9", "output": "4"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s840097001
|
Wrong Answer
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
s = input()
a = 0
b = 0
for i in range(len(s)):
if s[i] == "1":
a += 1
else:
b += 1
print(min(a, b) * 2)
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s483071652
|
Accepted
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
a, s, d = map(int, input().split())
print(min(s // a, d))
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s157721237
|
Runtime Error
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
# D - Decayed Bridges
from collections import deque
N, M = map(int, input().split())
graph = [[] for _ in range(N)]
AB = deque()
for i in range(M):
a, b = map(int, input().split())
a -= 1
b -= 1
AB.append([a, b])
graph[a].append(b)
graph[b].append(a)
def isDivided(a, b, graph):
d = deque()
d.append(a)
done = [0] * N
while len(d) > 0:
now = d.popleft()
done[now] = 1
for i in graph[now]:
if i == b:
return 0
elif done[i] == 0:
d.append(i)
return sum(done)
ans = 0
for i in range(M):
a, b = AB.popleft()
graph[a].remove(b)
graph[b].remove(a)
tmpa = isDivided(a, b, graph)
tmpb = isDivided(b, a, graph)
if tmpa != 0:
ans += tmpa * tmpb
print(ans)
else:
print(ans)
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s048982213
|
Runtime Error
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
data = input().split()
n = int(data[0])
m = int(data[1])
edge = []
for i in range(m):
tmp = []
data = input().split()
tmp.append(int(data[0]) - 1)
tmp.append(int(data[1]) - 1)
edge.append(tmp)
grp = list(range(0, n))
def group(num):
if grp[num] == num:
return num
return group(grp[num])
def merge(num1, num2):
grp[num2] = grp[num1]
res = []
ans = [1] * n
ben = int(n * (n - 1) / 2)
edge.reverse()
for e in edge:
# print(e, ans, ben, grp)
res.append(ben)
g0 = group(e[0])
g1 = group(e[1])
if g0 != g1:
ben -= ans[g0] * ans[g1]
sum = ans[g0] + ans[g1]
merge(g0, g1)
ans[g0] = sum
ans[g1] = sum
res.reverse()
for r in res:
print(r)
# print(int(n*(n-1)/2))
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s797682957
|
Wrong Answer
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
s = str(input())
count0 = 0
count1 = 0
for i in range(len(list(s))):
if s[i] == "0":
count0 += 1
else:
count1 += 1
print(min(count1, count0) * 2)
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s945971438
|
Wrong Answer
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
print("")
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s631416821
|
Accepted
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
import sys
sys.setrecursionlimit(10**8)
def ii():
return int(sys.stdin.readline())
def mi():
return map(int, sys.stdin.readline().split())
def li():
return list(map(int, sys.stdin.readline().split()))
def li2(N):
return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j):
return [[ini] * i for _ in range(j)]
def dp3(ini, i, j, k):
return [[[ini] * i for _ in range(j)] for _ in range(k)]
# import bisect #bisect.bisect_left(B, a)
# from collections import defaultdict #d = defaultdict(int) d[key] += value
# from itertools import accumulate #list(accumulate(A))
A, B, C = mi()
if A * C < B:
print(C)
else:
print(B // A)
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s895800520
|
Accepted
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on 2019/3/3
Solved on 2019/3/3
@author: shinjisu
"""
# ABC 120
# import math
def getInt():
return int(input())
def getIntList():
return [int(x) for x in input().split()]
def zeros(n):
return [0] * n
def getIntLines(n):
return [int(input()) for i in range(n)]
def getIntMat(n):
mat = []
for i in range(n):
mat.append(getIntList())
return mat
def zeros2(n, m):
return [zeros(m)] * n
ALPHABET = [chr(i + ord("a")) for i in range(26)]
DIGIT = [chr(i + ord("0")) for i in range(10)]
N1097 = 10**9 + 7
INF = 10**12
def dmp(x, cmt=""):
global debug
if debug:
if cmt != "":
print(cmt, ": ", end="")
print(x)
return x
def prob_A():
A, B, C = getIntList()
dmp((A, B, C))
count = min(B // A, C)
return count
debug = False # True False
ans = prob_A()
print(ans)
# for row in ans:
# print(row)
def prob_B():
N = getInt()
A = getIntList()
dmp((N, A))
return 123
def prob_C():
N = getInt()
A = getIntList()
dmp((N, A))
return 123
def prob_D():
N = getInt()
A = getIntList()
dmp((N, A))
return 123
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s006886160
|
Accepted
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
value, all_money, max_num = [int(i) for i in input().split()]
"""
value を最大max_numまでかける
・途中でall_moneyを上回ったら終了
・全てかけてもmax_numかけても上回らなかった時はmax_numで終了
"""
num = 0
money = 0
for i in range(1, max_num + 1):
money = value * i
num = i
if money > all_money:
num = num - 1
break
print(num)
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s758776226
|
Runtime Error
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
n, m = map(int, input().split())
isl1 = [0] * m
isl2 = [0] * m
for i in range(m):
(isl1[i], isl2[i]) = map(int, input().split())
isl1[i] -= 1
isl2[i] -= 1
boss = [-1] * n
mem = [1] * n
dpt = [0] * n
ans = [0] * m
s = (n * (n - 1)) // 2
ans[m - 1] = s
def sea(i, boss):
m = 0
while boss[i] >= 0:
i = boss[i]
m += 1
return i, m
for j in range(m - 1):
i = m - j - 1
i1, i2 = isl1[i], isl2[i]
p1, m1 = sea(i1, boss)
p2, m2 = sea(i2, boss)
if p1 != p2:
if dpt[m1] < dpt[m2]:
(p1, p2) = (p2, p1)
boss[p2] = p1
s -= mem[p1] * mem[p2]
mem[p1] += mem[p2]
mem[p2] = 0
dpt[p1] = max(dpt[p1], dpt[p2] + 1)
ans[i - 1] = s
for i in range(m):
print(ans[i])
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s015285098
|
Runtime Error
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
class UnionFind:
def __init__(self, n):
self.__parent = [i for i in range(n)]
self.size = [1 for _ in range(n)]
def union(self, x, y):
pX, pY = self.find(x), self.find(y)
if pX != pY:
if pX < pY:
self.__parent[pY] = pX
self.size[pX] += self.size[pY]
else:
self.__parent[pX] = pY
self.size[pY] += self.size[pX]
def find(self, x):
if self.__parent[x] != x:
self.__parent[x] = self.find(self.__parent[x])
return self.__parent[x]
N, M = map(int, input().split())
bridge = [tuple(map(lambda x: int(x) - 1, input().split())) for _ in range(M)]
uf = UnionFind(N)
num_disconnect = int(N * (N - 1) / 2)
ans = []
for a, b in reversed(bridge):
ans.append(num_disconnect)
pA, pB = uf.find(a), uf.find(b)
if pA != pB:
num_disconnect -= uf.size[pA] * uf.size[pB]
uf.union(a, b)
for i in reversed(ans):
print(i)
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s582609490
|
Wrong Answer
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
# -*- coding: utf-8 -*-
# 入力された文字列
string = input()
# 最大処理数。100000以下なら文字列長。
max = min(len(string), 100000)
# 削除した文字数
del_count = 0
# 削除があった場合True
del_flg = True
# 削除文字がなくなるまでループする
while del_flg:
del_flg = False
#
for idx in range(max):
if idx == max or idx > max:
break
# 照合対象の文字を切り出す
target = string[idx : idx + 2]
if target == "01" or target == "10":
# 削除文字に一致した場合、元の文字列からそれを削除しカウントを進め、
# 削除フラグを立てる
string = string[:idx] + string[idx + 2 :]
del_count += 2
max -= 2
del_flg = True
print(del_count)
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s070278271
|
Runtime Error
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
N, M = [int(elm) for elm in input().split(" ")]
bridges = [[int(elm) for elm in input().split(" ")] for _ in range(M)]
class Graph:
pass
graph = {}
for node in range(1, N + 1):
graph[node] = [node]
# graph_mem[node] = []
graph_n_mem = [0] + [1 for i in range(N)]
n_all_pairs = N * (N - 1) // 2
# def delete_graph(B):
# pass
def calc_out(n_list):
out = n_all_pairs
for elm in n_list:
if elm <= 1:
continue
tmp = elm * (elm - 1) // 2
out -= tmp
return out
outs = []
for A, B in reversed(bridges):
# print(graph_n_mem)
# print("before AB", A, B)
A = graph[A][0]
B = graph[B][0]
# print(graph_n_mem, "AB", A, B)
if graph[A] != graph[B]:
# graph_n_mem[A] += len(graph[B])
graph_n_mem[A] += graph_n_mem[B]
graph_n_mem[B] = 0
graph[A] += graph[B]
for node in graph[A]:
graph[node] = graph[A]
# graph_mem[A] += graph_mem[B]
out = calc_out(graph_n_mem)
outs.append(out)
outs = outs[::-1]
outs = outs[1:] + [n_all_pairs]
for out in outs:
print(out)
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s541323311
|
Runtime Error
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
N, M = [int(e) for e in input().split(" ")]
d_node2setindex = {}
ABs = []
for _ in range(M):
ABs.append([int(e) for e in input().split(" ")])
maxValue = N * (N - 1) // 2
ans = [maxValue]
buf_sets = []
flagSkip = False
for i in range(M - 1):
a, b = ABs[M - 1 - i]
# print("a,b", a, b)
if flagSkip is True:
ans.append(0)
continue
idx_a = d_node2setindex.get(a, None)
idx_b = d_node2setindex.get(b, None)
# if len(buf_sets) > 0:
# for j, s in enumerate(buf_sets):
# if idx_a is None:
# if a in s:
# idx_a = j
# if idx_b is None:
# if b in s:
# idx_b = j
# if idx_a is not None and idx_b is not None:
# break
delta = 0
if idx_a is None and idx_b is None:
s_new = set([a, b])
idx_set = len(buf_sets)
d_node2setindex[a] = idx_set
d_node2setindex[b] = idx_set
buf_sets.append(s_new)
delta = 1
elif idx_a is not None and idx_b is None:
delta = len(buf_sets[idx_a])
buf_sets[idx_a].add(b)
d_node2setindex[b] = idx_a
elif idx_a is None and idx_b is not None:
delta = len(buf_sets[idx_b])
buf_sets[idx_b].add(a)
d_node2setindex[a] = idx_b
else:
if idx_a != idx_b:
s_a = buf_sets[idx_a]
s_b = buf_sets[idx_b]
delta = len(s_a) * len(s_b)
[d_node2setindex.__setitem__(e, idx_a) for e in s_b]
# for e in s_b:
# d_node2setindex[e] = idx_a
buf_sets[idx_a] = s_a | s_b
buf_sets[idx_b] = None
# buf_sets.pop(idx_b)
d = ans[-1] - delta
ans.append(d)
if d == 0:
flagSkip = True
txt = "\n".join(map(str, reversed(ans)))
print(txt)
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s481020403
|
Runtime Error
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
class Union_find(object):
def __init__(self, N):
# 親の番号を格納する。親だった場合は-(その集合のサイズ)
self.parent = [-1] * (N)
# Aがどのグループに属するか
def root(self, A):
if self.parent[A] < 0:
return A
else:
# 親を繋ぎ変えて高速化
self.parent[A] = self.root(self.parent[A])
return self.parent[A]
def size(self, A):
return -self.parent[self.root(A)]
# A,Bをくっつける
def connect(self, A, B):
# A,Bを直接つなぐのでなく、root(A),root(B)をつなぐ
A = self.root(A)
B = self.root(B)
if A == B:
return False
# 大きい方に小さい方をくっつける
if self.size(A) < self.size(B):
A, B = B, A
self.parent[A] += self.parent[B]
self.parent[B] = A
return True
N, M = list(map(int, input().split()))
A = []
B = []
for _ in range(M):
a, b = list(map(int, input().split()))
A.append(a - 1)
B.append(b - 1)
uni = Union_find(N)
result = []
unconv = int(N * (N - 1) / 2)
for a, b in zip(reversed(A), reversed(B)):
result.append(unconv)
size_a = uni.size(a)
size_b = uni.size(b)
if uni.connect(a, b):
unconv -= size_a * size_b
for r in reversed(result):
print(r)
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s825181790
|
Runtime Error
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
n, m = map(int, input().split())
bridge = [[] for i in range(m)]
iland = [[i + 1] for i in range(n)]
for i in range(m):
bridge[i] = list(map(int, input().split()))
ans = [0 for i in range(m + 1)]
ans[0] = int((n - 1) * n / 2)
k = 1
for i in reversed(bridge):
ans[k] = ans[k - 1]
for j in range(len(iland)):
if i[0] in iland[j]:
temp = j
break
for j in range(len(iland)):
if i[1] in iland[j]:
if temp != j:
ans[k] = ans[k - 1] - len(iland[j]) * len(iland[temp])
iland[temp].extend(iland[j])
del iland[j]
break
if ans[k] == 0:
ans[k:] = [0 for l in range(m - k)]
break
k += 1
for i in range(m):
print(ans[m - 1 - i])
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s534482773
|
Accepted
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
A, B, C = input().split()
result = min(int(int(B) / int(A)), int(C))
print(result)
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s708244336
|
Wrong Answer
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
a, b, c = [int(s) for s in input().split()]
print(max((b // a, c)))
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s391986307
|
Wrong Answer
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
a = str(input())
x = a.count("0")
y = a.count("1")
print(2 * min(int(x), int(y)))
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s633374495
|
Wrong Answer
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
#!/usr/bin/env python3
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s698916518
|
Accepted
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
A, B, C = map(
int, input().split()
) # 入力された値を空白で区切ってその値をint型に変換して代入している
print(min(int(B / A), C)) # intで囲うことで少数を切り捨てている
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s787733818
|
Runtime Error
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
x = list(map(int, input().split()))
CD = []
for i in range(1, min(x[0], x[1]) + 1):
if x[0] % i == 0 and x[1] % i == 0:
CD.append(i)
print(CD[1])
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print the number of times Takahashi will hear his favorite sound.
* * *
|
s567229094
|
Wrong Answer
|
p03105
|
Input is given from Standard Input in the following format:
A B C
|
a, b, k = map(int, input().split())
j = 0
for i in range(100, 0):
A = a % i
B = b % i
if A == 0:
if B == 0:
j += 1
print(i)
if j == k:
print(i)
break
|
Statement
Takahashi likes the sound when he buys a drink from a vending machine.
That sound can be heard by spending A yen (the currency of Japan) each time.
Takahashi has B yen. He will hear the sound as many times as he can with that
money, but at most C times, as he would be satisfied at that time.
How many times will he hear the sound?
|
[{"input": "2 11 4", "output": "4\n \n\nSince he has not less than 8 yen, he will hear the sound four times and be\nsatisfied.\n\n* * *"}, {"input": "3 9 5", "output": "3\n \n\nHe may not be able to be satisfied.\n\n* * *"}, {"input": "100 1 10", "output": "0"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s826534806
|
Accepted
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
C1, C2 = [input() for i in range(2)]
print("YES" if C1 == C2[::-1] else "NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s325073170
|
Accepted
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
print("YES" if input()[::-1] == input() else "NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s592877067
|
Accepted
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
a, b = list(input()), list(input())
a.reverse()
print("YES" if a == b else "NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s786586809
|
Wrong Answer
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
print("Yes" if input() == input()[::-1] else "No")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s385742620
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
c = [input() for i in range(2)]
print("YES" if c[0] == c[1][::-1]) else "NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s566612319
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
c1 = input()
c2 = input()
print("YES" if c1=c2[::-1] else "NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s700222948
|
Wrong Answer
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
print("YES" if input() == reversed(input()) else "NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s116056141
|
Accepted
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
import functools
import os
INF = float("inf")
def inp():
return int(input())
def inpf():
return float(input())
def inps():
return input()
def inl():
return list(map(int, input().split()))
def inlf():
return list(map(float, input().split()))
def inls():
return input().split()
def inpm(line):
return [inp() for _ in range(line)]
def inpfm(line):
return [inpf() for _ in range(line)]
def inpsm(line):
return [inps() for _ in range(line)]
def inlm(line):
return [inl() for _ in range(line)]
def inlfm(line):
return [inlf() for _ in range(line)]
def inlsm(line):
return [inls() for _ in range(line)]
def debug(fn):
if not os.getenv("LOCAL"):
return fn
@functools.wraps(fn)
def wrapper(*args, **kwargs):
print(
"DEBUG: {}({}) -> ".format(
fn.__name__,
", ".join(
list(map(str, args))
+ ["{}={}".format(k, str(v)) for k, v in kwargs.items()]
),
),
end="",
)
ret = fn(*args, **kwargs)
print(ret)
return ret
return wrapper
s1 = input()
s2 = input()
if s1[::-1] == s2:
print("YES")
else:
print("NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s732618095
|
Accepted
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import (
accumulate,
groupby,
product,
permutations,
combinations,
combinations_with_replacement,
)
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float("inf")
MOD = 10**9 + 7
PI = math.pi
# endregion
c = [rs() for _ in range(2)]
c2 = [i[::-1] for i in c[::-1]]
print("YES" if c == c2 else "NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s607200338
|
Wrong Answer
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
import sys, collections as cl, bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9 + 7
Max = sys.maxsize
def l(): # intのlist
return list(map(int, input().split()))
def m(): # 複数文字
return map(int, input().split())
def onem(): # Nとかの取得
return int(input())
def s(x): # 圧縮
a = []
if len(x) == 0:
return []
aa = x[0]
su = 1
for i in range(len(x) - 1):
if aa != x[i + 1]:
a.append([aa, su])
aa = x[i + 1]
su = 1
else:
su += 1
a.append([aa, su])
return a
def jo(x): # listをスペースごとに分ける
return " ".join(map(str, x))
def max2(x): # 他のときもどうように作成可能
return max(map(max, x))
def In(x, a): # aがリスト(sorted)
k = bs.bisect_left(a, x)
if k != len(a) and a[k] == x:
return True
else:
return False
def pow_k(x, n):
ans = 1
while n:
if n % 2:
ans *= x
x *= x
n >>= 1
return ans
"""
def nibu(x,n,r):
ll = 0
rr = r
while True:
mid = (ll+rr)//2
if rr == mid:
return ll
if (ここに評価入れる):
rr = mid
else:
ll = mid+1
"""
s = [list(input())[:-1] for i in range(2)]
for i in range(3):
if s[0][i] != s[1][2 - i]:
print("NO")
else:
print("YES")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s252094147
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
def bisect_left(array, i, left, right):
n = right - left + 1
mid = (left + right) // 2
if n == 1:
if array[mid] < i:
return 1
else:
return 0
if i <= array[mid]:
return bisect_left(array, i, left, mid)
else:
return (mid - left + 1) + bisect_left(array, i, mid + 1, right)
def bisect_right(array, i, left, right):
n = right - left + 1
mid = (right + left) // 2
if n == 1:
if i < array[mid]:
return 0
else:
return 1
if array[mid] <= i:
return (mid - left + 1) + bisect_right(array, i, mid + 1, right)
else:
return bisect_right(array, i, left, mid)
N = int(input())
L = []
for _ in range(3):
l = list(map(int, input().split()))
L.append(sorted(l))
ans = 0
for x in L[1]:
n = bisect_left(L[0], x, 0, N - 1)
m = bisect_right(L[2], x, 0, N - 1)
m = N - m
ans += n * m
print(ans)
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s845628350
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
def main():
num = int(input())
data_a = list(map(int, input().split()))
data_a.sort()
data_b = list(map(int, input().split()))
data_b.sort()
data_c = list(map(int, input().split()))
data_c.sort()
shita_b = [0 for i in range(num)]
ind = 0
for i in range(num):
now_b = data_b[i]
while data_c[ind] <= now_b:
ind += 1
if ind >= num:
ind = num
break
if ind == num:
break
shita_b[i] = num - ind
ans = 0
tasu_now = sum(shita_b)
ind = 0
for i in range(num):
now_a = data_a[i]
while now_a >= data_b[ind]:
tasu_now -= shita_b[ind]
ind += 1
if ind >= num:
ind = num
break
if ind == num:
break
ans += tasu_now
print(ans)
if __name__ == "__main__":
main()
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s600258728
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
# -*- coding: utf-8 -*-
#############
# Libraries #
#############
import sys
input = sys.stdin.readline
import math
from collections import deque
from fractions import gcd
from functools import lru_cache
#############
# Constants #
#############
MOD = 10**9 + 7
INF = float("inf")
#############
# Functions #
#############
######INPUT######
def inputI():
return int(input().strip())
def inputS():
return input().strip()
def inputIL():
return list(map(int, input().split()))
def inputSL():
return list(map(str, input().split()))
def inputILs(n):
return list(int(input()) for _ in range(n))
def inputSLs(n):
return list(input().strip() for _ in range(n))
def inputILL(n):
return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n):
return [list(map(str, input().split())) for _ in range(n)]
#####Inverse#####
def inv(n):
return pow(n, MOD - 2, MOD)
######Combination######
kaijo_memo = []
def kaijo(n):
if len(kaijo_memo) > n:
return kaijo_memo[n]
if len(kaijo_memo) == 0:
kaijo_memo.append(1)
while len(kaijo_memo) <= n:
kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
return kaijo_memo[n]
gyaku_kaijo_memo = []
def gyaku_kaijo(n):
if len(gyaku_kaijo_memo) > n:
return gyaku_kaijo_memo[n]
if len(gyaku_kaijo_memo) == 0:
gyaku_kaijo_memo.append(1)
while len(gyaku_kaijo_memo) <= n:
gyaku_kaijo_memo.append(
gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo), MOD - 2, MOD) % MOD
)
return gyaku_kaijo_memo[n]
def nCr(n, r):
if n == r:
return 1
if n < r or r < 0:
return 0
ret = 1
ret = ret * kaijo(n) % MOD
ret = ret * gyaku_kaijo(r) % MOD
ret = ret * gyaku_kaijo(n - r) % MOD
return ret
######Factorization######
def factorization(n):
arr = []
temp = n
for i in range(2, int(-(-(n**0.5) // 1)) + 1):
if temp % i == 0:
cnt = 0
while temp % i == 0:
cnt += 1
temp //= i
arr.append([i, cnt])
if temp != 1:
arr.append([temp, 1])
if arr == []:
arr.append([n, 1])
return arr
#####LCM#####
def lcm(a, b):
return a * b // gcd(a, b)
#############
# Main Code #
#############
l = inputLs(2)
if l[0][2] == l[1][0] and l[0][1] == l[1][1] and l[0][0] == l[1][2]:
print("YES")
else:
print("NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s304743827
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<map>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
char c[2][3];
rep(i,2) rep(j,3) cin>>c[i][j];
bool ans=true;
if(c[0][0]!=c[1][2]||c[0][1]!=c[1][1]||c[0][2]!=c[1][0]){
ans=false;
}
if(ans) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s682971973
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
s1=input()
s2=input()
if s1[0] == s2[2] and s1[1]==s2[1] ans s1[2]==s[1]:
print("Yes")
else:
print("No")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s293045658
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
a = str(input())
b = str(input())
rev_a = a[::-1]
if rev_a == b:
print('YES)
else:
print('NO')
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s031955192
|
Accepted
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
n, m = list(input()), list(input())
print("YES" if list(reversed(n)) == m else "NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s579685051
|
Accepted
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
C1, C2 = list(input()), list(input())
C2.reverse()
print("YES" if C1 == C2 else "NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s824370560
|
Accepted
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
c = list(input())
d = list(input())
c[0], c[2] = c[2], c[0]
print("YES" if c == d else "NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s403090867
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
a=input()
b=input()
if(a[0]==b[2] and a[1]==b[1] and a[2]=b[0]):
print("YES")
else:
print("NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s639025665
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
C1, C2 = input().split()
C1_reverse = C1[2] + C1[1] + C[0]
print("YES" if C1_reverse == C2 else "NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s958938817
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
a = list(input())
b = list(input())
if b = a.reverse():
print("YES")
else:
print("NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s476825342
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
A=input()
B=input()
if(A[0]==B[2]&&A[1]==B[1]&&A[2]=B[0]):
print("YES")
else:
print("NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s487781306
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
s,t=input()
if s[0]==t[2] and s[1]==t[1] and s[2]=t[0]:
print("YES")
else:
print("NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s849645830
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
a = input()
b = input()
print(["NO", "YES"][a[0]=b[2] and a[1]=b[1] and a[2]=b[0]])
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s578257658
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
a = input()
b = input()
if a[1] = b[3] and a[2] = b[2] and a[3] = c[1]:
print('YES')
else:
print('NO')
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s303978586
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
c1 = input()
c2 = input()
res = "YES" if c1[0] == c2[0] and c1[2] == c2[2] "NO"
print(res)
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s999226304
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
li_a = list(input())
li_b = list(input())
li_a.reverse()
if li_a == li_b:
print(YES)
else:
print(NO)
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s560490567
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
a,b,c=input().split()
d,e,f=input().split()
if a==f and b==e and c==d:
print'Yes'
else:
print'No'
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s179820210
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
a,b,c=input().split()
d,e,f=input().split()
if a==f and b==e and c==d:
print'YES'
else:
print'NO'
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s625060031
|
Accepted
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
a = input().strip()
b = input().strip()
b = b[::-1]
print("YES" if a == b else "NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s968383060
|
Accepted
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
print("YNEOS"[input()[::-1] != input() :: 2])
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s866546032
|
Wrong Answer
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
a, b = input()[:-1], input()
print("YES" if reversed(list(a)) == list(b) else "NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s344961243
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
print("YES" if input() == reversed(input()) else "No)
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s697498239
|
Wrong Answer
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
print("YES" if input() == input()[::-1] else "N0")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s480472164
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
print(['NO','YES'][input()=input().reverse()])
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s563278519
|
Wrong Answer
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
a, b = open(0)
print("YNEOS"[a != b[::-1] :: 2])
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s759113427
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
R = int(input())
G = int(input())
print(2 * G - R)
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s831622298
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
print('YES' if input() == input()[::-1])
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s088591864
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
a=input()
b=input'()
print('YES' if a[-1::-1]==b else 'NO')
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s498382617
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
c1 = input()
c2 = input()
print("Yes" if c1 = c2[::-1] else "No")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s242669931
|
Wrong Answer
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
print("YES" if input() == reversed(input()) else "No")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s028792881
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
a = input()
b = input()
if a = b.reverse():
print("YES")
else:
print("NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s713899107
|
Wrong Answer
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
s, t = input(), input()
print("YES" if s == t[::-1] else "No")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s939414126
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
a=list(map(input(). split() ) )
if(a[0]==a[5]&&a[1] ==a[4] & & a[2] ==a[3] ):
print ("Yes" )
else:
print("No" )
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s986392694
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
a=list (map(input()) )
if(a[0]==a[5] &&a[1]==a[4]&&a[2]==a[3]):
print("Yes" )
else:
print("No")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s974721703
|
Wrong Answer
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
c = [input() for i in range(2)]
ans = "No"
if c[0][0] == c[1][2] and c[0][1] == c[1][1] and c[0][2] == c[1][0]:
ans = "Yes"
print(ans)
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s092375814
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
a= (input())
b=(input())
if(a[0]==b[2] &&a[1] ==b[1] && a[2] ==b[0] ):
print("Yes")
else:
print ("No" )
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s001476937
|
Accepted
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
C1 = list(map(str, input()))
C2 = list(map(str, input()))
CR1 = C1[:]
CR2 = C2[:]
C1.reverse()
C2.reverse()
print("YES" if C1 == CR2 and C2 == CR1 else "NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s870848600
|
Accepted
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
sList = [list(input()) for _ in range(2)]
print(
"YES"
if sList[0][2] == sList[1][0]
and sList[0][1] == sList[1][1]
and sList[0][0] == sList[1][2]
else "NO"
)
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s364393119
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
c = []
for i in range(2):
c.append(list(map(int, input().split()))
if c[0][0] == c[1][2] and c[0][1] == c[1][1] and c[0][2] == c[1][0]:
print("Yes")
else:
print("No")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s989832541
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
a=input().split()
a=list(a)
b=input().split()
b=list(b)
n=len(a)
N=1
for i in range(n):
if(a[i]!=b[-(i+1)]):
N=0
if(N==1):
print("YES")
else:
print("NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s965288107
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
fun main(args: Array<String>) {
var (a,b) = (0..1).map{readLine()!!}
if(a.reversed() == b) println("YES")
else println("NO")
}
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s785960015
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
N = int(input())
A = list(sorted(map(int, input().split())))
B = list(sorted(map(int, input().split()))
C = list(sorted(map(int, input().split())))
import bisect
upper_condition = [bisect.bisect_left(A, b) for b in B]
lower_condition = [N - bisect.bisect_right(C, b) for b in B]
print(sum(map(lambda x: x[0]*x[1], zip(upper_condition, lower_condition))))
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s657836313
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
# index が条件をみたかどうか
def isLess(index, key, a):
if a[index] >= key:
return True
else:
return False
def isUpper(index, key, a):
if a[index] > key:
return True
else:
return False
def binary_search(key, a, upper=True):
left = -1 # index = 0 が条件を満たすこともあるので初期値は−1
right= len(a) # index = len(a) -1 が条件満たさないこともある
# どんな二分探索でもここの書き方を変えずにできる
while right - left > 1 :
mid = left + ((right - left + 1) // 2)
if upper:
if isUpper(mid, key, a): # isOKの名前でこの関数内の条件判定変えれば色々できそう
right = mid
else:
left = mid
else:
if isLess(mid, key, a): # isOKの名前でこの関数内の条件判定変えれば色々できそう
right = mid
else:
left = mid
return right
import sys
def main():
n = int(input())
a_l = sorted(list(map(int, sys.stdin.readline().strip().split()))
b_l = sorted(list(map(int, sys.stdin.readline().strip().split()))
c_l = sorted(list(map(int, sys.stdin.readline().strip().split()))
cnt = 0
for b in b_l:
a_under_b_idx = binary_search(b, a_l, upper=False)
c_upper_b_idx = binary_search(b, c_l)
cnt += len(a_l[:a_under_b_idx])*len(c_l[c_upper_b_idx:])
print(cnt)
if __name__ == '__main__':
main()
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s478138326
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
""" small multiple """
K = int(input())
def get_sum_each_digits(number):
"""
get sum.
"""
chars = list(str(number))
int_map = map(int, chars)
result = sum(int_map)
# print("number:{0}, result:{1}".format(number, result))
return result
def main():
"""
main function.
"""
min = K
multiple = 0
while multiple < 100000:
multiple += 1
temp = get_sum_each_digits(K * multiple)
if temp < min:
min = temp
if min == 1:
break
# print("ans ---")
print(min)
main()
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s687168674
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
a=input()
b=input()
ans=0
if(a[0]==b[2]):
if(a[1]==b[1]):
if(a[2]==b[0]):
print("YES")
ans=1
if(ans=0):
print("NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s438968318
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
c_1 =map(str,input().split())
c_2 =map(str,input().split())
if c_1[0]==c_2[2]
and c_1[1]==c_2[1]
and c_1[2]==c_2[0]:
print("YES")
else:
print("NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s493046948
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
N = int(input())
A = input()
B = input()
C = input()
A = sorted(list(map(int, A.strip("¥n").split(" "))))
B = sorted(list(map(int, B.strip("¥n").split(" "))))
C = sorted(list(map(int, C.strip("¥n").split(" "))))
l_a = len(A)
l_b = len(B)
l_c = len(C)
p_a = 0
p_b = 0
p_c = 0
ss = 0
for b in B:
for i in range(p_a, l_a):
if A[i] >= b:
break
p_a = i
for i in range(p_c, l_c):
p_c = i
if C[i] > b:
break
s = (p_a + 1) * (l_c - p_c)
ss += s
print(ss)
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s870512246
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
li = list(input())
if li[0]==li[5] && li[1]==li[4] && li[2]==li[3]:
print("YES")
else:
print("NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s300668982
|
Accepted
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
c = [input() for _ in range(2)]
print("YES" if c[0] == c[1][::-1] else "NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s896828764
|
Accepted
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
print("YES" if input() == "".join([s for s in input()[::-1]]) else "NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s124318049
|
Accepted
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
print("YNEOS"[list(input()) != list(reversed(list(input()))) :: 2])
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s098371104
|
Accepted
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
print("YES" if list(input()) == list(input())[::-1] else "NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s781676039
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
print([NO, YES][input().strip()[::-1] == input().strip()])
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s816600367
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
a = input().split()
print("YES" if list(a[0]) == list(reversed(a[1])) else "NO")
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Print `YES` if this grid remains the same when rotated 180 degrees; print `NO`
otherwise.
* * *
|
s799747541
|
Runtime Error
|
p03555
|
Input is given from Standard Input in the following format:
C_{11}C_{12}C_{13}
C_{21}C_{22}C_{23}
|
"""
snuke festival
"""
def input_list():
"""
returns list from stdin
"""
input_map = map(int, input().split())
return list(input_map)
def get_bigger_index(base_num, sub_list):
"""
returns first index that is bigger than base number
"""
bigger_index = -1
for index, item in enumerate(sub_list):
if base_num < item:
bigger_index = index
break
return bigger_index
def main():
"""
main function.
"""
base_len = int(input())
top = input_list()
mid = input_list()
btm = input_list()
top.sort()
mid.sort()
btm.sort()
result = 0
for i in range(base_len):
mid_index = get_bigger_index(top[i], mid)
if mid_index < 0:
break
else:
btm_index = get_bigger_index(mid[mid_index], btm)
if btm_index >= 0:
result += (base_len - mid_index) * (base_len + btm_index)
print(result)
main()
|
Statement
You are given a grid with 2 rows and 3 columns of squares. The color of the
square at the i-th row and j-th column is represented by the character C_{ij}.
Write a program that prints `YES` if this grid remains the same when rotated
180 degrees, and prints `NO` otherwise.
|
[{"input": "pot\n top", "output": "YES\n \n\nThis grid remains the same when rotated 180 degrees.\n\n* * *"}, {"input": "tab\n bet", "output": "NO\n \n\nThis grid does not remain the same when rotated 180 degrees.\n\n* * *"}, {"input": "eye\n eel", "output": "NO"}]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.