problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p02948
s184574645
Accepted
from heapq import heappop,heappush n,m = map(int,input().split()) lst = [[int(i) for i in input().split()] for _ in range(n)] PQ = [] idx = 0 ans = 0 lst.sort(key = lambda x:x[0]) for i in range(1,m+1): while idx < n and lst[idx][0] <= i: heappush(PQ,-(lst[idx][1])) idx += 1 if PQ: ans -= heappo...
p03779
s422151631
Accepted
from math import ceil x = int(input()) ans = ceil(((1+8*x)**.5 -1)/2) print(ans)
p03971
s676414517
Accepted
N, A, B = map(int, input().split()) S = input() a, b = 0, 0 for s in S: if s == "a": if a+b < A+B: a += 1 print("Yes") else: print("No") elif s == "b": if a+b < A+B and b < B: b += 1 print("Yes") else: print(...
p02801
s127940725
Wrong Answer
#A - Next Alphabet A = str(input()) print(chr(ord('a') + 1))
p02780
s284597693
Wrong Answer
n, k = map(int, input().split()) p = list(map(int, input().split())) total = sum(p[:k]) ans = total print(ans) for i in range(n-k): total -= p[i] total += p[i+k] ans = max(total,ans) print(ans) print((ans+k)/2)
p03289
s307563820
Wrong Answer
import sys s = list(input()) if s[0] == 'A' and s[2] == 'C': del s[2] del s[0] s = ''.join(s) if s.islower(): print("AC") sys.exit() print("WA")
p02598
s670539505
Accepted
import sys input=sys.stdin.readline n,k=map(int,input().split()) l=list(map(int,input().split())) ok=max(l) ng=0 def solve(m): s=0 for i in l: s+=-((-i)//m)-1 return s while ok-ng>1: m=(ok+ng)//2 if k<solve(m): ng=m else: ok=m print(ok)
p02646
s756608533
Accepted
[A,V] = list(map(int,input().split())) [B,W] = list(map(int,input().split())) T = int(input()) if A<B: if A+V*T >= B+W*T: out='YES' else: out='NO' else: if B-W*T >= A-V*T: out='YES' else: out='NO' print(out)
p02795
s088498910
Accepted
H = int(input()) W = int(input()) N = int(input()) #行をa回、列をb回選んで操作した場合 #塗られるマスの数は(H *a + W *b - a * b) A = list(range(H+1)) B = list(range(W+1)) AB = [[a, b] for a in A for b in B] ANS = [] for ab in AB: a = ab[0] b = ab[1] SUM = H * a + W * b - a * b if N <= SUM: sum_N = a + b ANS.append(sum_N) ANS...
p03665
s700006927
Wrong Answer
import math N,P = map(int,input().split()) A = list(map(int,input().split())) odd = [] even = [] ans = 0 for i in A: if (i % 2 == 1): odd.append(i) else: even.append(i) def combinations_count(n, r): return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) if (P == 0): l_odd = len(o...
p03472
s136096945
Accepted
#!/usr/bin/env python3 n, h, *A = map(int, open(0).read().split()) a = max(A[::2]) b = sorted(A[1::2])[::-1] for i in range(n): if h <= 0: print(i) exit() if b[i] < a: print(i - (-h // a)) exit() h -= b[i] print(n - (-h // a))
p02582
s280962564
Accepted
import sys input = sys.stdin.readline def main(): S = input().rstrip() if "RRR" in S: ans = 3 elif "RR" in S: ans = 2 elif "R" in S: ans = 1 else: ans = 0 print(ans) if __name__ == "__main__": main()
p02584
s412033736
Wrong Answer
X, K, D = map(int, input().split()) d, r = divmod(X, D) if K > d: if (K - d) % 2 == 0: print(min(r, abs(X - D*K))) else: print(min(abs(r - D), abs(X - D*K))) else: print(abs(X - D*K))
p03723
s595005738
Accepted
a, b, c = map(int, input().split()) t = 0 if a == b == c: if a % 2 == 1: print(t) else: print(-1) else: while (a % 2 + b % 2 + c % 2) == 0: a, b, c = (b + c) / 2, (a + c) / 2, (a + b) / 2 t += 1 print(t)
p02696
s232411303
Accepted
a,b,n = list(map(int,input().split())) def floor(x): return int(a*x/b) - a*int(x/b) x = min(b-1,n) print(floor(x))
p02792
s461929704
Accepted
n=int(input()) l=[[0 for i in range(10)]for s in range(10)] for i in range(n+1): if i%10: l[int(str(i)[0])-1][int(str(i)[-1])-1]+=1 ans=0 for i in range(9): for j in range(9): ans+=l[i][j]*l[j][i] print(ans)
p03672
s829597702
Accepted
s=input() while len(s)>0: s=s[:-2] a=len(s) if s[:(a//2)]*2==s: print(a) exit()
p02775
s207573061
Wrong Answer
n = str(input()) ans = 0 count = 0 for i in range(len(n)): if int(n[i]) <= 5: ans += int(n[i]) else: ans += 10 - int(n[i]) + 1 if i != 0 and i != 1: count += 1 print(ans-count)
p03293
s606300185
Accepted
S = input() T = input() for i in range(len(S)): S = S[-1] + S[:-1] if S == T: print("Yes") exit() print("No")
p02775
s006265539
Accepted
n = input() a, b = 0, 100 for i in n: j = int(i) a, b = min(a+j,b+j), min(a+11-j,b+9-j) if j == 0: b = a+100 print(min(a,b))
p02552
s267746642
Wrong Answer
MOD = 1000000007 def fpow(x, n): e = 1 while n > 1: if n & 1: e = (e*x) % MOD x = (x*x) % MOD n >>=1 return (x*e)%MOD N = int(input()) print((fpow(10, N) - 2*fpow(9, N) + fpow(8, N))%MOD)
p02622
s131095907
Accepted
S = input() T = input() count = 0 for i in range(len(S)): if S[i] != T[i]: count += 1 print(count)
p02705
s415492727
Wrong Answer
print(3.141*int(input()))
p02916
s721610737
Wrong Answer
def buffet(n, ali, bli, cli): ans = 0 count = 0 for i in range(n): ans += bli[ali[i]-1] if ali[i] == count+1: ans += cli[count-1] count = ali[i] return ans def main(): n = int(input()) ali = list(map(int, input().split())) bli = list(map(int, input().s...
p02594
s284840402
Wrong Answer
if int(input()) == 30: print("Yes") else: print("No")
p04044
s768030321
Wrong Answer
a = input() b = [] for i in range(int(a[0])): b.append(input()) b.sort() for j in b: print(j, end = "")
p02663
s919482062
Accepted
hw,mw,hs,ms,k=map(int,input().split()) waking=(hs*60+ms)-(hw*60+mw)-k print(max(0,waking))
p02576
s992716364
Accepted
from math import ceil # print('input >>') N, X, T = map(int,(input().split())) # print('-----output-----') print(ceil(N / X) * T)
p02772
s444241646
Wrong Answer
n = int((input())) a = list(map(int, input().split())) f = False for i in a: if i % 2 == 0: if i % 3 == 0 or i % 5 == 0: f = True else: f = False break if f: print("APPROVED") else: print("DENIED")
p02880
s026248969
Accepted
n = int(input()) for i in range(1, 10): if n % i == 0: if n // i < 10: print('Yes') exit() print('No')
p03745
s209755580
Accepted
n = int(input()) a_input = list(map(int,input().split())) #左から単調非増加、単調非減少を試して行って長いほうを採用すればよいO(N) #値の増減の反転するポイントを探索する ans=1 tmp=0 for i in range(1,n): if (a_input[i]-a_input[i-1])*tmp<0: ans+=1 tmp=0 elif a_input[i]-a_input[i-1]!=0: tmp=a_input[i]-a_input[i-1] print(ans)
p02897
s829465524
Accepted
n = int(input()) print( ( (n + 1) // 2) / n )
p03061
s593066873
Wrong Answer
from fractions import * n,*a=map(int,open(0).read().split()) l=[0]+[a[0]]*(n-1) r=[a[-1]]*(n-1)+[0] ans=0 for i in range(2,n): l[i]=gcd(l[i-1],a[i]) for i in range(n-3,-1,-1): r[i]=gcd(r[i+1],a[i+1]) for i in range(n): ans=max([0,l[i],r[i],gcd(l[i],r[i])][(l[i]>0)+2*(r[i]>0)],ans) print(ans)
p02695
s413716791
Accepted
import itertools n,m,q=map(int,input().split()) Q=[] for i in range(q): Q.append(list(map(int,input().split()))) ans=0 l=[i+1 for i in range(m)] for i in itertools.combinations_with_replacement(l,n): temp=0 for j in range(q): if i[Q[j][1]-1]-i[Q[j][0]-1]==Q[j][2]: temp+=Q[j][3] ans=...
p02791
s087061895
Accepted
N = int(input()) P = list(map(int, input().split())) mn = N + 1 ans = 0 for p in P: if p < mn: ans += 1 mn = min(mn, p) print(ans)
p03241
s944587020
Accepted
def main(): N, M = list(map(int, input().split(' '))) n = 1 ans = 1 while n**2 <= M: if M % n == 0: if n * N <= M: ans = max([ans, n]) m = M // n if m * N <= M: ans = max([ans, m]) n += 1 print(ans) if __name__ == ...
p03293
s452181271
Wrong Answer
S = input() T = input() L = len(S) St = [] Tr = [] ans = 'no' for i in range(L-1): St.append(S[i:i+1]) Tr.append(S[i:i+1]) for i in range(L): if St == Tr: ans = 'yes' else: St.insert(0,St[L-1]) St.remove(St[L-1]) print(ans)
p02759
s338982047
Accepted
n = int(input()) print(int(n/2)+n%2)
p02897
s759203876
Accepted
N=int(input()) print(1 - ((N // 2) / N))
p02888
s714373617
Accepted
import bisect n=int(input()) a=list(map(int,input().split())) a=sorted(a) ans=0 for i in range(n-2): for j in range(i+1,n-1): tmp=a[i]+a[j] index=bisect.bisect_left(a,tmp) ans+=index-j-1 print(ans)
p03252
s411959307
Wrong Answer
from collections import defaultdict S = input() T = input() d = defaultdict(str) ans = 'Yes' for s, t in zip(S, T): if s != t: if d[s] == t and d[t] == s: continue if d[s] == '' and d[t] == '': d[s] = t d[t] = s else: ans = 'No' bre...
p03035
s122018883
Accepted
n,m = map(int,input().split()) if n>12: print(m) elif n>5: print(m//2) else: print(0)
p03061
s947520806
Accepted
from fractions import gcd n = int(input()) ns = list(map(int, input().split())) l = [0] r = [0] for i in range(n-1): l += [gcd(l[i], ns[i])] r += [gcd(r[i], ns[-i-1])] print(max(gcd(l[i], r[-i-1]) for i in range(n)))
p03386
s881309124
Accepted
a, b, k = map(int, input().split()) print_max = 0 for i in range(a, a + k): if a <= i <= b: print(i) print_max = i for i in range(b - k + 1, b + 1): if print_max < i <= b: print(i)
p03220
s191561060
Accepted
import numpy as np N = int(input()) T, A = map(int, input().split()) H = np.array(list(map(int, input().split()))) H = np.abs(T - H * 0.006 - A) print(H.argmin()+1)
p03013
s153792115
Wrong Answer
n,m = map(int, input().split()) A = [int(input()) for i in range(m)] if m == 0: Fib = [1,2] for i in range(2,n): Fib.append(Fib[i-2]+Fib[i-1]) print(Fib) print(Fib[n-1]) exit() B = [A[i+1]- A[i] for i in range(m-1)] B.insert(0,A[0]+1) B.append(n+1-A[m-1]) M = max(A) Fib = [0,1] for i in range(2,M+10): ...
p02718
s861048704
Wrong Answer
n,m = map(int, input().split()) A = list(map(int,input().split())) min_limit = 1 / (4*m) select_ok = 0 for i in A: if i >= min_limit: select_ok += 1 if select_ok >= m: print("Yes") else: print("No")
p03329
s233719982
Accepted
n=int(input()) dp=[float('inf')]*(n+1) dp[0]=0 for i in range(1,n+1): power=1 while(power<=i): dp[i]=min(dp[i],dp[i-power]+1) power*=6 power=1 while(power<=i): dp[i]=min(dp[i],dp[i-power]+1) power*=9 print(dp[n])
p02713
s708238489
Accepted
#設定 import sys input = sys.stdin.buffer.readline #ライブラリインポート from collections import defaultdict from fractions import gcd con = 10 ** 9 + 7 #入力受け取り def getlist(): return list(map(int, input().split())) #処理内容 def main(): K = int(input()) ans = 0 D = defaultdict(int) for i in range(1, K + 1): for j in range(1,...
p03487
s737748031
Accepted
#import numpy as np n = int(input()) a = list(map(int,input().split())) base = [0]*n ans = 0 for i in range(n): if a[i] > n: ans += 1 else: base[a[i]-1] += 1 for i in range(n): if base[i] == 0: continue elif base[i] == i+1: continue elif (base[i] < i+1) and (0 < base[i]): ans += base...
p03627
s723457843
Wrong Answer
n = int(input()) a_list = list(map(int, input().split())) a_list.sort(reverse=True) a_set = list(set(a_list)) a_set.sort(reverse=True) candidate = [] for i in a_set: if a_list.count(i) >= 2: candidate.append(i) if len(candidate) == 2: print(candidate[0] * candidate[1]) exit() print(0)
p02683
s261097702
Wrong Answer
import itertools n, m, x = map(int, input().split()) a_list = [] for i in range(n): targets = list(map(int, input().split())) a_list.append(targets) r_list = [] for i, _ in enumerate(a_list, 1): for j in itertools.combinations(a_list, r=i): targets = [0] * (m+1) for t in j: k = 0 for target in t: ...
p02697
s657060691
Wrong Answer
n, m = map(int, input().split()) mod = lambda x:x%n+1 for i in range((m+1)//2): print(mod(-i), mod(i+1)) for i in range(m//2): print(mod(-i+(m+1)//2+1), mod(i+2+(m+1)//2+1))
p02618
s190444738
Wrong Answer
D=int(input()) c=list(map(int,input().split())) s=[] t=[] v=0 lastday=[0 for i in range(26)] for i in range(D): tmp=list(map(int,input().split())) s.append(tmp) for i in range(D): print((D-i)%26)
p02708
s456768987
Wrong Answer
N, K = map(int, input().split()) MOD = 10**9 + 7 nac = [0] * (N + 2) ninv = [0] * (N + 2) inv = [0] * (N + 2) nac[0],nac[1] = 1,1 inv[1] = 1 ninv[0],ninv[1] = 1,1 N = N + 1 for i in range(2, N + 1): nac[i] = (nac[i-1] * i % MOD) inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD ninv[i] = int(ninv[i - 1] * inv[i] ...
p02994
s863513975
Wrong Answer
import sys import math import bisect stdin = sys.stdin mod = 10**9 + 7 ns = lambda: stdin.readline().rstrip() ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)] n, l = na() if l > 0: print((l+1 + l+n-1) * (n-1) /...
p02995
s049365987
Accepted
A,B,C,D=map(int,input().split()) import fractions lcm=C*D//fractions.gcd(C,D) c=B // C - (A-1)//C d=B//D - (A-1)//D cd=B//lcm - (A-1)//lcm print(B-A+1 - (c+d-cd))
p03210
s302102367
Wrong Answer
x = input() if x in "753": print("Yes") else: print("No")
p03799
s640369291
Wrong Answer
N, M = map(int, input().split()) def main(N, M): if N //2 <= M: print(int(N + (M - (N*2))//4)) else: print(int(N//2)) if __name__ == '__main__': main(N, M)
p02772
s111485104
Accepted
num = int(input()) num_list = list(map(int,input().split())) sign = 0 for i in range(0,num): if num_list[i]%2 == 0: if not (num_list[i]%3 == 0 or num_list[i]%5 == 0): sign = 1 if sign == 0: ans = "APPROVED" elif sign == 1: ans = "DENIED" print(ans)
p03150
s424160709
Wrong Answer
S = input() s = "keyence" flag = False ans = "NO" for i in range(len(S)): if s[:i] in S: s1 = s[:i] s2 = s[i:] flag = True if flag: for i in range(len(S)-len(s1)): if s1 == S[i:i+len(s1)]: if s2 in S[i+len(s1):]: ans = "YES" break print(ans)
p03211
s940385137
Accepted
s=input() n=len(s) ans=100000 for i in range(n-2): t=str(s[i])+str(s[i+1])+str(s[i+2]) x=abs(753-int(t)) ans=min(ans,x) print(ans)
p03699
s578513483
Accepted
n = int(input()) a = [int(input()) for i in range(n)] not10 = [i for i in a if i % 10 != 0] a10 = [i for i in a if i % 10 == 0] maxn10 = sum(not10) if maxn10 % 10 == 0 and maxn10: maxn10 -= min(not10) ans = maxn10 + sum(a10) print(0) if ans % 10 == 0 else print(ans)
p03162
s959930849
Accepted
def c(): n = int(input()) arr = [] for _ in range(n): line = list(map(int, input().split() )) arr.append(line) dp = [[0 for _ in range(3)] for _ in range(n)] for i in range(n): for j in range(3): if i == 0: dp [i][j] = arr[i][j] e...
p02553
s423301717
Wrong Answer
a,b,c,d=map(int,input().split( )) print(b*d)
p03211
s257530177
Wrong Answer
S = input() minimum=653 for i in range(len(S)-2): number=abs(int(S[i:i+3])-753) print(S[i:i+3]) minimum = min(minimum, number) print(minimum)
p03274
s808297455
Wrong Answer
N, K = map(int, input().split()) X = list(map(int, input().split())) max = 10000000000000000000000000 for i in range(N - K + 1): # i = 0 t = abs(X[i]) t += X[i + K - 1] - X[i] if t < max: max = t print(max)
p03264
s446920461
Accepted
#copy a = int(input()) print(a // 2 * (a - a // 2))
p02761
s823490961
Accepted
import sys input = sys.stdin.readline N, M = [int(x) for x in input().split()] ans = ["0"] * N sc = [] for _ in range(M): tmp = [int(x) for x in input().split()] sc.append(tmp) for i in range(1000): flag = 1 i = str(i) if len(i) != N: continue for j in sc: if i[j[0] - 1] != str(...
p02556
s956873045
Accepted
n = int(input()) x = [] y = [] z = [] for i in range(n): a,b = map(int, input().split()) x.append(a+b) y.append(a-b) z.append(b-a) print(max(max(x) - min(x),max(y) - min(y),max(z) - min(z)))
p03150
s683509922
Wrong Answer
def resolve(): S = input() if S == "kesence": print("YES") else: for i in range(len(S)): for j in range(i+1, len(S)): if S[:i+1]+S[j:] == S: print("YES") exit() print("NO") resolve()
p03774
s627595941
Accepted
n,m=map(int,input().split()) a=[list(map(int,input().split())) for a in range(n)] c=[list(map(int,input().split())) for b in range(m)] dist=0 minnum=0 for indi,i in enumerate(a): min=10**10 minnum=0 for indj,j in enumerate(c): dist=0 dist+=abs(i[0]-j[0]) dist+=abs(i[1]-j[1]) ...
p02881
s231469102
Accepted
N=int(input()) ans=10**13 from math import sqrt for i in range(1, int(sqrt(N))+1): if N%i==0: temp=(i-1)+(N//i-1) if temp<ans: ans=temp print(ans)
p03835
s330925308
Accepted
input_str = input().split() k = int(input_str[0]) s = int(input_str[1]) count = 0 for x in range(k+1): for y in range(k+1): if x+y <= s: z = s-(x+y) if z <= k: count += 1 print(count)
p03059
s771636932
Accepted
a, b, t = list(map(int, input().split())) print((t//a)*b)
p03338
s840431065
Accepted
import sys import numpy as np input = sys.stdin.readline N = int(input()) S = list(input()) S = S[:-1] temp = [] for i in range(1,N): a = S[:i] b = S[i:] a = list(set(a)) b = list(set(b)) j = list(set(a+b)) temp.append(len(a) + len(b) - len(j)) print(max(temp))
p04034
s534507949
Accepted
N, M = map(int, input().split()) possibility = [False] * N # True: 赤いボールが入っている可能性がある possibility[0] = True balls = [1] * N # 箱に入っているボールの数 for i in range(M): x, y = map(int, input().split()) x -= 1 y -= 1 if possibility[x]: possibility[y] = True balls[x] -= 1 balls[y] += 1 if balls[...
p02615
s868218385
Accepted
import numpy as np n = int(input()) ajs_str = input().split() ajs = [int(aj) for aj in ajs_str] ajs_sorted = np.sort(ajs)[::-1] score = ajs_sorted[0] count = 1 current_idx = 1 max_idx = int( (n-2) / 2 ) for idx in range(1, 1+max_idx): score += 2 * ajs_sorted[idx] if (n-2) % 2 != 0: score += ajs_sorted[1+max...
p03434
s185667548
Accepted
#n , m , l = map(int , input().split()) # list_n = list(map(int , inpuut().split()))<Paste> #n = input() # list = [input() for i in range(N) #list = [[i for i in range(N)] for _ in range(M)] N = int(input()) list_A = list(map(int, input().split())) list_A.sort(reverse=True) print(sum(list_A[0::2]) - sum(list_A[1:...
p02771
s293041790
Accepted
l = list(map(int, input().split())) A = l[0] B = l[1] C = l[2] if(A == B): if(A != C): print("Yes") else: print("No") else: if(A != C): if(B == C): print("Yes") else: print("No") else: print("Yes")
p02628
s239675550
Accepted
n, k = map(int, input().split()) p = list(map(int, input().split())) l = sorted(p) sum = 0 for i in range(k): sum += l[i] print(sum)
p04030
s147662131
Wrong Answer
s = input() x = '' for i in s: if i == 'B': x += i else: x = x[:-1] print(x)
p02888
s599592250
Wrong Answer
import sys input = sys.stdin.readline N=int(input()) L=list(map(int,input().split())) L.sort() ans=0 for i in range(N-2): mid =i+1 l=0 r=i+2 while l<mid-1 or r<N-1: if L[r]-L[l]<L[mid]: ans+=1 if r==N-1: l+=1 else: r+=1 else: l+=1 if L[r]-L[l]<L[mid]: ans+=1 print(ans)
p03705
s297433592
Accepted
N,A,B=map(int,input().split()) if N>=2: if A<=B: print(B*(N-1)+A-(A*(N-1)+B)+1) else: print(0) else: if A==B: print(1) else: print(0)
p02756
s367402065
Accepted
from collections import deque s = deque(input()) q = int(input()) is_reversed = False for i in range(q): query = input().split() if query[0] == '1': is_reversed = not is_reversed elif (query[1] == '2') ^ is_reversed: s.append(query[2]) else: s.appendleft(query[2]) if is_reversed...
p03351
s925310121
Accepted
a,b,c,d = map(int,input().split()) if abs(c-a)<=d or (abs(a-b)<=d and abs(c-b)<=d): print('Yes') else: print('No')
p02578
s057265209
Wrong Answer
N = int(input()) A = list(map(int, input().split())) ans = 0 for i in range(N - 1): ans += max(0, A[i - 1] - A[i]) A[i] += max(0, A[i - 1] - A[i]) print(ans)
p02700
s129135514
Wrong Answer
A,B,C,D = map(int, input().split()) if A+B > D+C: print("Yes") else: print("No")
p02811
s181158708
Accepted
s = input() x,a = [int(ele) for ele in s.split(' ')] if x*500 >= a: print("Yes") else: print("No")
p03385
s065277335
Accepted
A=input() print("Yes" if "".join(sorted(A))=="abc" else "No")
p02687
s350027881
Accepted
st=input() print("ABC" if st=="ARC" else "ARC")
p02957
s310728184
Accepted
# from math import ceil,sqrt,log,gcd,pi # def ii():return int(input()) # def si():return input() # def mi():return map(int,input().split()) # def li():return list(mi()) # for _ in range(ii()): a,b=map(int,input().split()) s=(a+b) if(s==0 or s%2): print("IMPOSSIBLE") else: x=0 if(s!=0): x=abs(s)//2 ...
p03261
s058602223
Accepted
n = int(input()) words = [input() for _ in range(n)] use = [words[0]] for i in range(1, n): if words[i] in use: print('No') exit() if use[-1][-1] != words[i][0]: print('No') exit() use.append(words[i]) print('Yes')
p02578
s708587049
Wrong Answer
n = input() l = [int(i) for i in input().split()] max = 0 sum = 0 print(l) for i in range(1,len(l)): if l[i-1] > max: max = l[i-1] if l[i] < max: sum += max - l[i] print(sum)
p03286
s429098502
Accepted
N = int(input()) if N == 0: print(0) exit() ans = '' while N != 0: if N % 2: ans += '1' N -= 1 else: ans += '0' N //= -2 print(ans[::-1])
p02951
s415487701
Accepted
A, B, C = map(int, input().split()) print(C-(A-B) if C-(A-B)>0 else 0)
p03605
s992323529
Accepted
n = input() if n[0]=='9' or n[1]=='9':print("Yes") else:print("No")
p02659
s262033633
Accepted
a, b = input().split() a_1 = int(a) b_1 = int(b[0])*100 b_10 = int(b[2])*10 b_100 = int(b[3]) ans = a_1 * b_1 ans += (a_1 * b_10) ans += (a_1 * b_100) print(ans//100)
p03077
s215875278
Wrong Answer
n = int(input()) traffics = [] for _ in range(5): traffics.append(int(input())) for i in range(len(traffics)-1): if traffics[i] < traffics[i+1]: traffics[i+1] = traffics[i] print(5+n//traffics[-1])
p03854
s144718264
Wrong Answer
s=input() s=s.replace("eraser","") s=s.replace("dreamer","") s=s.replace("dream","") s=s.replace("erase","") # print(s) if s=="": print("YES") else : print("NO")