problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03013
s324162501
Accepted
n,m = map(int, input().split()) a=[] for _ in range(m): a.append(int(input())) for i in range(m-1): if a[i] + 1 == a[i+1]: print(0) exit() dp=[0]*(n+1) dp[0]=1 for i in range(1,n+1): if len(a)!=0 and i == a[0]: dp[i]=0 a.pop(0) continue dp[i]=dp[i-1]+dp[i-2] dp[i] = dp[i] % (10**9+7) print(dp[n] % (10**9+7))
p02778
s458853670
Accepted
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) s = input() print('x' * len(s))
p03239
s987595841
Accepted
n,T=map(int,input().split()) a=9999 for i in range(n): c,t=map(int,input().split()) if t<=T:a=min(a,c) print(a if a<9999 else 'TLE')
p03077
s792832223
Accepted
import math n = int(input()) Min = 10000000000000000 for _ in range(5): Min = min(int(input()),Min) ans = 4 ans += math.ceil(n/Min) print(ans)
p03951
s960309265
Accepted
import sys input = sys.stdin.readline def main(): N = int(input()) S = input().rstrip() T = input().rstrip() #N,A,B = map(int,input().split()) for i in range(N): if S[i:]==T[:N-i]: res = N+i break else: res = 2*N print(res) main()
p04019
s455221521
Accepted
import sys s = input() if 'N' in s: if 'S' not in s: print('No') sys.exit() if 'W' in s: if 'E' not in s: print('No') sys.exit() if 'E' in s: if 'W' not in s: print('No') sys.exit() if 'S' in s: if 'N' not in s: print('No') sys.exit() print('Yes')
p03705
s865229641
Accepted
n, a, b = map(int, input().split()) if a > b: print(0) elif a == b: print(1) elif n == 1: print(0) else: print((n - 2) * (b - a) + 1)
p02792
s482323481
Wrong Answer
n=int(input()) def side(n): list_n=list(str(n)) start=int(list_n[0]) end=int(list_n[-1]) return [start,end] def count_n(i,j): s=0 for i in range(1,n+1): if side(i)==[i,j]: s+=1 return s ans=0 for i in range(0,9): for j in range(0,9): ans+=count_n(i,j)*count_n(j,i) print(ans)
p03804
s490491989
Wrong Answer
def resolve(): n, m = map(int, input().split()) A = [] B = [] ans = False for _ in range(n): A.append(list(input())) for _ in range(m): B.append(list(input())) for i in range(n): for j in range(n): if i + m > n or j + m > n: continue tmp_ans = True for k in range(m): for l in range(m): if A[i+k][j+l] != B[k][l]: tmp_ans = False break ans = tmp_ans if ans: print('Yes') else: print('No') resolve()
p03281
s672417612
Accepted
N = int(input()) res = 0 for i in range(1, N+1): count = 0 for j in range(1, i+1): if i % j == 0: count += 1 if count == 8 and i % 2 != 0: res += 1 print(res)
p02595
s518110547
Accepted
N, D = map(int, input().split()) ans = 0 for _ in range(N): x, y = map(int, input().split()) if x ** 2 + y ** 2 <= D ** 2: ans += 1 print(ans)
p02695
s266852917
Accepted
from itertools import combinations_with_replacement N, M, Q = map(int, input().split()) input_lst = [list(map(int, input().split())) for _ in range(Q)] max_score = 0 for pattern in combinations_with_replacement(range(1, M + 1), N): score = 0 for row in input_lst: a, b, c, d = row if pattern[b - 1] - pattern[a - 1] == c: score += d if score > max_score: max_score = score print(max_score)
p03994
s243182315
Wrong Answer
s = input() k = int(input()) ans = '' for i,v in enumerate(s): if k <= 0: break if ord('z') - ord(v) + 1 <= k: k -= ord('z') - ord(v) + 1 ans += 'a' else: ans += v k %= 26 last = chr(ord('a')+(ord(ans[-1])-ord('a')+k)%26) print(ans[:-1]+last)
p03680
s954457682
Accepted
n=int(input()) l=[0]+[int(input())for i in range(n)] now=1 for i in range(n+5): now=l[now] if now==2:print(i+1);break else:print(-1)
p02613
s925851739
Wrong Answer
N = int(input()) S = [input() for i in range(N)] ac = 0 wa = 0 tle = 0 re = 0 for s in S: if s == 'AC': ac += 1 elif s == 'WA': wa += 1 elif s == 'TLE': tle += 1 elif s == 'RE': re += 1 print('AC x ' + str(ac)) print('WA x ' + str(wa)) print('TLE x ' + str(tle)) print('RE × ' + str(re))
p03109
s763708589
Accepted
S = input() print("Heisei" if S <= "2019/04/30" else "TBD")
p02765
s540923286
Wrong Answer
n, r = map(int, input().split()) if n < 10: print(100 * (10 - n)) else: print(r)
p03438
s889214273
Accepted
n = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) need1 = 0 need2 = 0 for i in range(n): s = B[i]-A[i] if s < 0: need1 -= s else: need2 += s//2 if need1 > need2: print("No") else: print("Yes")
p03126
s225998949
Accepted
n, m = map(int, input().split()) l = [0] * m for i in range(n): a = list(map(int, input().split())) k = a[0] for j in range(k): l[a[j + 1] - 1] += 1 ans = 0 for i in l: if i == n: ans += 1 print(ans)
p03773
s844363087
Accepted
import sys import itertools sys.setrecursionlimit(1000000000) from heapq import heapify,heappop,heappush,heappushpop import math import collections MOD = 10**9 + 7 a,b = map(int,input().split()) if a + b>=24: print(a+b-24) else: print(a + b)
p02730
s566366117
Accepted
s = list(input()) n = len(s); flag= 0 if s == s[::-1]: flag += 1 ; start, end = 0, ((n-1)//2)-1 while(end > start and flag == 1): if not(s[start] == s[end]): break; start += 1 ; end -= 1 else: flag += 1 start, end = (n+3)//2 -1, (n-1) while(end > start and flag == 2): if not(s[start] == s[end]): break; start += 1 ; end -= 1 else: flag += 1 print('Yes' if flag == 3 else 'No')
p02881
s975054790
Accepted
n=int(input()) num=int(n**0.5) ans=float('inf') for i in range(1,num+1): if n%i==0: temp=n//i+i-2 if ans>temp:ans=temp print(ans)
p02811
s588694646
Wrong Answer
K,N = map(int, input().split()) if 500*K >= N: print("yes") else: print("no")
p03785
s403467366
Wrong Answer
n, c, k = map(int, input().split()) T = [0]*n for i in range(n): T[i] = int(input()) T.sort() T = [0]+T mx = 0 jk = 0 ans = 0 for i in range(1, n+1): mx += T[i]-T[i-1] jk += 1 if jk>=c: ans += 1 jk = 0 if mx>k: ans += 1 mx = 0 jk = 0 print(ans if jk==0 else ans+1)
p02687
s050479040
Accepted
S = input() if S == 'ABC': print('ARC') else: print('ABC')
p03328
s439960390
Wrong Answer
a,b=map(int,input().split()) n=b-a m=n*(n+1)/2 print(b-m)
p03475
s527937503
Accepted
import sys input = sys.stdin.buffer.readline sys.setrecursionlimit(10 ** 7) N = int(input()) CSF = tuple(tuple(map(int, input().split())) for _ in range(N - 1)) ans = [0] * N for i in range(N): time = 0 for j in range(i, N - 1): c, s, f = CSF[j] d = max(0, time - s) ride = (d + f - 1) // f time = s + ride * f + c ans[i] = time print(*ans, sep="\n")
p02900
s179574393
Accepted
# 素因数分解 def prime_factorize(n): a = [] while n % 2 == 0: a.append(2) n //= 2 f = 3 while f * f <= n: if n % f == 0: a.append(f) n //= f else: f += 2 if n != 1: a.append(n) return a a, b = map(int,input().split()) aa = prime_factorize(a) bb = prime_factorize(b) ab = list(set(aa) & set(bb)) ab.sort() print(len(ab)+1)
p02988
s634794731
Wrong Answer
ans = 0 n = int(input()) a = list(map(int, input().split())) for i in range(1,n-1): if a[i-1] < a[i] < a[i+1]: ans += 1 print(ans)
p03548
s403880863
Accepted
x,y,z = list(map(int,input().split())) x -= z print(x//(y+z))
p02691
s382492294
Wrong Answer
import collections N = int(input()) A = list(map(int,input().split())) #index,h pp =[] pm = [] all_set = set() for i in range(N): pp.append(i + A[i]) pm.append( i - A[i]) count = 0 c = collections.Counter(pp) print(c) for i in range(N): count += c[pm[i]] print(c[pm[i]]) #count += pp.count(pm[i]) #count += pm.count(pp[i]) print(count)
p03821
s175529579
Accepted
n = int(input()) A = [] B = [] for i in range(n): a, b = map(int, input().split()) A.append(a) B.append(b) A.reverse() B.reverse() c = 0 for i in range(n): A[i] += c if A[i] % B[i] != 0: c += (B[i] - A[i] % B[i]) A[i] += c print(c)
p02695
s742104681
Wrong Answer
N,M,Q = map(int, input().split()) abcd = [list(map(int, input().split())) for _ in range(Q)] max = 0 a = ['1']*N b = [str(M)]*N a = int(''.join(a)) b = int(''.join(b)) for x in range(a,b+1): x=str(x) tmp_sum=0 for i in range(Q): if int(x[abcd[i][1]-1])-int(x[abcd[i][0]-1])==abcd[i][2]: tmp_sum+=abcd[i][3] if max<tmp_sum: max=tmp_sum print(max)
p02756
s224626240
Wrong Answer
S=input() Q=int(input()) query=[list(map(str,input().split())) for _ in range(Q)] ans=[S] for q in query: if len(q)==1: ans=ans[::-1] else: _,f,c=q if f=='1': ans.insert(0,c) else: ans.append(c) print(*ans,sep='')
p03261
s905123298
Accepted
n = int(input()) s = [] for _ in range(n): s.append(input()) it = iter(s) for p, ne in zip(it, it): if p[-1] != ne[0]: print("No") exit() if s[-2][-1] != s[-1][0]: print("No") exit() if len(set(s)) == n: print("Yes") else: print("No")
p03329
s051256819
Accepted
# BFS from collections import deque N=int(input()) dp = [-1] * 200005; q = deque() g = [1] a = 6 while a <= 100000: g.append(a) a *= 6 a = 9 while a <= 100000: g.append(a) a *= 9 g.sort(reverse=True) dp[0] = 0 q.append(0) while len(q) > 0: v = q.popleft() if v == N: break for j in g: if dp[v+j] != -1: continue if v+j > N: continue dp[v+j] = dp[v] + 1 q.append(v+j) print(dp[N])
p03282
s305720441
Accepted
S = input() K = int(input()) ans = 0 for i in range(K): if S[i]!="1": ans = S[i] break print(1) if ans==0 else print(ans)
p03565
s981834907
Wrong Answer
s = list(input()) t = list(input()) n = len(s) m = len(t) tp = 0 for i in range(n): if s[i] == t[tp] or s[i] == '?': tp += 1 else: tp = 0 if tp == m: s[i-m+1: i+1] = t s = ['a' if v == '?' else v for v in s] print("".join(s)) exit() print("UNRESTORABLE")
p03284
s805408902
Accepted
N, K = map(int, input().split()) import math print(math.ceil(N / K) - (N // K))
p03711
s624916050
Accepted
x, y = map(int, input().split()) X, Y = 0, 0 l = [4, 6, 9, 11] if x == 2: X = 3 elif x in l: X = 2 else: X = 1 if y == 2: Y = 3 elif y in l: Y = 2 else: Y = 1 if X == Y: print("Yes") else: print("No")
p02832
s714664795
Accepted
n = int(input()) a = list(map(int, input().split())) ans = 0 if 1 not in a: ans = -1 else: k = 1 for i in range(n): if a[i] == k: k += 1 else: ans += 1 print(ans)
p02791
s223477596
Accepted
n = int(input()) p = list(map(int, input().split())) min = 10**6 ans = 0 for i in range(n): if p[i] <= min: min = p[i] ans += 1 # print(i) print(ans)
p02613
s760695107
Wrong Answer
N = int(input()) S = [input() for _ in range(N)] #N行に1文字入力したい A = S.count("AC") B = S.count("WA") C = S.count("TLE") D = S.count("RE") print("AC"+"×" + str(A)) print("WA"+"×" + str(B)) print("TLE"+"×" + str(C)) print("RE"+"×" + str(D))
p02833
s526230364
Wrong Answer
from math import floor n = int(input()) if n % 2 == 1: print(0) else: num = 10 ans = 0 while num < n: ans += floor(n / num) num *= 5 print(ans)
p03077
s991971714
Accepted
import math n=int(input()) l=[int(input()) for i in range(5)] print(math.ceil(n/min(l))+4)
p02814
s587490208
Wrong Answer
import fractions N, M = map(int, input().split()) l_in = map(int, input().split()) l_num = [] lcm = 1 for i in l_in: if i // 2 not in l_num: l_num.append(i // 2) lcm = lcm * (i // 2) // fractions.gcd(lcm, i // 2) d_max = M // lcm if d_max % 2 == 1: d_max += 1 print(d_max // 2)
p03386
s407384621
Accepted
#!/usr/bin/env python3 a, b, k = list(map(int, input().split())) ans = set([]) for i in range(a, min(a+k, b)): ans.add(i) for i in range(max(a, b-k+1), b+1): ans.add(i) for i in sorted(list(ans)): print(i)
p02789
s847101118
Accepted
N,M = input().split() if N==M: print('Yes') else: print('No')
p03455
s079177985
Accepted
a, b = map(int,input().split(' ')) if ((a * b) % 2 ) == 0: print('Even') else: print('Odd')
p03469
s699276525
Accepted
s = input() r = s[:3]+'8'+s[4:] print(r)
p03605
s589060554
Accepted
N = input() if '9' in N: print('Yes') else: print('No')
p02842
s490221336
Accepted
n = int(input()) quo = int(n/1.08) temp = 0 while temp<= n: temp = int(quo*1.08) if temp == n: print(quo) break quo = quo+1 if temp > n: print(':(')
p03035
s865463703
Accepted
A, B = map(int, open(0).read().split()) if A <= 5: print(0) elif 6 <= A <= 12: print(B // 2) else: print(B)
p03814
s990911150
Accepted
S = input() a = len(S) z = 0 for i in range(len(S)): if S[i] == 'A': a = min(a,i) if S[i] == 'Z': z = max(z,i) print(z-a+1)
p04043
s486720489
Wrong Answer
l=list(map(int,input().split())) if l.count(5)==2 and l.count(7)==1 and len(l)==3: print('Yes') else: print('No')
p03705
s693323864
Wrong Answer
def main(): N, A, B = (int(i) for i in input().split()) if (N == 1 and A != B) or (B - A < 0): print(0) elif N == 1: print(1) elif N == 2: print(1) elif B - A == 1 and N == 3: print(B - A + 1) else: print(2*B - 2*A + 1) if __name__ == '__main__': main()
p02813
s467305774
Wrong Answer
import itertools n = int(input()) p = list(map(int, input().split())) q = list(map(int, input().split())) l = list(itertools.permutations(p)) l.sort() p_i = 0 q_i = 0 for i in range(len(l)): if list(l[i]) == p: p_i = i elif list(l[i]) == q: q_i = i print(abs(p_i - q_i))
p02730
s174135917
Accepted
S = input() N = len(S) tmp1, tmp2 = [], [] flag = 0 for i in range(int((N-1)/2)): tmp1.append(S[i]) for i in range(int((N+3)/2)-1,N): tmp2.append(S[i]) #print(tmp1, tmp2) if tmp1 == tmp2: flag = 1 if flag == 1: print('Yes') else: print('No')
p03282
s141170384
Accepted
# ABC-106-C S = input().rstrip() K = int(input()) for s in S[:K]: if s != '1': print(s) exit() print(1)
p03555
s694373802
Accepted
a=input() b=input() if b[::-1]==a: print("YES") else: print("NO")
p03698
s551847766
Accepted
s = input() print(["no", "yes"][len(s) == len(set(s))])
p03472
s079116940
Accepted
import sys read=sys.stdin.read def main(): n,h,*ab=map(int,read().split()) tops=max(ab[0::2]) tlst=[b for b in ab[1::2] if b>tops] tlst.sort(reverse=True) i=-1 t=0 for i,t in enumerate(tlst): h-=t if h<=0: h=0 break print(h//tops+(h%tops>0)+i+1) if __name__=='__main__': main()
p02664
s930080622
Wrong Answer
T = list(input()) for i in reversed(range(len(T))): if T[i] == '?': if i == len(T)-1: T[i] = 'D' else: if T[i+1] == 'D': T[i] = 'P' else: T[i] = 'D' else: continue print(''.join(T))
p02912
s777894471
Accepted
import heapq import sys def input(): return sys.stdin.readline().strip() def main(): N,M = map(int,input().split()) A = list(map(int,input().split())) A = list(map(lambda x: x*(-1),A)) heapq.heapify(A) for _ in range(M): max_value = heapq.heappop(A) * (-1) heapq.heappush(A,max_value//2 * (-1)) print(sum(A) * (-1)) if __name__ == "__main__": main()
p03377
s251945133
Wrong Answer
import math import itertools #n = int(input()) #n, d = list(input().split()) A, B, X= list(map(int, input().split())) if A == X or (A < X and A+B > X) : print("Yes") else: print("No")
p02719
s626427076
Wrong Answer
# coding:utf-8 import math import fractions N,K=map(int, input().split()) if K==0: print("N") elif N==0 or N%K==0: print("0") else: a=fractions.gcd(N,K) N=N%K N=int(N/a) K=int(K/a) mi=N t=N for i in range(100): t=abs(t-K) mi=min(mi,t) print(mi*a)
p03145
s869266718
Accepted
a, b, c = map(int, input().split()) print(a*b//2)
p04012
s610820043
Wrong Answer
# -*- coding : utf - 8 -*- w = input() for i in range(len(w)): if w.count(w[i]) % 2 != 0: print("NO") exit() print("Yes")
p02657
s454751500
Accepted
A,B = input().split() C = int(A) * int(B) print(int(C))
p02743
s668826566
Accepted
from decimal import Decimal a,b,c=map(Decimal,input().split()) heiho=Decimal(0.5) A=a**heiho B=b**heiho C=c**heiho if A+B<C: print("Yes") else: print("No")
p02606
s407712166
Accepted
L,R,d = map(int,input().split()) count=0 for i in range(L,R+1): if i%d==0: count+=1 print(count)
p03435
s757471046
Wrong Answer
c = [list(map(int, input().split())) for _ in range(3)] # 回答例を見ると 「各列に対して 行ごとの変化量が等しい」ことが分かる. # 実際,a_i + b_j = c_ij が成り立つならば # a_1 = c_11 - b_1 = c_12 - b_2 = c_13 - b_3 が成り立つ. if c[0][1] - c[0][0] == c[1][1] - c[1][0] == c[2][1] - c[2][0]: if c[0][2] - c[0][1] == c[1][2] - c[1][1] == c[2][2] - c[2][1]: print('Yes') print('No')
p03730
s455670139
Accepted
A,B,C = map(int,input().split()) a = "NO" for n in range(10000): if n%A==0 and n%B==C: a = "YES" print(a)
p02982
s097358833
Accepted
import math n,d = map(int,input().split()) list_x = [[int(i) for i in input().split()] for _ in range(n)] count = 0 for i in range(n): for j in range(i+1,n): sum_ = 0 for k in range(d): sum_ += (list_x[i][k] - list_x[j][k])**2 if math.sqrt(sum_) ==(math.sqrt(sum_))//1: count += 1 print(count)
p02701
s307222883
Wrong Answer
N = int(input()) S = [input() for i in range(N)] for i in range(N-1): for s in S[i+1:]: if S[i] == s: N -= 1 break if N == 1: print(0) else: print(N)
p03711
s524190724
Wrong Answer
x, y = map(int, input().split()) A = [1, 3, 5, 7, 8, 10, 12] B = [4, 6, 9, 11] if x in A: x = "A" if x in B: x = "B" else: x = "C" if y in A: y = "A" if y in B: y = "B" else: y = "C" if x == y: print("Yes") else: print("No")
p02583
s203493345
Wrong Answer
n = int(input()) l = sorted(set(map(int, input().split()))) n = len(l) ans = 0 for i in range(n-2): for j in range(i+1, n-1): for k in range(j+1, n): if l[i] + l[j] > l[k]: ans += 1 print(ans)
p03252
s708794863
Wrong Answer
from collections import Counter S = input() T = input() alps_counter_s = Counter() alps_counter_t = Counter() for s in S: alps_counter_s[s] += 1 for t in T: alps_counter_t[t] += 1 if len(alps_counter_s.values()) == len(alps_counter_t.values()): print('Yes') else: print('No')
p03408
s037867355
Accepted
n1 = int(input()) cnt_dict = {} for _ in range(n1): s = input() if s not in cnt_dict: cnt_dict[s] = 1 else: cnt_dict[s] += 1 n2 = int(input()) for _ in range(n2): s = input() if s not in cnt_dict: cnt_dict[s] = -1 else: cnt_dict[s] -= 1 print(max(max(cnt_dict.values()),0))
p02779
s365633493
Wrong Answer
N = int(input()) A = list(map(int, input().split())) print(A) count = 0 for i in A: for j in A[count+1:]: if i == j: print("Yes") break else: count += 1 continue break else: print("No")
p02983
s663348913
Wrong Answer
i, j = map(int, input().split()) MOD = 2019 ans = float("inf") for x in range(i, min(j+1, i+MOD)): for y in range(i+1, min(j+1, i+MOD)): ans = min(ans, x%MOD * y%MOD) print(ans)
p02924
s066366582
Accepted
n=int(input()) print(n*(n-1)//2)
p03998
s149472166
Accepted
Sa=list(input()) Sb=list(input()) Sc=list(input()) Sa.append("*") Sb.append("*") Sc.append("*") table=[Sa,Sb,Sc] #print(table) #input() id=0 while True: if table[id][0]=="*": print(chr(id+65)) break newid=ord(table[id][0])-97 table[id]=table[id][1:] #print(table) id=newid
p03672
s420406270
Wrong Answer
S=input() N=len(S) for j in range(1,N//2): M=N-2*j c=0 for i in range(M//2): if S[i]==S[i+M//2]: c=c+1 if c==M//2: print(M) break else: continue
p02727
s660372092
Accepted
x,y,_,_,_ = map(int,raw_input().split(' ')) a,b,c = map(int, raw_input().split(' ')),map(int, raw_input().split(' ')),map(int, raw_input().split(' ')) a.sort(key = lambda x:-x) b.sort(key = lambda x:-x) c.sort(key = lambda x:-x) r = a[:x] + b[:y] r.sort() i,j = 0,0 while(j < len(c) and i < len(r)): if c[j] > r[i]: r[i] = c[j] i +=1 else: break j +=1 print sum(r)
p02922
s890641791
Wrong Answer
A,B = map(int,input().split()) if A >= B: print(1) else: B-=A A-=1 print(-(-B//A)+1)
p02946
s468862241
Accepted
K, X = map(int, input().split()) a = [] for i in range(X - K + 1, X + K): a.append(i) print(' '.join(map(str, a)))
p02658
s831163316
Wrong Answer
list_a=list(map(int, input().split())) result=1 for a in list_a: result = result*a if result > 10**18: print('-1') else: print(result)
p03261
s643302469
Accepted
N=int(input()) W=[str(input()) for i in range(N)] def main(): if len(set(W))!=N: return 'No' for i in range(N): j=i+1 if i<N-1 and W[i][len(W[i])-1]!=W[j][0]: return 'No' break if i==N-1: return 'Yes' print(main())
p03069
s380971319
Wrong Answer
n = int(input()) s = input() #sys.stdin.readlineは最後が改行 ans = 0 tmp = 0 for i in reversed(range(n)): if s[i] == '.': tmp+=1 elif s[i] == '#': ans += tmp tmp = 0 print(ans)
p02787
s785932410
Accepted
import math h,n = map(int,input().split()) a = [0 for _ in range(n)] b = [0 for _ in range(n)] for i in range(n): a[i], b[i] = map(int,input().split()) dp = [] for i in range(h + max(a)): dp.append(pow(2, 31) - 1) dp[0] = 0 for i in range(1, len(dp)): ''' tmp = dp[i] for j in range(n): tmp = min(tmp, dp[max(0, i-a[j])] + b[j]) dp[i] = tmp ''' dp[i] = min(dp[i - A] + B for A, B in zip(a, b)) print(min(dp[h:]))
p02664
s516092228
Wrong Answer
t=list(input()) a=0 for i in range(len(t)): if i+1==len(t) and t[i]=="?": t[i]="D" break if t[i]=="?" and t[i-1]=="D": t[i]="P" elif t[i]=="?" and t[i-1]=="P": t[i]="D" b="" for i in range(len(t)): b+=t[i] print(b)
p03407
s954593226
Accepted
a,b,c=map(int,input().split()) if (a+b)>=c: print("Yes") else: print("No")
p02912
s103614209
Wrong Answer
import math N,M=map(int,input().split()) mylist=list(map(int,input().split())) while M>0: mylist.sort(reverse=True) mylist[0]/=2 M-=1 mylist=[math.floor(i) for i in mylist] print(mylist) print(sum(mylist))
p02833
s689412905
Accepted
n=int(input()) if n%2==1: print(0) exit() cnt=0 n//=2 fact=1 while n>=5**fact: cnt+=n//(5**fact) fact+=1 print(cnt)
p03795
s456886370
Accepted
import math n=int(input()) a=0 a=math.floor(n/15) print(n*800-a*200)
p03803
s988636207
Accepted
l = list(range(2,14))+[1] a,b = map(int,input().split()) a,b = l.index(a),l.index(b) print("Draw" if a == b else "Alice" if a > b else "Bob")
p03109
s940418370
Accepted
a =input() b = a[0:4]+a[5:7]+a[8:10] if int(b) <=20190430: print("Heisei") else: print("TBD")
p02612
s511807290
Accepted
# -*- coding: utf-8 -*- N, = map(int, input().split()) if N%1000==0: print(0) else: print(1000-(N%1000))
p02995
s961175380
Accepted
from fractions import gcd A, B, C, D = map(int, input().split()) l = C * D // gcd(C, D) x = (A - 1) - (A - 1) // C - (A - 1) // D + (A - 1) // l y = B - B // C - B // D + B // l print(y - x)