problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p02951
s884087188
Accepted
a, b, c = map(int, input().split()) k = a-b vv = c - k if vv >= 0: print(vv) else: print(0)
p03239
s604168959
Accepted
N, T = map(int, input().split()) cost = [] for _ in range(N): c, t = map(int, input().split()) if t <= T: cost.append(c) cost.sort() if len(cost) == 0: print('TLE') else: print(cost[0])
p02708
s674466893
Wrong Answer
N,K=map(int,input().split()) ans=0 for k in range(K,N+2): ans+= (k*(2*N+1-k)//2) - (k*(k-1)//2) +1 print(ans)
p02684
s112396125
Wrong Answer
n, k = map(int, input().split()) a_ls = list(map(int, input().split())) my_dict = dict() ptr = 0 cnt = 0 while True: if ptr in my_dict: break else: my_dict[ptr] = cnt cnt += 1 ptr = a_ls[ptr] - 1 loop = cnt - my_dict[ptr] k = k % loop + loop * (10 ** 6 // loop) ptr = 0 for i in range(k): ptr = a_ls[ptr] - 1 print(ptr + 1)
p03627
s617130138
Accepted
import sys input = sys.stdin.readline from collections import Counter N=int(input()) A=Counter(list(map(int,input().split()))) x=[0,0] for a in A: if A[a]>1:x.append(a) if A[a]>3:x.append(a) x.sort() print(x[-1]*x[-2])
p03448
s559936074
Accepted
A = int(input()) B = int(input()) C = int(input()) X = int(input()) count = 0 for i in range(A+1): for j in range(B+1): for k in range(C+1): if 500*i + 100*j + 50*k == X: count += 1 print(count)
p02854
s204162987
Wrong Answer
N = int(input()) nums = list(map(int, input().split())) S = sum(nums) print(S) half = 0 for num in nums: half += num if half*2 >= S: answer = min(half-S//2, S//2-half+num) if S%2 != 0: answer += 1 print(answer) exit()
p02970
s464808244
Accepted
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians from itertools import accumulate, permutations, combinations, product, groupby from operator import itemgetter, mul from copy import deepcopy from string import ascii_lowercase, ascii_uppercase, digits from bisect import bisect, bisect_left from fractions import gcd from heapq import heappush, heappop from functools import reduce def input(): return sys.stdin.readline().strip() def INT(): return int(input()) def MAP(): return map(int, input().split()) def LIST(): return list(map(int, input().split())) def ZIP(n): return zip(*(MAP() for _ in range(n))) sys.setrecursionlimit(10 ** 9) INF = float('inf') mod = 10 ** 9 + 7 N, D = MAP() print(-(-N//(2*D+1)))
p03486
s845173849
Wrong Answer
s = input() t = input() s_split = list(s) s_split.sort() t_split = list(t) t_split.sort() if len(s_split) < len(t_split): if s_split <= t_split: print("Yes") else: print("No") else: if s_split < t_split: print("Yes") else: print("No")
p03767
s117004329
Accepted
N = int(input()) a = list(map(int, input().split())) ans = 0 a.sort(reverse = True) for i in range(1, 2 * N, 2): ans += a[i] print(ans)
p03759
s317532380
Accepted
# https://atcoder.jp/contests/abc058/tasks/abc058_a a, b, c = map(int, input().split()) if (b - a) == (c - b): print('YES') else: print('NO')
p02665
s466701048
Wrong Answer
N=int(input()) A=list(map(int,input().split())) for i in range(N): if A[i]>i: print(-1) exit()
p02813
s725334020
Wrong Answer
import itertools n=int(input()) p=list(map(int,input().split())) q=list(map(int,input().split())) nums = list(range(1,n+1)) d= [ list(i) for i in itertools.permutations(nums,n)] a=0 b=0 for i in range(len(d)): if p==d[i]: a=i elif q==d[i]: b=i print(abs(a-b))
p03705
s594981538
Wrong Answer
n,a,b=map(int, input().split()) pot = b-a+1 if(b<a): print(0) exit() if n==0: print(0) elif n==1: if a==b: print(1) else:print(0) elif n==2: if a==b:print(1) print(1) else: k = n-2 ans=(pot*(pot+1))//2 pot -= k ans-=(pot*(pot+1))//2 print(ans)
p02621
s539046122
Wrong Answer
A = int(input("Input a value for 'a': ")) FINAL = A + (A*A) + (A*A*A) print(FINAL)
p03773
s653585160
Accepted
a,b=map(int,input().split()) if a+b<24: print(a+b) elif a+b>=24: print(a+b-24)
p02935
s963162359
Accepted
N = int(input()) li = list(map(int,input().split())) li.sort() for i in range(N-1): li[i+1] = (li[i] + li[i+1])/2 print(li[N-1])
p03338
s267440389
Wrong Answer
import math def main(): n = int(input()) s = input() ans=0 for i in range(0,int(n/2)+1): sum=0 x=s[:i+1] y=s[i+1:] while len(x)>0: if x[0] in y : sum+=1 x=x.replace(x[0],'') if sum>ans: ans=sum print(ans) main()
p04012
s496967581
Accepted
w=input() d={} for c in w: if c in d: d[c]+=1 else: d[c]=1 for k in d: if d[k]%2!=0: print('No') exit() print('Yes')
p02994
s399988730
Accepted
n, l = (int(xi) for xi in input().split()) a = int(n*(l-1)+n*(n+1)/2) # print(a) if 0<1-l<n+1: print(a) if 1-l<1: print(a-(l+1-1)) if n<1-l: print(a-(l+n-1))
p03799
s541384064
Accepted
N, M = map(int, input().split()) ans = 0 if N * 2 <= M: ans += N M -= N * 2 ans += M // 4 print(ans) else: ans += M//2 print(ans)
p04020
s932608560
Wrong Answer
n=int(input()) A=[0]*n for i in range(n): A[i]=int(input()) s=0 m=0 for i in range(n): s+=A[i]//2 if A[i]%2==0: m=0 else: if m==1: s+=1 m=0 print(s)
p02702
s196327635
Wrong Answer
from collections import Counter S = input() num = len(S) data = [0]*100 for i in range(100): data[i] = 2019 * (1 + i) ans = 0 for i in range(100): tar = str(data[i]) if (tar in S): tarNum = len(str(tar)) for j in range(num - tarNum + 1): cut = S[j: j + tarNum] # print(cut) if (cut == tar): ans += 1 print(ans)
p02712
s936274218
Accepted
N=int(input()) ans=0 for i in range(1,N+1): if i%3==0 or i%5==0: continue ans+=i print(ans)
p03351
s439757265
Wrong Answer
a, b, c, d = map(int,(input().split())) if a - (b + c) <= d: print("Yes") else: print("No")
p02711
s021963755
Accepted
N = int(input()) strN = str(N) if strN.count("7") > 0: print("Yes") else: print("No")
p03162
s543998832
Accepted
n=int(input()) ll=[] for i in range(n): ll.append([int(i) for i in input().split()]) dp=[[0]*3 for i in range(n)] dp[0]=ll[0] for i in range(1,n): for j in range(3): dp[i][j]=max(dp[i-1][(j+1)%3],dp[i-1][(j+2)%3])+ll[i][j] print(max(dp[n-1]))
p03730
s979721918
Accepted
nums = [int(e) for e in input().split()] count=0 for i in range(nums[1]): if (nums[0]*(i+1))%nums[1]==nums[2]: count=1 if count==0: print("NO") else: print("YES")
p02554
s616782687
Accepted
from sys import stdin,stdout M=10**9+7 n=int(stdin.readline()) # a,b,c,d=list(map(int,stdin.readline().split())) # pp=int(pow(10,n-2)) # ans=(pp*n*(n-1)) ans=(10**n)-2*(9**n)+(8**n) print(ans%M)
p03486
s299318371
Accepted
s = list(input()) t = list(input()) s.sort() s2 = ''.join(s) t.sort(reverse=True) t2=''.join(t) print('Yes') if s2<t2 else print('No')
p02790
s497256211
Wrong Answer
a, b = map(int, input().split()) c = max(a, b) d = min(a, b) ans = str(c)*d print(ans)
p02755
s084023995
Wrong Answer
A, B = map(int, input().split()) Ax = A * 25 / 2 Ay = (A + 1) * 25 / 2 Bx = B * 10 By = (B + 1) * 10 if Ay <= Bx or By <= Ax: print(-1) else: ans = max(Bx, Ax) if ans % 1: ans = int(ans) ans += 1 print(ans)
p02959
s480248689
Accepted
N = int(input()) A = [int(i) for i in input().split()] B = [int(i) for i in input().split()] t = 0 for i,b in enumerate(B): m = min(A[i], b) b -= m A[i] -= m t += m m = min(A[i+1], b) b -= m A[i+1] -= m t += m print(t)
p03612
s945514538
Wrong Answer
import sys inint = lambda: int(sys.stdin.readline()) inintm = lambda: map(int, sys.stdin.readline().split()) inintl = lambda: list(inintm()) instrm = lambda: map(str, sys.stdin.readline().split()) instrl = lambda: list(instrm()) n = inint() P = inintl() ans = 0 for i in range(n-1): if i+1 == P[i] and i+2 == P[i+1]: ans += 1 elif i+1 != P[i] and i+2 == P[i+1]: ans += 1 elif i+1 == P[i] and i+2 != P[i+1]: continue if P[0] == 1 and P[1] != 2: ans += 1 print(ans)
p02817
s027371007
Wrong Answer
s,t = input().split() print(s + t)
p03720
s493446246
Accepted
n, m = map(int, input().split()) l = [0]*n for i in range(m): a, b = map(int, input().split()) l[a-1] +=1 l[b-1] +=1 for i in range(n): print(l[i])
p02555
s858343636
Accepted
inp=[1,1] v=pow(10,9)+7 for i in range(2,2001): inp.append((inp[-1]*i)%v) s=int(input()) up=s//3 ans=0 for k in range(1,up+1): a=inp[s-2*k-1] b=inp[k-1]*inp[s-3*k] b=pow(b,v-2,v) ans+=((a*b)%v) ans=ans%v print (ans)
p03087
s331032359
Accepted
# author: Taichicchi # created: 12.09.2020 19:26:19 import sys N, Q = map(int, input().split()) S = input() cum_ls = [0] for i in range(1, N): if S[i - 1: i + 1] == "AC": cum_ls.append(cum_ls[i - 1] + 1) else: cum_ls.append(cum_ls[i - 1]) # print(cum_ls) for i in range(Q): l, r = map(int, input().split()) print(cum_ls[r - 1] - cum_ls[l - 1])
p02982
s401772764
Accepted
n,d = map(int,input().split()) X=[] for i in range(n): x=list(map(int,input().split())) X.append(x) c=0 D2=[] for i in range(n-1): for j in range(i+1,n): d2=0.0 for k in range(d): d2 += (X[i][k]-X[j][k])**2 D2.append(d2**0.5) if (d2**0.5)%1==0 : c+=1 print(c)
p02660
s319113350
Wrong Answer
import math n = int(input()) count = 0 flg = True if n == 1: print(0) exit() for i in range(2, int(math.sqrt(n)) + 1): if n % i == 0: n = n // i flg = False count += 1 if flg == True: print(1) exit() print(count)
p03836
s433480432
Accepted
sx, sy, tx, ty = map(int, input().split()) tx_sx = tx - sx ty_sy = ty - sy ans = "" for i in range(ty_sy): ans += "U" for i in range(tx_sx): ans += "R" for i in range(ty_sy): ans += "D" for i in range(tx_sx): ans += "L" ans += "L" for i in range(ty_sy + 1): ans += "U" for i in range(tx_sx + 1): ans += "R" ans += "DR" for i in range(ty_sy + 1): ans += "D" for i in range(tx_sx + 1): ans += "L" ans += "U" print(ans)
p02958
s593474027
Wrong Answer
n = int(input()) p = list(map(int,input().split())) s = sorted(p) for i in range(n//2): if p[i] < p[n-1-i]: #print(p[i],p[n-1-i]) pass else: a = p[i] b = p[n-1-i] p[i] = b p[n-1-i] = a #print(p) #print(s) if p == s: print("YES") else: print("NO")
p03319
s357959500
Accepted
import sys input = lambda: sys.stdin.readline().rstrip() n, k = map(int, input().split()) a = list(map(int, input().split())) for i in range(n): if a[i] == 1: break left = len(a[:i]) right = len(a[i + 1:]) ans = left // (k - 1) + right//(k - 1) + (left%(k-1) + right%(k-1))//(k-1) + int((left%(k-1) + right%(k-1))%(k - 1) != 0) print(ans)
p03210
s427280270
Accepted
x=input() ans=["YES","NO"][x not in "357"] print(ans)
p02768
s276209153
Accepted
# ans = 全通り - nCa - nCb # = 2^n - 1 - nCa - nCb def comb(n,r,mod=10**9+7): a=1 b=1 r = min(r,n-r) for i in range(r): a = a*(n-i)%mod b = b*(i+1)%mod return a*pow(b,mod-2,mod)%mod n, a, b = map(int, input().split()) mod = (10**9) + 7 num_all = pow(2, n, mod) - 1 nca = comb(n, a, mod=mod) ncb = comb(n, b, mod=mod) ans = num_all - nca - ncb ans %= mod print(ans)
p03481
s386461741
Accepted
X,Y = map(int, input().split()) ans = 0 num = X while num <= Y: ans += 1 num *= 2 print(ans)
p02947
s278423215
Wrong Answer
n = int(input()) d = [0 for i in range(n)] for i in range(n): a = 0 for j in input(): a += 2**(ord(j)-97) d[i] = a d = sorted(d) ans = 0 co = 1 for i in range(1, n): if d[i-1] == d[i]: co += 1 else: ans += co*(co-1) // 2 co = 1 ans += co*(co-1) // 2 print(ans)
p03281
s535940789
Wrong Answer
def ABC106C(n): a = 0 for i in range(1,n+1): if n % i == 0: a += 1 return a a = 0 for i in range(1,int(input()),2): if ABC106C(i)==8: a += 1 print(a)
p03419
s579552612
Accepted
n,m=map(int,input().split()) if n==1 and m==1: print(1) elif n==1 or m==1: print(max(n-2,m-2)) else: print((n-2)*(m-2))
p03408
s403730957
Accepted
n=int(input()) s=[] t=[0]*101 for _ in range(n): si=input() if si not in s:s.append(si) t[s.index(si)]+=1 m=int(input()) for _ in range(m): si=input() if si in s:t[s.index(si)]-=1 print(max(0,max(t)))
p02767
s700678770
Wrong Answer
N=int(input()) a=list(map(int,input().split())) s=[] for i in range(101): for j in range(0,len(a)): m=0 m+=(a[j]-i)**2 s.append(m) print(min(s))
p03994
s626175836
Accepted
S=input() K=int(input()) i=0 l='' while i<len(S)-1: if S[i]=='a': l+='a' elif 123-ord(S[i])<=K: l+='a' K-=123-ord(S[i]) else: l+=S[i] i+=1 if K>0: K%=26 n=ord(S[-1])+K if n>122: n-=26 l+=chr(n) else: l+=S[-1] print(l)
p02778
s711153361
Accepted
word=list(input()) for i in range(len(word)): word[i]="x" print("".join(word)) print()
p03239
s690158623
Accepted
N,T=map(int,input().split()) List = [] for i in range (N): List.append(list(map(int, input().split()))) res = 1001 for i in range(N): if List[i][1] <= T: res = min(res,List[i][0]) if res == 1001: print("TLE") else: print(res)
p03495
s326645281
Wrong Answer
from collections import Counter n, k = map(int, input().split()) a = list(map(int, input().split())) syurui = len(set(a)) #print(syurui) c = Counter(a) ans = 0 c_sort = c.most_common() print(c_sort) for i in range(1, syurui-k + 1): ans += c_sort[-i][1] print(ans)
p02684
s525366840
Wrong Answer
N, K = map(int, input().split()) A = list(map(int, input().split())) B = [1] C = [1] + [0] * (N - 1) i = 0 while C[A[i] - 1] == 0: B.append(A[i]) C[A[i] - 1] = 1 i = A[i] - 1 ans = 0 for j in range(len(B)): if B[j] == A[i]: ans += j if len(B) - ans != 0: ans += (K - ans) % (len(B) - ans) print(B[ans])
p03160
s640919997
Accepted
import itertools import math import sys from collections import Counter from fractions import gcd from functools import reduce import sys sys.setrecursionlimit(4100000) INF = 1 << 60 n = int(input()) h = list(map(int, input().split())) dp = [INF] * n dp[0] = 0 for i in range(1, n): dp[i] = min(dp[i], dp[i - 1] + abs(h[i] - h[i - 1])) if i != 1: dp[i] = min(dp[i], dp[i - 2] + abs(h[i] - h[i - 2])) # print(dp[i], h[i], h[i - 1], h[i - 2]) # for i in dp: # print(i) print(dp[-1])
p03659
s838793828
Accepted
n=int(input()) a=list(map(int,input().split())) s_lst=[0] for i,aa in enumerate(a): s_lst.append(s_lst[i]+aa) # len(s_lst): n+1 s_all=s_lst[-1] ans=float("inf") for i in range(1,len(s_lst)-1): ans=min(ans,abs(2*s_lst[i]-s_all)) print(ans)
p02657
s330438374
Accepted
x,y = map(int, input().split()) print(x*y)
p03352
s157303675
Accepted
x = int(input()) i = 2 ans = 1 while i * i < x: j = 2 while i**j <= x: ans = max(ans, i**j) j += 1 i += 1 print(ans)
p02676
s262600294
Accepted
K = int(input()) S = input() if len(S) <= K: print(S) else: print(S[0:K] + '...')
p03475
s975677409
Accepted
n=int(input()) a=[0 for i in range(n)] for i in range(n-1): c,s,f=map(int,input().split()) for j in range(i+1): a[j]=-max(a[j],s)//f*-f+c print(*a,sep='\n')
p02729
s346266245
Accepted
N, M = tuple(map(int, input().split())) import math def comb(n, r): return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) if M < 2 and N < 2: print(0) elif M < 2: print(comb(N,2)) elif N < 2: print(comb(M,2)) else: print(comb(N,2) + comb(M, 2))
p03456
s863698448
Accepted
import math a, b = input().split() x = math.sqrt(int(a + b)) ret = 'No' if math.ceil(x) == math.floor(x): ret = 'Yes' print(ret)
p03767
s263161522
Wrong Answer
N=int(input()) a=sorted(map(int,input().split())) print(sum(a[N:2*N]))
p02833
s656841622
Accepted
N = int(input()) if N % 2 == 1: print(0) else: N_copy = N N_copy //= 2 count_5 = 0 count_2 = 0 while N_copy > 0: N_copy //= 5 count_5 += N_copy while N > 0: N //= 2 count_2 += N print(min(count_2, count_5))
p02570
s589973379
Accepted
D, T, S = map(int, input().split()) if T >= D / S: print("Yes") else: print("No")
p02659
s785805223
Accepted
from math import floor from decimal import Decimal def main(): a, b = map(Decimal, input().split()) print(floor(a * b)) if __name__ == '__main__': main()
p02640
s101751143
Accepted
a,b = map(int,input().split()) if b % 2 == 1: print("No") else: if a*2 <= b and b<= a*4: print("Yes") else: print("No")
p03419
s930955244
Accepted
N, M = map(int, input().split()) if N == M == 1: print(1) exit() if N == 1 or M == 1: print(max(0, N * M - 2)) else: print(N * M - 2 * (N + M - 2))
p03592
s010501085
Accepted
n, m, k = map(int, input().split()) flg = False for i in range(n+1): for j in range(m+1): total = (n-i)*j + i*(m-j) if total == k: flg = True break if flg: print('Yes') else: print('No')
p03339
s520902256
Wrong Answer
n = int(input()) s = input() w = [0]*(n + 2) e = [0]*(n + 2) ans = 10000 for i in range(1, n + 1): w[i] += w[i - 1] e[-i - 1] += e[-i] if s[i - 1] == "W": w[i] += 1 if s[-i] == "E": e[-i - 1] += 1 for i in range(1, n + 1): ref = e[i + 1] ref += w[i - 1] ans = min(ans, ref) print(ans)
p03073
s743502556
Accepted
s = list(input()) ans = 0 for i in range(1,len(s)): if s[i-1] == '1' and s[i] == '1': s[i] = '0' ans += 1 elif s[i-1] == '0' and s[i] == '0': s[i] = '1' ans += 1 print(ans)
p02645
s581521213
Accepted
s=input() print(s[:3])
p03951
s612490837
Accepted
N = int(input()) s = input() t = input() sr = s[::-1] for i in range(N+1): if s[i:] == t[:N-i]: break print(N+i)
p03487
s993058319
Accepted
N = int(input()) a = input().split() ans = 0 from collections import Counter d = Counter(a) for i in d: if d[i] != int(i): if d[i] > int(i): ans += d[i] - int(i) else: ans += d[i] print(ans)
p03264
s139602453
Accepted
N = int(input()) print((N // 2) * (( N + 1 ) // 2))
p04030
s290353825
Accepted
key = input() s = [] for i in key: if i == '0' or i == '1': s.append(i) else: if len(s) > 0: s.pop(-1) print(''.join(s))
p03836
s381628637
Wrong Answer
sx,sy,tx,ty=map(int,input().split()) print("R"*(tx-sx)+"U"*(ty-sy)+"L"*(tx-sx)+"D"*(ty-sy)+"D"+"R"*(tx-sx+1)+"U"*(ty-sy+1)+"L"+"U"+"L"*(tx-sx+1)+"D"*(ty-sx+1)+"R")
p02548
s543768824
Wrong Answer
import math n=int(input()) s=0 r=0 t=n//2 for i in range(1,t+1): p=((n-1)//i) s+=p print(s+t-1)
p03437
s017710036
Wrong Answer
import random x,y=map(int,input().split()) if (x*random.randint(1,9))%y != 0: print(x*random.randint(1,9))
p02690
s859318990
Accepted
X = int(input()) for b in range(-1000, 1000, 1): for a in range(b, 1000, 1): if a ** 5 - b ** 5 == X: print(a, b) exit()
p02725
s228749022
Accepted
K,N = map(int,input().split()) A=list(map(int,input().split())) gap=A[0]-A[N-1]+K for i in range(N-1): gap=max(gap,A[i+1]-A[i]) print(K-gap)
p02595
s672952913
Wrong Answer
a,b=input().split() a=int(a) b=int(b) c=[input().split() for i in range(a)] d=0 for i in range(a): if abs(int(c[i][0])*int(c[i][1]))<=b**2: d=d+1 print(d)
p03814
s220461395
Wrong Answer
s = input() A = 0 Z = 0 for i in range (len(s)): if s[i] == "A": A = i if s[i] == "Z": Z = i print(Z-A+1)
p03309
s245208674
Accepted
N = int(input()) A = tuple(map(int, input().split())) B = [a-(i+1) for i, a in enumerate(A)] B = sorted(B) b = B[len(B) // 2] s = 0 for b_ in B: s += abs(b_ - b) print(s)
p02796
s309508463
Accepted
n = int(input()) xl = [list(map(int, input().split())) for _ in range(n)] lr = [] for i in range(n): l = max(xl[i][0] - xl[i][1], 0) r = max(xl[i][0] + xl[i][1], 0) lr.append([l, r]) lr.sort(key=lambda x: x[1]) keep = [False] * n cur = 0 for i in range(n): if cur <= lr[i][0]: keep[i] = True cur = lr[i][1] ans = sum(keep) print(ans)
p03617
s466272509
Accepted
q, h, s, d = map(int, input().split()) n = int(input()) one = [q*4, h*2, s] one.sort() cost = 0 if one[0]*2>d: cost += d*(n//2) n %= 2 cost += one[0]*int(n) n -= int(n) if n==0: print(cost) else: n *= 100 x = [] x.append(q*(n//25)) x.append(s*(n//50)+q*((n%50)//25)) print(min(x)+cost)
p03239
s418781902
Accepted
x = input() k=x.split(" ") N = int(k[0]) T = int(k[1]) c = [] t = [] for i in range(N): p = input() y = p.split(" ") if int(y[1]) <= T: c.append(int(y[0])) t.append(int(y[1])) if len(c) <=0: print("TLE") else: print(min(c))
p02793
s556998130
Wrong Answer
import sys input = sys.stdin.buffer.readline import fractions from functools import reduce def main(): N = int(input()) a = list(map(int,input().split())) MOD = 10**9+7 def lcm(x,y): return((x*y)//fractions.gcd(x,y)) l = reduce(lcm,a) ans = 0 for num in a: ans += l//num print(ans) if __name__ == "__main__": main()
p02665
s692010482
Wrong Answer
print("-1")
p03407
s603250744
Accepted
A,B,C=map(int,input().split()) if A+B >= C: print("Yes") else: print("No")
p02577
s608774446
Accepted
n = input( ) result = sum(list(map(int, str(n)))) if result % 9 == 0 : print('Yes') else : print('No')
p03693
s496645640
Accepted
# -*- coding: utf-8 -*- rgb = int(input().replace(" ", "")) if rgb % 4 == 0: print('YES') else: print('NO')
p03449
s238484097
Wrong Answer
N=int(input()) li = [] for n in range(2): li.append(list(map(int,input().split()))) max = 0 for x in range(N): now = 0 for y in range(x): now += li[0][y] for y in range(N - x): now += li[0][y] now += li[1][N-1] if max < now: max = now print(max)
p02720
s009175717
Accepted
from collections import deque K=int(input()) lun=deque([1,2,3,4,5,6,7,8,9]) for i in range(K): x=lun.popleft() if x%10!=0: lun.append(10*x+x%10-1) lun.append(10*x+x%10) if x%10!=9: lun.append(10*x+x%10+1) print(x)
p03352
s618435708
Wrong Answer
x = int(input()) num = [i**2 for i in range(1,33)] def binary_search(li,k): left = 0 right = 33 while left < right: mid = (left+right)//2 if li[mid]<=x and x<li[mid+1]: return li[mid] elif li[mid] < x: left = mid+1 else: right = mid print(binary_search(num,x))
p03448
s173107468
Accepted
A = int(input()) B = int(input()) C = int(input()) X = int(input()) ans = 0 for i in range(A+1): for j in range(B+1): for k in range(C+1): if (i*500 + j*100 + k*50) == X: ans += 1 print(ans)
p03543
s110431539
Accepted
a,b,c,d=input() print("Yes" if a==b==c or b==c==d else "No")
p03331
s994285723
Accepted
N=int(input()) A=[] for i in range(1,(N//2)+1): A.append(list(str(i))+list(str(N-i))) for i in range(len(A)): for j in range(len(A[i])): A[i][j]=int(A[i][j]) B=[] for i in range(len(A)): B.append(sum(A[i])) print(min(B))