problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03136
s969133072
Accepted
N = int(input()) L = list(input().split()) L = [int(L[i]) for i in range(N)] if max(L) < sum(L) - max(L): print('Yes') else: print('No')
p03073
s881026313
Accepted
# input s = input() # define bw = 0 wb = 0 # main for i in range(len(s)): if int(s[i]) % 2 == i % 2: bw += 1 else: wb += 1 # output print(min(bw, wb))
p02724
s301415372
Wrong Answer
X = int(raw_input()) print(X/500 + (X%500)/5)
p02760
s033860984
Accepted
import numpy as np card = np.array([list(map(int, input().split())) for i in range(3)]) n = int(input()) number = [int(input()) for i in range(n)] hit = np.vectorize(lambda x: x in number)(card) row = hit.all(axis=0).any() col = hit.all(axis=1).any() diag1 = hit[0][0] and hit[1][1] and hit[2][2] diag2 = hit[0][2] and hit[1][1] and hit[2][0] print('Yes' if row or col or diag1 or diag2 else 'No')
p02570
s178116240
Accepted
d, t, s = map(int, input().split()) if d / s <= t: print('Yes') else: print('No')
p03087
s385221612
Accepted
N, Q = map(int, input().split()) S = str(input()) cnt = 0 L = [] L.append(0) for i in range(N-1): A = S[i] B = S[i + 1] if A == "A" and B == "C": cnt += 1 L.append(cnt) for x in range(Q): f, r = map(int, input().split()) print(L[r-1] - L[f-1])
p02584
s774276047
Accepted
x,k,d=map(int,input().split()) x=abs(x) ans=10**15 r=x//d if x>=d*k: ans=x-d*k else: k-=r if k%2==0: ans=abs(x-d*r) else: ans=abs(x-d*(r+1)) print(ans)
p02640
s749613397
Accepted
x,y=map(int,input().split()) for i in range(x+1): j=x-i if 2*i+4*j==y: print('Yes') break else: print('No')
p03095
s971981750
Wrong Answer
n = int(input()) s = input() from collections import Counter c = dict(Counter(s)) ans = 0 for i in c: ans *= c[i]+1 ans += c[i] print(ans)
p03163
s216046515
Wrong Answer
import numpy as np n, w = list(map(int, input().split())) wv = np.array([list(map(int, input().split(' '))) for _ in range(n)]) dp = np.zeros((w + 1, n)) dp[wv[0, 0]:, 0] = np.full(dp[wv[0, 0]:, 0].shape, wv[0, 1]) for i in range(1, n): dp[:, i] = dp[:, i - 1] wNew, vNew = wv[i, 0], wv[i, 1] dp[wNew:, :] = np.fmax(dp[wNew:, :], vNew + dp[:-wNew, :]) print(dp[w, n - 1])
p03317
s121893699
Wrong Answer
import math n, k = map(int, input().split()) lis = list(map(int, input().split())) if n == k: print(1) else: print(math.ceil(n/(k-1)))
p02778
s347315180
Wrong Answer
# 入力された文字列をすべてxで置き換える # 文字列の標準入力 s = input() sLength = len(s) hoge = [] for i in range(sLength): c = s[i] c = "x" hoge.append(c) print(hoge) print(''.join(map(str,hoge)))
p02628
s087876509
Wrong Answer
import heapq n,k = map(int,input().split()) l1 = list(map(int,input().split())) l2 = heapq.nsmallest(3, l1) print(sum(l2))
p04044
s533386729
Accepted
line = input().split(' ') N = int(line[0]) L = int(line[1]) List = [] for i in range(N): List.append(input()) List.sort() for i in List: print(i,end="")
p03071
s687549046
Wrong Answer
a, b = map(int, input().split()) ans = 0 if a<b: ans += b b -= 1 else: ans += a a -= 1 if a<b: ans += b b -= 1 else: ans += a a -= 1
p02802
s775350012
Accepted
n,m = map(int, input().split()) wa_l = [0]*(n+1) ac_l = [False]*(n+1) for _ in range(m): p,s = input().split() p = int(p) if s == 'WA' and not ac_l[p]: wa_l[p] += 1 elif s == 'AC': ac_l[p] = True ans_a = 0 ans_w = 0 for wa,ac in zip(wa_l,ac_l): if ac: ans_a+=1 ans_w += wa print(ans_a,ans_w)
p03359
s365308913
Wrong Answer
a, b = map(int, input().split()) if a < b: print(a) else: print(b)
p03543
s710930829
Accepted
N = input() print("Yes" if N[0]==N[1]==N[2] or N[1]==N[2]==N[3] or N[0]==N[1]==N[2]==N[3] else "No")
p02615
s778101464
Accepted
import math import sys from itertools import permutations input = sys.stdin.readline N=int(input()) arr=list(map(int,input().split())) arr.sort(reverse=True) cur=2 ans=arr[0] for i in range(1,N): if cur>=N: break ans+=arr[i] cur+=1 if cur>=N: break ans+=arr[i] cur+=1 print(ans)
p02691
s954824159
Accepted
def main(): from collections import defaultdict import sys input=sys.stdin.readline n=int(input()) a=list(map(int,input().split())) ap=defaultdict(int) am=defaultdict(int) for i in range(n): ap[a[i]+i]+=1 am[i-a[i]]+=1 ans=0 for k,v in ap.items(): if k in am: ans+=v*am[k] print(ans) if __name__ == '__main__': main()
p02681
s671550730
Accepted
S = input() T = input() if(T[:len(S)] == S): print('Yes') else: print('No')
p02802
s267509601
Accepted
n, m = map(int, input().split()) total_ac = 0 total_wa = 0 results = {} for _ in range(m): pi, si = input().split() if results.get(pi) == None: results[pi] = { "AC": False, "CumWA": 0 } if not results[pi]["AC"] and si == "AC": results[pi]["AC"] = True total_ac += 1 total_wa += results[pi]["CumWA"] elif not results[pi]["AC"] and si == "WA": results[pi]["CumWA"] += 1 print(total_ac , total_wa )
p02696
s122134458
Accepted
A, B, N = map(int, input().split()) def f(x): global A, B return (A * x) // B - A * (x // B) if N < B: print(f(N)) else: print(f(B - 1))
p02694
s566187549
Accepted
from sys import stdin import math if __name__ == "__main__": _in = [_.rstrip() for _ in stdin.readlines()] X = int(_in[0]) # type:int # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv yen = 100 cnt = 0 while (yen<X): yen = math.floor(yen*1.01) cnt += 1 # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ print(cnt)
p03251
s357319547
Accepted
N, M, X, Y = [int(i) for i in input().split()] x_list = [int(i) for i in input().split()] y_list = [int(i) for i in input().split()] x_max = max(x_list) y_min = min(y_list) ans = "War" for Z in range(X+1, Y+1): if x_max < Z <= y_min: ans = "No War" break print(ans)
p03827
s424997379
Accepted
N = int(input()) S = input() Sum = 0 Max = 0 for s in S: Sum += (-1)**(s == 'D') Max = max(Sum, Max) print(Max)
p03285
s519853430
Wrong Answer
N=int(input()) a=0 b=0 l=[] for i in range(1,100//4+1): l.append(i*4) for i in range(1,100//7+1): l.append(i*7) for i in range(1,100//11+1): l.append(i*11) #l.sort() #print(l) if N in l: print('Yes') else: print('No')
p03998
s886049851
Accepted
a = list(input()) b = list(input()) c = list(input()) now = a.pop(0) while True: if eval('%s' % now): now = eval(str(now)).pop(0) else: print(now.upper()) exit()
p03672
s252953813
Accepted
s=input() for i in range(len(s)-2,0,-2): s1=s[:i:] #print(s1,s1[:i//2],s1[i//2:]) if s1[:i//2]==s1[i//2:]: print(i) exit()
p03711
s653174230
Accepted
s=input().split(); x=int(s[0]) y=int(s[1]) list1=[2] list2=[4,6,9,11] list3=[1,3,5,7,8,10,12] ans=0; if((x in list1) and (y in list1)): ans=1 elif((x in list2) and (y in list2)):ans=1 elif((x in list3) and (y in list3)):ans=1 if(ans==1):print("Yes") else:print("No")
p02720
s103057122
Accepted
cur = [] def recur(n): if n > 10 ** 10: return cur.append(n) for i in range(10): if abs(n % 10 - i) <= 1: recur(10 * n + i) for i in range(1, 10): recur(i) cur.sort() n = int(input()) print((cur[n - 1]))
p02663
s599457326
Accepted
A = list(map(int, input().split())) print((A[2]*60+A[3])-(A[0]*60+A[1])-A[4])
p03221
s391514797
Accepted
n,m=map(int, input().split()) a=[list(map(int, input().split())) for _ in range(m)] c=[0]*-~n id={} for p,y in sorted(a,key=lambda x:x[1]): c[p]+=1 id[y]=format(p,"06")+format(c[p],"06") for _,y in a: print(id[y])
p02730
s495386798
Accepted
s = input() n = len(list(s)) p = s[:(n-1)//2] t = s[(n+1)//2:] p1 = "" t1 = "" for i in reversed(range((n-1)//2)): p1 += p[i] t1 += t[i] if t1 == t and p1 == p and s == t1 + s[(n-1)//2]+p1: print("Yes") else: print("No")
p03479
s029015654
Accepted
a,b = list(map(int, input().split())) cnt = 0 while b >= a: a = a * 2 cnt += 1 print(cnt)
p02684
s745865789
Accepted
import sys input = sys.stdin.readline N, K = map(int, input().split()) a = list(map(int, input().split())) dbl = [[0] * 61 for _ in range(N)] for i in range(N): dbl[i][0] = a[i] - 1 for k in range(60): for i in range(N): x = dbl[i][k] dbl[i][k + 1] = dbl[x][k] x = 0 while K: x = dbl[x][K.bit_length() - 1] K -= 1 << (K.bit_length() - 1) print(x + 1)
p02789
s040206289
Accepted
m,n = map(int,input().split()) if(m == n): print('Yes') else: print('No')
p03107
s440168939
Accepted
s = input() n = len(s) num_0 = s.count("0") num_1 = n - num_0 print(n - abs(num_0 - num_1))
p02701
s265360199
Accepted
def main(): from collections import Counter n=int(input()) s=[input() for _ in range(n)] print(len(Counter(s))) if __name__=="__main__": main()
p02971
s537917341
Accepted
from collections import deque n = int(input()) A = [] for _ in range(n): A.append(int(input())) leftA = [0] tmp = A[0] for a in A: tmp = max(tmp, a) leftA.append(tmp) # print(leftA) rightA = deque([0]) tmp = A[-1] for a in reversed(A): tmp = max(tmp, a) rightA.appendleft(tmp) rightA.appendleft(0) # print(rightA) for i in range(1, n+1): print(max(leftA[i-1], rightA[i+1]))
p02823
s845608100
Accepted
N, A, B = map(int, input().split()) ans = (B-A)//2 if A%2 == B%2: print(ans) else: if A-1 >= N-B: ans += N-B+1 print(ans) elif N-B > A-1: ans += A print(ans)
p03814
s524535055
Wrong Answer
s = list(input()) n = len(s) left = 0 for i,c in enumerate(s): if c == "A": left = i right = 0 for i,c in enumerate(reversed(s)): if c == "Z": right = n-i print(right-left)
p02952
s827767301
Accepted
n=int(input()) ans=0 for i in range(1,n+1): if len(str(i))%2==1:ans+=1 print(ans)
p02676
s098839492
Wrong Answer
num = int(input()) word = str(input()) if len(word) <= num: print(word) else: word_r = word[:num] for _ in range(len(word) - num): word_r += '.' print(word_r)
p02785
s050839271
Wrong Answer
N, K = list(map(int, input().split())) H = list(map(int, input().split())) result = sum(reversed(sorted(H)[K:])) print(int(result))
p02900
s980180349
Accepted
from fractions import gcd import math a,b = map(int,input().split()) n = gcd(a,b) if n == 1: print(1) exit() count = 1 for i in range(2,math.ceil(math.sqrt(n))+1): if n % i == 0: count += 1 while n % i == 0: n //= i if n > 1: count += 1 print(count)
p03860
s105528202
Accepted
def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) def main(): mod=10**9+7 a,b,c=input().split() print(a[0]+b[0]+c[0]) main()
p03456
s108667704
Accepted
a, b = map(str, input().split(" ")) ans = False for i in range(1000): if int(a + b) == i ** 2: ans = True print("Yes" if ans else "No")
p02836
s016614242
Accepted
s = list(input()) r = s[::-1] ss=0 for i, j in zip(s, r): ss+=int(i!=j) print(int(ss/2))
p03289
s641174877
Accepted
# coding: utf-8 s = input().rstrip() def isValid(s:str): if s[0] != "A": return False if s[1] == s[1].upper(): return False sub = s[2:-1] if len([i for i in sub if i == "C"]) != 1: return False sub2 = s[1] + sub.replace("C", "") + s[-1] if sub2 != sub2.lower(): return False return True ans = "AC" if not isValid(s): ans = "WA" print(ans)
p02639
s280136083
Accepted
import sys def input(): return sys.stdin.readline()[:-1] def main(): A = list(map(int,input().split())) for k in range(5): if A[k] == 0: print(k+1) exit(0) if __name__ == '__main__': main()
p03910
s287148100
Wrong Answer
n = int(input()) num_sum = 0 max_num = 1 for i in range(n): num_sum += i if num_sum >= n: max_num = i break for i in range(1, max_num+1): if i != num_sum - n: print(i)
p02694
s548106104
Accepted
x = int(input()) y = 100 ans = 0 while x > y: y = int(y * 1.01) ans += 1 print(ans)
p02756
s922069026
Wrong Answer
s = input() t = '' q = int(input()) Q = [list(map(str, input().split())) for _ in range(q)] for qi in Q: if int(qi[0]) == 1: s, t = t, s else: if int(qi[1]) == 1: t += qi[2] else: s += qi[2] t[::-1] t += s print(t)
p03795
s570453146
Wrong Answer
import math def total_amount(): N = int(input("Enter number of meals:")) sets = math.ceil(N / 15) discount = sets * 200 print(discount) total_amount()
p02789
s246060964
Wrong Answer
test = input() print(test)
p02787
s393116793
Wrong Answer
H, N = map(int, input().split()) M = dict(iter([tuple(map(int, input().split())) for i in range(N)])) dp = [float('inf') for i in range(H + 1)] dp[0] = 0 for a, b in M.items(): for i in range(H + 1): dp[i] = min(dp[i], dp[max(0, i - a)] + b) print(dp[H])
p02989
s355702807
Accepted
N = int(input()) d = list(map(int, input().split())) d.sort() middle = (N // 2) -1 print(d[middle+1] - d[middle])
p03160
s491383738
Accepted
n = int(input()) h = [int(i) for i in input().split()] INF = float("INF") dp = [INF]*n dp[0] = 0 dp[1] = abs(h[0]-h[1]) for i in range(2,n): dp[i] = min(dp[i-2]+abs(h[i-2]-h[i]),dp[i-1]+abs(h[i-1]-h[i])) print(dp[n-1])
p03274
s054782823
Accepted
n, k = map(int, input().split()) x = list(map(int, input().split())) neg_to_pos = n for i in range(n): if x[i] > 0: neg_to_pos = i break res = 10 ** 14 for i in range(n - k + 1): l = min(x[i], 0) r = max(0, x[i + k - 1]) if i <= neg_to_pos and neg_to_pos - 1 <= i + k - 1: tmp = min(-2 * l + r, -l + 2 * r) res = min(res, tmp) print(res)
p03274
s327715412
Accepted
import sys input = lambda: sys.stdin.readline().rstrip() n, k = map(int, input().split()) x = [int(c) for c in input().split()] ans = 1001001001 for i in range(n - k + 1): xl = x[i] xr = x[i + k - 1] ans = min(ans, min(abs(xl) + abs(xr - xl), abs(xr) + abs(xr - xl))) print(ans)
p02959
s043222911
Accepted
def resolve(): n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) ans = 0 for i in range(n): if a[i] >= b[i]: ans += b[i] else: ans += a[i] b[i] -= a[i] if a[i+1] >= b[i]: ans += b[i] a[i+1] -= b[i] else: ans += a[i+1] a[i+1] = 0 print(ans) return if __name__ == "__main__": resolve()
p03103
s875248874
Accepted
n,m = map(int,input().split()) li = [] for i in range(n): a,b = map(int,input().split()) li.append([a,b]) li = sorted(li) cnt = 0 coin = 0 i = 0 while True: if cnt == m: break if li[i][1]>0: li[i][1]-=1 coin += li[i][0] cnt+=1 else: i += 1 print(coin)
p02658
s873291179
Accepted
def resolve(): import numpy as np from decimal import Decimal n = int(input()) A = np.array(list(map(Decimal, input().split()))) if 0 in A: print(0) return a = Decimal(1) for b in A: a *= b if a > 10**18: print(-1) return print(a) resolve()
p03220
s583355087
Wrong Answer
N = int(input()) T, A = map(int, input().split()) H_li = list(map(int, input().split())) min_abs = 10 ** 9 num = 2000 for i in range(N) : mean_t = T - H_li[i] * 0.006 abs_ha = abs(H_li[i] - mean_t) if abs_ha < min_abs : min_abs = abs_ha num = i + 1 print(num)
p03785
s062816966
Accepted
N,C,K=map(int,input().split()) arrive=[] c=0 for i in range(N): temp=int(input()) arrive.append(temp) arrive.sort() sw=False ans=0 for j in range(N): if sw==False: lim=arrive[j]+K c+=1 sw=True else: c+=1 if j<N-1: if c==C or lim<arrive[j+1]: ans+=1 c=0 sw=False else: ans+=1 print(ans)
p02675
s803732146
Wrong Answer
N=str(input()) a=list(map(int,N)) A=a[-1] if A==3: print("bon") elif A==2 or 4 or 5 or 7 or 9: print("hon") else: print("pon")
p02842
s415031564
Wrong Answer
n = int(input()) if n*100 % 108 == 0: print(int(n/1.08)) else: print(':(')
p03012
s467145289
Wrong Answer
N=int(input()) w=list(map(int, input().split())) S=sum(w) print(S) k=0 ans=10**7 for i in range(N-1): k+=w[i] if abs(S-2*k)<=ans: ans=abs(S-2*k) print(ans) print(ans)
p03962
s669583877
Accepted
a = list(map(int, input().split())) print(len(set(a)))
p02971
s874804314
Wrong Answer
n = int(input()) al = list(int(input()) for _ in range(n)) for i in range(n): if i == 0: print(max(al[i:])) elif i == n-1: print(max(al[:i+1])) else: print(max(max(al[:i]), max(al[i+1:])))
p02963
s113668047
Wrong Answer
s = int(input()) s2 = 2 * s for w in range(2, int(s2**0.5+1)): if s2 % w == 0 and s2 // w <= 10**9: print(0, 0, w, 0, 0, s2 // w) break
p03495
s982091178
Accepted
N, K = map(int, input().split()) A = list(map(int, input().split())) D = {} for a in A: if a not in D: D[a] = 1 else: D[a] += 1 D_list = sorted(D.items(), key=lambda x: x[1]) N = len(D_list) ANS = 0 for t in D_list: if N <= K: break ANS += t[1] N -= 1 print(ANS)
p02773
s366933247
Wrong Answer
n = int(input()) S = [] for _ in range(n): S.append(input()) d = {} for s in S: if s in d: d[s] += 1 else: d[s] = 1 ans = 0 for i in d: if ans < d[i]: ans = d[i] for i in d: if ans == d[i]: print(i)
p04030
s074003846
Accepted
S = input() string = '' for c in S: if c == '0': string = string + '0' elif c == '1': string = string + '1' elif c == 'B': if string == '': pass else: string = string[:-1] print(string)
p02595
s229183774
Accepted
# coding: utf-8 # Your code here! import math def main(): n, d = map(int, input().split()) count = 0 for i in range(n): x, y = map(int, input().split()) distance = math.sqrt(x ** 2 + y ** 2) if distance <= d: count += 1 print(count) main()
p02596
s389112141
Accepted
def main(): k = int(input()) tbl = {} v = int(0) cnt = 0 while True: cnt += 1 v = 10 * v + 7 v = v % k if v == 0: print(cnt) break elif v in tbl.keys(): print('-1') break else: tbl[v] = 0 if __name__ == '__main__': main()
p03998
s196198004
Accepted
a = list(str(input())) b = list(str(input())) c = list(str(input())) from collections import deque a = deque(a) b = deque(b) c = deque(c) t = a.popleft() while True: if t == 'a': if len(a) == 0: print('A') exit() else: t = a.popleft() elif t == 'b': if len(b) == 0: print('B') exit() else: t = b.popleft() else: if len(c) == 0: print('C') exit() else: t = c.popleft()
p02602
s999258934
Accepted
n,k = map(int,input().split()) a = list(map(int,input().split())) for i in range(n): if i>=k: print('Yes' if a[i-k]<a[i] else 'No')
p02600
s442761790
Accepted
x = int(input()) if 400 <= x <= 599: print(8) elif 600 <= x <= 799: print(7) elif 800 <= x <= 999: print(6) elif 1000 <= x <= 1199: print(5) elif 1200 <= x <= 1399: print(4) elif 1400 <= x <= 1599: print(3) elif 1600 <= x <= 1799: print(2) else: print(1)
p03359
s880652520
Accepted
a, b= map(int, input().split()) print(a if b >= a else a-1)
p02882
s210210352
Accepted
import math a, b, x = map(int, input().split()) if 2*x <= a*a*b: y = 2 * x / (a*b) print(math.degrees(math.atan(b/y))) else: y = 2 * (a*a*b - x) / (a*a) print(math.degrees(math.atan(y/a)))
p02615
s893965109
Accepted
n = int(input()) print(sum(sorted([int(x) for x in input().split()] * 2, reverse = True)[1:n]))
p03672
s518964247
Accepted
def check(s): if len(s)%2 == 1: return False if s[len(s)//2:] == s[:len(s)//2]: return True else: return False S = input() for i in reversed(range(1,len(S))): if check(S[:i]): print(i) break
p02817
s700552129
Wrong Answer
a, b = input().split() if a[0] < b[0]: print(a+b) else: print(b+a)
p02882
s212082976
Accepted
import math a,b,x = map(int,input().split()) h=x/(a*a) if h>(b/2): c=(b-h)*2 ans = math.atan2(c,a) else: d=2*a*h/b ans=math.atan2(b,d) print(math.degrees(ans))
p03796
s232695324
Wrong Answer
a=j=1 for i in input():a*=j;a%=10**9+7;j+=1 print(a)
p03705
s889405677
Wrong Answer
import math n,a,b = map(int,input().split()) if a>b: print(0) exit() if n==1 and a!=b: print(0) exit() q = 2*(b-a+1)-1 print(q)
p03069
s021272136
Accepted
n = int(input()) s = input() a = s.count('.') g = [a] b=0 while b<n: if s[b] == '.': a-=1 else: a+=1 g.append(a) b+=1 print(min(g))
p02784
s004643916
Accepted
H,N=map(int,input().split()) A=list(map(int,input().split())) print("Yes" if sum(A)>=H else "No")
p02777
s360342835
Accepted
import itertools import math import fractions import functools s, t = input().split() a, b = map(int,input().split()) u = input() if u == s: print(a-1,b) else: print(a,b-1)
p03328
s917040801
Accepted
def main(): a,b = map(int, input().split()) sum = 0 for height in range(1,1000): sum += height if b-a == height: print(sum-b) break; if __name__ == "__main__": main()
p02690
s164085126
Wrong Answer
n=int(input()) x= list(range(-64, 64, 1)) #print(x) a = 100 b = 100 for i in x: for j in x: if i**5-j**5 == n: print(i, end=" ") print(j) exit()
p02784
s605114116
Wrong Answer
H, N = map(int, input().split()) count = 0 i = 0 arr = list(map(int, input().split()[:N])) attack = H for i in range(N): attack = attack - arr[i] count = count + 1 i = i + 1 if attack <= 0 and count > 1: print("Yes") else: print("No")
p02608
s871173585
Accepted
n = int(input()) xyz = {} for x in range(1, 10**2): for y in range(1, 10**2): for z in range(1, 10**2): num = x**2 + y**2 + z**2 + x*y + y*z + z*x if num in xyz.keys(): xyz[num] += 1 else: xyz[num] = 1 for i in range(1, n + 1): if i in xyz.keys(): print(xyz[i]) else: print(0)
p02603
s102796387
Accepted
input() A=list(map(int,input().split())) M=[0,1000] for i in range(0,len(A)-1): if A[i]>A[i+1]: M[1]+=A[i]*M[0] M[0]=0 elif A[i]<A[i+1]: M[0]+=int(M[1]/A[i]) M[1]=M[1]%A[i] M[1]+=A[i+1]*M[0] M[0]=0 print(M[1])
p03815
s549593738
Accepted
x = int(input()) - 1 time1 = x // 11 X = x % 11 time1 *= 2 if X > 5: time1 += 2 else: time1 += 1 print(time1)
p03107
s236701467
Accepted
S = list(input()) a = 0 b = 0 N = len(S) for i in range(N): if S[i] == '0': a += 1 else: b += 1 m = min(a, b) ans = m*2 print(ans)
p03679
s153361383
Accepted
x,a,b = map(int,input().split()) print("delicious" if a>=b else "safe" if b-a<=x else "dangerous")
p02786
s876473472
Wrong Answer
h = int(input()) ans = 0 for i in range(h): ans += 2 ** i h//= 2 if h == 1: ans += 2 ** (i + 1) print(ans) exit()