problem_id stringclasses 428
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 5 816 |
|---|---|---|---|
p02959 | s503195293 | Wrong Answer | N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
def solve(N,A,B):
ans = 0
for i in range(N):
battle = min(A[i],B[i])
B[i] -= battle
ans += battle
nex = min(A[i+1],B[i])
A[i] -= nex
ans += nex
return ans
print(solve(N,A... |
p03472 | s084732114 | Wrong Answer | N, H = map(int, input().split())
l = []
A = []
B = []
for i in range(N):
a, b = map(int, input().split())
A.append(a)
B.append(b)
B.sort(reverse=True)
if sum(B) >= H:
ans = 0
for i in range(N):
H -= B[i]
ans += 1
if H <= 0:
break
else:
ans = 0
n = max(A)
for i in range(N):
if B[i]... |
p02829 | s461104149 | Wrong Answer | ans = set([1, 2, 3])
a = set(map(int,input().split()))
b = ans - a
b = list(b)
print(b[0])
|
p03951 | s885877204 | Wrong Answer | n = int(input())
s = input()
t = input()
tmp = -1
for i in range(n):
print(s[-i - 1:], t[:i + 1])
if s[-i - 1:] == t[:i + 1]:
tmp = i
print(n + n - (tmp + 1))
|
p02602 | s308691856 | Wrong Answer | terms, graded_terms = input().split(" ")
grade_list = [i for i in input().split(" ")]
x1 = 0
x2 = int(graded_terms)
for i in range(int(terms)-int(graded_terms)):
if grade_list[int(x2)] > grade_list[int(x1)]:
print("Yes")
else:
print("No")
x1 += 1
x2 += 1
|
p03427 | s650063369 | Wrong Answer | n=input()
l=len(n)
if len(n)==1:
print(n)
exit()
if int(n)!=int(str(9)*l):
print(9*(l-1)+int(n[0])-1)
elif int(n)==int(str(9)*l):
print(9*l) |
p02802 | s217062395 | Accepted | n, m = map(int, input().split())
query = [tuple(input().split()) for _ in range(m)]
wa = [0] * n
ac = [0] * n
for p, result in query:
p = int(p) - 1
if result == 'AC':
ac[p] = 1
if result == 'WA' and ac[p] == 0:
wa[p] += 1
accept = 0
penalty = 0
for i in range(n):
if ac[i]:
p... |
p03331 | s722487516 | Wrong Answer | def sumDigits(i):
s = 0
while i > 0:
s += (i % 10)
i = int(i / 10)
return s
N = int(input())
m = 9 * 6
for i in range(2, N + 1):
k = N - i
if k > 1:
m = min(m, sumDigits(i) + sumDigits(k))
print(m) |
p03469 | s183062563 | Accepted | S = input()
answer = S[0:3] + "8" + S[4:10]
print(answer) |
p03210 | s761097685 | Accepted | x = int(input())
if (x == 3 or x == 5 or x == 7):
print('YES')
else:
print('NO')
|
p02933 | s974494143 | Wrong Answer | a =int(input())
if a <= 3200:
print('s')
else:
print('red') |
p03000 | s721344239 | Accepted | n, x = map(int, input().split())
l = list(map(int, input().split()))
ans = 1
d = 0
for i in range(n):
d += l[i]
if d <= x:
ans += 1
print(ans) |
p03293 | s874156208 | Wrong Answer | a=input()
b=input()
#print(''.join(sorted(a)),(sorted(a)))
if ''.join(sorted(a))==''.join(sorted(b)):
print('Yes')
else:
print('No') |
p02624 | s837836889 | Wrong Answer | import numpy as np
N = int(input())
cnt = np.ones(N+1, dtype=np.int)
for n in range(2, N//2+1):
cnt[::n] += 1
cnt[N//2+1:] += 1
print(sum(np.arange(1, N+1) * cnt[1:])) |
p03487 | s340916128 | Wrong Answer | """
int(input())
map(int, input().split())
list(map(int, input().split()))
input()
input().split()
"""
n = int(input())
a = list(map(int, input().split()))
ans = 0
if (a.count(1)-1 > 0): ans += a.count(1)-1
for i in range(2,n+1):
tmp = a.count(i)%i
ans += tmp
print(ans)
|
p02633 | s974340014 | Wrong Answer | from math import gcd
def lcm(a, b):
return (a * b) // gcd(a, b)
n = int(input())
if n > 90:
n = 180 - n
x = lcm(n, 360)
print(x // n)
|
p03345 | s654200193 | Wrong Answer | A, B, C, K = map(int, input().split())
if K==0:
if abs(A-B)<10**18:
print(A-B)
else:
print("Unfair")
else:
if abs(B-A)<10**18:
print(B-A)
else:
print("Unfair") |
p02993 | s417247854 | Accepted | S=str(input())
if S[0]==S[1] or S[1]==S[2] or S[2]==S[3]:
print("Bad")
else:
print("Good") |
p02624 | s826322181 | Wrong Answer | x = int(input())
data = [0]
for i in range(1, x + 1):
data.append(1)
print(data)
for i in range(2,x + 1):
for d in range(1, x + 1):
if d % i == 0:
data[d] = data[d] + 1
print(data)
ban = 0
ans = 0
for i in data:
ans = ans + ban * i
ban += 1
print(ans) |
p03711 | s925486136 | Wrong Answer | x, y = list(map(int,input().split()))
if x in [1,3,5,7,8,10,12] and x in [1,3,5,7,8,10,12] or x in [4,6,9,11] and y in [4,6,9,11] or x == 2 and y == 2:
print('Yes')
else:
print('No') |
p02646 | s210581054 | Accepted | a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
judge=bool(abs(a-b)<=(v-w)*t)
if judge:
print("YES")
else:
print("NO") |
p02658 | s615795499 | Wrong Answer | from decimal import *
getcontext().prec = 100
import numpy as np
n = int(input())
a_list = list(map(int,input().split()))
import math
result = 0
check = True
for a in a_list:
if a == 0:
check = False
break
else:
result += Decimal(math.log10(a))
if check == False:
print(0)
elif result > 18:
print(-1)... |
p02995 | s829873192 | Wrong Answer | import sys
import math
from fractions import gcd
def lcm(a, b):
return (a * b) // gcd(a, b)
a,b,c,d = [int(x) for x in sys.stdin.readline().rstrip().split(" ")]
e = b - a + 1
f = int(b / c) - int((a - 1) / c)
g = int(b / d) - int((a - 1) / d)
cd = lcm(c, d)
h = int(b / cd) - int((a - 1) / cd)
n = e - f - g + h
pr... |
p02786 | s823102161 | Wrong Answer | # cook your dish here
from math import log2
n=int(input())
k=round(log2(n))
if int(k)==k:
print(pow(2,k+1)-1)
else:
print(pow(2,k)-1) |
p03486 | s747333838 | Accepted | s = list(input())
t = list(input())
s.sort()
t.sort(reverse=True)
s = "".join(s)
t = "".join(t)
if t > s:
print("Yes")
else:
print("No") |
p03427 | s221719758 | Wrong Answer | N = input()
if len(N) == 1:
print(N)
exit()
ans = (len(N) - 1) * 9
if N[0] != '9':
ans += int(N[0]) - 1
else:
for i in range(1, len(N)):
if N[i] != '9':
ans += int(N[i - 1]) - 1
break
else:
ans += 9
print(ans)
|
p02693 | s823560546 | Accepted | k=int(input())
a,b=map(int,input().split())
if ((b-a)>=k):
print('OK')
elif (a%k==0) or (b%k==0):
print('OK')
elif(a<(a//k)*k+k<b):
print('OK')
else:
print('NG') |
p03494 | s137445781 | Accepted | n = int(input())
r = list(map(int, input().split()))
num = 0
flag = 0
while True:
for k in range(n):
if not r[k] % 2:
r[k] /= 2
else:
flag = 1
if flag:
break
num += 1
print(num) |
p02693 | s364095609 | Wrong Answer | k = int(input())
a, b = map(int, input().split())
if k - 1 <= b - a:
print("OK")
else:
for i in range(a, b + 1):
if i % k == 0:
print("OK")
break
else:
print("NO") |
p03555 | s943152640 | Accepted | print("YNEOS"[input()!=input()[::-1]::2]) |
p02793 | s729298384 | Accepted | from fractions import gcd
def lcm(a,b):
return a*b//gcd(a,b)
n=int(input())
a=list(map(int,input().split()))
ans=0
mod=10**9+7
l=a[0]
for i in range(1,n):
l=lcm(l,a[i])
l%=mod
for aa in a:
# mod(10**9+7)逆元
ans+=l*pow(aa,mod-2,mod)%mod
ans%=mod
print(ans) |
p04043 | s929775311 | Wrong Answer | A, B, C=map(str,input().split())
x = [int(A), int(B), int(C)]
if (x.count(5) == 2) and (x.count(7) == 1):
print("Yes")
else:
print("No") |
p02578 | s783400528 | Wrong Answer | number = int(input())
values = [int(i) for i in input().split()]
max = max(values)
min = min(values)
def answer(values, max, min):
sum = 0
if max == min:
return 0
if max < min:
return min
average = max / 2
for index in range(len(values)):
if max > values[index] > average:
sum += int(max)... |
p03105 | s526828813 | Accepted | A, B, C = map(int, input().split())
print(min(B//A, C))
|
p02888 | s052089539 | Accepted | n=int(input())
l=list(map(int,input().split()))
ans=0
import bisect
l.sort()
for i in range(n-2):
for j in range(i+1,n-1):
tmp= bisect.bisect_left(l,l[i]+l[j])
ans+=tmp-j-1
print(ans)
|
p04012 | s969611231 | Accepted | from collections import Counter
w = input()
w_count = Counter(w)
if all(v%2==0 for v in w_count.values()):print('Yes')
else:print('No')
|
p03720 | s283291635 | Accepted | N,M=map(int,input().split())
d=[list(map(int,input().split())) for i in range(M)]
s=[]
for i in range(M):
s+=d[i]
for k in range(1,N+1):
print(s.count(k)) |
p02963 | s064596117 | Accepted | s = int(input())
a = 10**9
if s == 10**18:
print(0, 0, a, 0, 0, a)
else:
x3 = a-(s%a)
y3 = (s+x3)//a
print(0, 0, a, 1, x3, y3) |
p03241 | s447600322 | Accepted | N, M = map(int, input().split())
div = [(1, M), (M, 1)]
for i in range(2, int(M ** 0.5) + 1):
if M % i == 0:
div.append((i, M // i))
if i * i != M:
div.append((M // i, i))
ans = 1
for num, cnt in div:
if cnt >= N:
ans = max(ans, num)
print(ans)
|
p03011 | s582967532 | Accepted | time = list(map(int,input().split()))
time.sort()
print(sum(time[0:2])) |
p02577 | s509525536 | Accepted | N=int(input())
if N%9==0:
print("Yes")
else:
print("No") |
p02682 | s579573569 | Wrong Answer | import numpy as np
n=input().split()
A=int(n[0])
B=int(n[1])
C=int(n[2])
D=int(n[3])
a = np.array([1,0,-1])
b = np.array([A,D-A,D-A-B])
c = np.array([0,B,D-B])
if A>=1:
print(sum(a*b))
if A==0 and B==0:
print("-1")
if A==0 and B>=1:
print(sum(a*c))
|
p03011 | s900409824 | Accepted | p,q,r=map(int,input().split())
print(min(p+q,p+r,q+r)) |
p03836 | s129717997 | Accepted | sx,sy,tx,ty=map(int,input().split())
for _ in range(ty-sy): print("U",end="")
for _ in range(tx-sx): print("R",end="")
for _ in range(ty-sy): print("D",end="")
for _ in range(tx-sx+1): print("L",end="")
for _ in range(ty-sy+1): print("U",end="")
for _ in range(tx-sx+1): print("R",end="")
print("DR",end="")
for _ in ran... |
p03252 | s403872645 | Accepted | s = input()
t = input()
n = len(s)
x = []
y = []
for i in range(n):
if s[i] not in x:
x.append(s[i])
if t[i] not in y:
y.append(t[i])
for i in range(len(x)):
s = s.replace(x[i], str(i))
for i in range(len(y)):
t = t.replace(y[i], str(i))
print('Yes' if s == t else 'No') |
p03293 | s420728550 | Accepted | S=input()
T=input()
S=S+S
if T in S:
print("Yes")
else:
print("No") |
p02660 | s558641583 | Accepted | n = int(input())
fac = {}
for i in range(2,10**6):
if n % i == 0:
fac[i] = 0
while n % i == 0:
fac[i] += 1
n //= i
if n != 1:
fac[n] = 1
#print(fac)
jud = [1]
for i in range(10**6):
jud.append(jud[-1]+i+2)
#print(jud)
ans = 0
for k in fac:
num = fac[k]
for i in range(10**6):
if num >= ... |
p04044 | s225483614 | Accepted | N, L = map(int, input().split())
P = [input() for i in range(N)]
P.sort()
ret = ''
for t in P:
ret += str(t)
print(ret) |
p02594 | s951138814 | Accepted | print("Yes" if int(input())>=30 else "No") |
p03319 | s855470194 | Wrong Answer | import math
N, K = map(int, input().split())
A_list = list(map(int, input().split()))
pos_1 = 0
for i in range(N):
if A_list[i] == 1:
pos_1 = i
ans1 = math.ceil((pos_1)/(K-1)) + math.ceil((N-1-pos_1)/(K-1))
ans2 = math.ceil((pos_1-1)/(K-1)) + math.ceil((N-1-pos_1+1)/(K-1))
ans3 = math.ceil((pos_1+1)/(K-... |
p03485 | s048677213 | Accepted | import math
a, b = map(int, input().split())
print(math.ceil((a + b)/2)) |
p03627 | s193629171 | Wrong Answer | n = int(input())
l = list(map(int,input().split()))
l1 = [0,0]
from collections import Counter
c = Counter(l)
for i in c.items():
if i[1]>=2 :
l1.append(i[0])
l1.sort()
print(l1[-1]*l1[-2]) |
p03379 | s630685720 | Wrong Answer | import copy
N=int(input())
a=input().split(' ')
suji = []
for j in range(len(a)):
suji.append(int(a[j]))
#for i in range(len(a)):
#suji.append(int(a[i]))
for i in range(N):
c = copy.copy(suji)
if c.count(i > 0):
c.remove(i)
aiueo = (len(c) + 1) // 2-1
print(sorted(c)[(len(c) +... |
p03293 | s802568123 | Wrong Answer | S=input()
T=input()
for i in range(len(S)):
S=S[-1]+S[:-1]
if T==S:
print('Yes')
exit()
print(S)
print('No') |
p02817 | s337821427 | Wrong Answer | s, t = input().split()
print(s + t) |
p03077 | s091424551 | Accepted | import sys
sys.setrecursionlimit(10**6)
n = int(input())
a2e = [int(input()) for _ in range(5)]
import math
neck = min(a2e)
ans = 5
t_neck = math.ceil(n/neck)
ans += t_neck-1
print(ans) |
p02713 | s697325592 | Wrong Answer | import math
from functools import reduce
def gcd(*numbers):
return reduce(math.gcd, numbers)
x=int(input())
sum=0
l=0
k=0
h=1
for l in range(x):
l=l+1
for k in range(x):
k=k+1
for h in range(x):
sum=sum+gcd(l,k,h)
h=h+1
print(sum)
|
p03627 | s147353831 | Accepted | import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)
N = int(input())
As = list(mapint())
from collections import Counter
c = Counter(As)
area = 0
for n, c in sorted(c.most_common())[::-1]:
if c<2:
pass
elif c>=4:
... |
p03408 | s344736795 | Accepted | from collections import Counter
#入力
n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]
#blue n (str s)
# red m (str t)
sc = Counter(s)
tc = Counter(t)
u = list(set(s + t))
maxcnt = 0
for i in range(len(u)):
cnt = 0
cnt += sc[u[i]]
cnt -= tc[u[i]]
if cnt >= maxcnt:
ma... |
p02612 | s235252228 | Accepted | n = int(input())
n %= 1000
if n == 0:
print(0)
else:
print(1000 - n)
|
p03261 | s272085144 | Accepted | N=int(input())
W=list(input() for i in range(N))
for i in range(N-1):
if W.count(W[i]) == 2:
print("No")
break
if W[i][-1] != W[i+1][0]:
print("No")
break
else:
print("Yes") |
p03611 | s723823118 | Accepted | from collections import defaultdict
N = int(input())
A = list(map(int,(input().split())))
c = defaultdict(lambda:0)
for i in range(1,10**5+1):
c[i]
for i in A:
c[i] += 1
l = list(c.items())
l.sort()
p = []
for i in range(0,10**5-2):
p.append(l[i][1]+l[i+1][1]+l[i+2][1])
print(max(p)) |
p02647 | s286895838 | Accepted | import numpy as np
from numba import njit
n,k =map(int,input().split())
a= np.array(list(map(int,input().split())))
@njit(cache=True)
def light(n,a_list):
outcome= np.zeros(n+1, dtype=np.int64)
for i in range(n):
outcome[max(0,i-a_list[i])] += 1
outcome[min(n,i+a_list[i]+1)] -= 1
outcome =... |
p03210 | s812280475 | Wrong Answer | x=int(input())
if x==3 or x==5 or x==7:
print("Yes")
else:
print("No") |
p02982 | s829370131 | Accepted | from decimal import Decimal
import math
n,d=map(int,input().split())
x=[]
ans=0
for i in range(n):
x.append(list(map(int,input().split())))
for i in range(n-1):
for j in range(i+1,n):
tmp=0
for k in range(d):
tmp+=(x[i][k]-x[j][k])**2
tt=math.sqrt(tmp)
if tt==int(tt):... |
p02811 | s550149861 | Accepted | k,x = map(int,input().split())
ans = k*500
if x>ans:
print('No')
else:
print('Yes')
|
p03495 | s604273368 | Accepted | import sys
from collections import Counter
n,k = map(int,input().split())
a = list(map(int,input().split()))
counter = Counter(a)
cnt = 0
c_value= list(counter.values())
nl = len(c_value)
if nl <= k:
print(0)
sys.exit()
c_value.sort()
#print(c_value)
do_num = nl - k
for i in range(do_num):
cnt += c_value[i]
p... |
p02832 | s836860994 | Accepted | n = int(input())
t = [False]*(n+1)
t[0] = True
l = [int(i) for i in input().split()]
ans = 0
for i in range(n):
x = l[i]
if t[x-1]:
t[x] = True
ans = max(ans, x)
print(n-ans if ans > 0 else -1) |
p03329 | s333619950 | Accepted | N = int(input())
lst = [1, 6, 9, 6**2, 9**2, 6**3, 9**3, 6**4, 9**4, 6**5, 6**6, 9**5]
dp = [N+1] * (N+1)
dp[0] = 0
for i in range(1, N+1):
for j in lst:
if j <= i:
# print(i, j, i-j)
dp[i] = min(dp[i], dp[i-j]+1)
print(dp[-1]) |
p02712 | s260154407 | Wrong Answer | n = int(input())
answer = 0
for i in range(1, n + 1):
if i % 3 and i % 5:
answer += i
print(i)
print(answer) |
p02862 | s988374766 | Accepted | X,Y=map(int,input().split())
def cmb(n,k):
x,y=1,1
for i in range(k):
x = x * (n-i)%mod
y = y * (k-i)%mod
return x*pow(y,mod-2,mod)%mod
if (X+Y)%3!=0:
print(0)
else:
m=(2*X-Y)//3
n=(2*Y-X)//3
if n<0 or m<0:
print(0)
else:
mod=10**9+7
ans=cmb(n+m,... |
p03696 | s471558390 | Wrong Answer | N=int(input())
n=input()
l=0;r=0
for i in n:
if i=="(":
r+=1
else:
if r:
r-=1
else:
l+=1
print("("*r+n+")"*l) |
p03838 | s010361306 | Accepted | x, y = map(int, input().split())
ans = float("inf")
if y >= x:
ans = min(ans, y - x)
if y >= x * -1:
ans = min(ans, y - x * -1 + 1)
if y * -1 >= x:
ans = min(ans, y * (-1) - x + 1)
if y * -1 >= -1 * x:
ans = min(ans, y * -1 - x * -1 + 2)
print(ans) |
p03971 | s373550666 | Accepted | n,a,b=map(int,input().split())
s=list(input())
count=0
cnt=0
for i in range(n):
if(cnt>=a+b):
print("No")
else:
if(s[i]=="a"):
print("Yes")
cnt+=1
elif(s[i]=="b"):
if(count<b):
print("Yes")
count+=1
cnt+=1
else:
print("No")
else:
print("N... |
p03479 | s855623879 | Accepted | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
x, y = map(int, readline().split())
l = []
while x <= y:
l.append(x)
x *= 2
print(len(l)) |
p02723 | s673843216 | Accepted | s = input()
print('Yes' if s[2]==s[3] and s[4]==s[5] else 'No') |
p03548 | s139589112 | Wrong Answer | X,Y,Z = map(int,input().split())
cnt = 0
while X-1 >= Z+Y:
X -= Z+Y
cnt += 1
print(cnt) |
p02818 | s069797669 | Wrong Answer | A, B, K = map(int, input().split())
if A == 0 and B == 0:
print(0, 0)
elif A > K:
print(A-K, B)
else:
print(0, B-(K-A))
|
p02678 | s325428860 | Wrong Answer | import itertools
import math
import fractions
import functools
import copy
from collections import deque
n, m = map(int, input().split())
g = [[] for i in range(n)]
for i in range(m):
a,b = map(int, input().split())
a -= 1
b -= 1
g[a].append(b)
g[b].append(a)
print(g)
a = [-1]*n
d = deque([0])
whi... |
p02717 | s252630085 | Accepted | l = input().split()
print(l[2], l[0], l[1]) |
p02646 | s787381274 | Wrong Answer | A, V = map(int,input().split())
B, W = map(int,input().split())
T = int(input())
A *= 10**9
B *= 10**9
if B - A <= 0:
print("YES")
else:
if (V-W) * T >= B - A:
print("YES")
else:
print("NO")
|
p03612 | s333402110 | Wrong Answer | N=int(input())
p=list(map(int,input().split()))
swap=[0,0]
cnt=0
for i in range(N):
if (p[i]==i+1):
if swap[0]==0:
swap[0]=i+1
else:
swap[1]=i+1
#print(swap)
cnt=cnt+(swap[1]-swap[0])
swap=[0,0]
print(cnt)
|
p03779 | s304243541 | Accepted | X = int(input())
ans = 0
a_i = 0
n = 1
while a_i < X:
a_i = a_i + n
ans = n
n += 1
print(ans)
|
p03407 | s203455813 | Accepted | a,b,c = map(int,input().split())
if a+b>=c:
print('Yes')
else:
print('No') |
p03720 | s903209283 | Accepted | N,M = map(int, input().split())
li = [0 for i in range(N)]
for i in range(M):
x,y = map(int, input().split())
li[x-1] += 1
li[y-1] += 1
for i in range(N):
print(li[i]) |
p03317 | s263301076 | Accepted | N,K = (int(X) for X in input().split())
A = [int(X) for X in input().split()]
Left = A.index(1)
Right = (N-1)-Left
Count = (Right%(K-1)!=0)+Right//(K-1)
Left -= (Right%(K-1)!=0)*((K-1)-Right%(K-1))
Count += (Left%(K-1)!=0)+Left//(K-1)
print(Count) |
p03612 | s920323504 | Wrong Answer | N = int(input())
P = list(map(int, input().split()))
ans = 0
for i in range(N - 1):
a, b = P[i], P[i + 1]
if a == i + 1:
ans += 1
P[i] = b
P[i + 1] = a
print(ans)
|
p03309 | s448375203 | Accepted | n = int(input())
l = list(map(int,input().split()))
l = list(l[i]-i for i in range(n))
import statistics as st
m = int(st.median(l))
print(sum(abs(m-i) for i in l)) |
p02996 | s993207960 | Wrong Answer | from heapq import heappush, heappop
N = int(input())
H = []
for _ in range(N):
A, B = map(int,input().split())
heappush(H, (B - A, A))
t = 0
for _ in range(N):
S, A = heappop(H)
if S < t:
print("No")
break
t += A
if len(H) == 0:
print("Yes") |
p03962 | s970037543 | Wrong Answer | a, b, c = map(int,input().split())
if a == b:
if a == c:
print(1)
elif a != c:
print(2)
elif a != b:
if a == c:
print(2)
elif a != c:
print(3)
elif b == c:
print(2) |
p02621 | s577353951 | Accepted |
n = int(input());
print(n + n**2 + n**3) |
p03359 | s027891021 | Wrong Answer | a, b = map(int, input().split())
s = min(a, b)
cnt = 0
for i in range (s+1):
if i < a and i < b:
cnt += 1
print(cnt) |
p02860 | s486579584 | Accepted | N = int(input())
S = input()
FLG = False
if N % 2 == 0:
if S[:int(N/2)]*2 == S:
FLG = True
if FLG:
print("Yes")
else:
print("No") |
p02577 | s833403175 | Accepted | N = input()
cnt = 0
for i in N:
cnt += int(i)
print("Yes" if cnt % 9== 0 else "No")
|
p03109 | s412121568 | Accepted | S=input()
if S<="2019/04/30":
print("Heisei")
else:
print("TBD") |
p04030 | s982916288 | Accepted | def display():
s = input()
out = []
final = ''
for i in range(len(s)):
key = s[i]
if key == '0':
out.append('0')
if key == '1':
out.append('1')
if key == 'B':
if len(out) > 0:
out.pop()
for i in range(len(... |
p02658 | s299964551 | Wrong Answer | n = int(input())
ans =1
a = list(map(int, input().strip().split()))
for i in a:
ans *= i
if(ans>0**18):
print(-1)
else:
print(ans) |
p02552 | s481101004 | Accepted | x = int(input())
if x == 0:
print(1)
else:
print(0) |
p02982 | s858442749 | Wrong Answer | n, d = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]
count = 0
for i in range(n - 1):
total = 0
for now_, next_ in zip(x[i], x[i+1]):
total += abs(now_ - next_) ** 2
for j in range(total + 1):
if j ** 2 == total:
count += 1
print(count)
|
p03633 | s220432804 | Accepted | import fractions
n=int(input())
ans=int(input())
for i in range(n-1):
t=int(input())
ans=(ans*t)//fractions.gcd(t,ans)
print(ans)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.