problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03371
s434969192
Accepted
A, B, C, X, Y = map(int, input().split()) ans = 0 if 2 * C < A + B: ans += min(X, Y) * 2 * C if X >= Y: ans += (X - Y) * min(A, 2 * C) else: ans += (Y - X) * min(B, 2 * C) else: ans = X * A + Y * B print(ans)
p03380
s352978950
Accepted
n = int(input()) a = [int(i) for i in input().split()] ai = max(a) aj = -1 dj = ai for ak in a: if ak == ai: continue dk = abs(ai // 2 - ak) if dk < dj: aj = ak dj = dk print(ai, aj)
p02989
s642729919
Accepted
n = int(input()) d = list(map(int,input().split())) d = sorted(d) count = 0 if len(d)%2 == 0: if d[len(d)//2-1] == d[len(d)//2]: print(0) else: temp = d[len(d)//2]- d[len(d)//2-1] count += temp print(count) else: print(0)
p02879
s494375814
Accepted
A,B=map(int,input().split()) check=[1,2,3,4,5,6,7,8,9] if A in check and B in check: print(A*B) else: print("-1")
p02767
s817097423
Wrong Answer
n = int(input()) x = list(map(int, input().split())) s = sum(x) p = (s+n-1)//n r = 0 for y in x: r += (y - p)**2 print(r)
p03657
s539537270
Accepted
A, B = map(int, input().split()) if (A % 3 == 0) or (B % 3 == 0) or ((A + B) % 3 == 0): print('Possible') else: print('Impossible')
p02935
s467924721
Accepted
# input N = int(input()) v = list(map(int, input().split())) append = v.append # check for n in range(N - 1): v.sort() mix = (v[0] + v[1]) / 2 append(mix) del v[0:2] print(v[0])
p04019
s086874880
Accepted
string=input() n=[] for letter in string: n.append(letter) if ('N' in n and 'S' not in n) or ('S' in n and 'N' not in n) or ('E' in n and 'W' not in n)or ('W' in n and 'E' not in n): print('No') else: print('Yes')
p03241
s685483597
Accepted
import math N,M=map(int,input().split()) d=[] i=1 while math.sqrt(M)>=i: if M%i==0: d.append(i) if i**2!=M: d.append(M//i) i=i+1 d.sort()#Mの約数列 m=0 i=0 while len(d)-1>=i and M//N>=d[i]: if M%d[i]==0: m=d[i] i=i+1 print(m)
p02917
s242837813
Wrong Answer
n = int(input()) b = [0] + list(map(int,input().split())) b[0] = b[1] for i in range(1,len(b)): if b[-(i+1)]>b[-i]: b[-(i+1)]=b[-i] print(sum(b))
p03773
s006311620
Wrong Answer
a,b=map(int,input().split()) print((a+b)/24)
p03730
s007053319
Accepted
a, b, c = map(int, input().split()) for i in range(1, b+1): if a*i % b == c: print('YES') exit() print('NO')
p03352
s625932252
Wrong Answer
X = int(input()) maxi = 0 if X < 4: print(1) exit() for i in range(1, X): for j in range(2, X): if i**j <= X and i**j >= maxi: maxi = i**j else: break print(maxi)
p02675
s545497130
Accepted
n=int(input()) n=n%10 if n==3: print('bon') exit() l=[0,1,6,8] if n in l: print('pon') else: print('hon')
p02598
s778244044
Wrong Answer
import math N,K=map(int,input().split()) A=list(map(int, input().split())) l=0 r=max(A) while not l+1==r: x=math.ceil((r+l)/2) k=0 for a in A: k+=a//x if k<=K: r=x else: l=x print(r)
p02645
s834155732
Accepted
print(input()[:3])
p03017
s640951302
Wrong Answer
n,a,b,c,d = [int(x) for x in input().split()] s = list(input()) if c < d: ans = "Yes" for i in range(1,n): if s[i-1] == s[i] == "#": ans = "No" break else: ans = "No" for i in range(2,n): if s[i-2] == s[i-1] == s[i] == ".": ans = "Yes" br...
p02899
s072588584
Accepted
n=int(input()) A=list(map(int,input().split())) ans=[None for i in range(n)] for i in range(n): ans[A[i]-1]=str(i+1) print(" ".join(ans))
p03836
s558320366
Wrong Answer
sx, sy, tx, ty = map(int, input().split()) route ="" dx ,dy = tx-sy, ty-sy path1 = "R"*dx+ "U"*dy path2 = "L"*dx+ "D"*dy dx, dy = dx + 1, dy + 1 path3 = "D"+"R"*dx+ "U"*dy + "L" path4 = "U" + "L"*dx + "D"*dy + "R" print(path1+path2+path3+path4)
p02784
s198501058
Accepted
import sys def main(): h = int(input().replace('\n','').split()[0]) tmp = input().replace('\n','').split() a=0 for i in tmp: a+=int(i) if a >= h: print("Yes") else: print("No") if __name__ == '__main__': input = sys.stdin.readline main()
p02959
s440511994
Wrong Answer
n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) sum = 0 for i in range(n): if a[i] >= b[i]: sum += b[i] elif a[i+1] < b[i] - a[i]: sum += a[i] + a[i+1] else: sum += b[i] a[i+1] -= b[i] - a[i] print(sum)
p02995
s757081545
Accepted
from fractions import gcd a, b, c, d = map(int, input().split()) lcm = c * d // gcd(c, d) x = b - (b // c) - (b // d) + (b // lcm) y = (a - 1) - ((a - 1) // c) - ((a - 1) // d) + ((a - 1) // lcm) print(x - y)
p02731
s349526646
Accepted
#設定 import sys input = sys.stdin.buffer.readline #ライブラリインポート from collections import defaultdict con = 10 ** 9 + 7 #入力受け取り def getlist(): return list(map(int, input().split())) #処理内容 def main(): L = int(input()) ans = (L / 3) ** 3 print(ans) if __name__ == '__main__': main()
p02694
s231202745
Accepted
X = int(input()) ans = 100 count = 1 while(True): a = ans*0.01 ans = ans + a ans = int(ans) #print(ans) if (X<=ans): print(count) break count += 1
p02706
s923705060
Accepted
N, M = map(int, input().split()) *A, = map(int, input().split()) rem = N - sum(A) print(rem if rem >= 0 else -1)
p03241
s998151047
Accepted
N, M = map(int, input().split()) # Mの約数を列挙 sup = int(M**0.5) + 1 divs_left = [] divs_right = [] for i in range(1, sup+1): if M%i == 0: divs_left.append(i) divs_right.append(M//i) divs = divs_right + divs_left[::-1] for d in divs: if M//d >= N: print(d) quit()
p02742
s189803785
Wrong Answer
H,W = map(int, input().split()) if H%2==0: print(int((H*W)//2)) else: print(int(((H+1)*W)//2-(W-1)//2))
p03331
s602359268
Accepted
n = list(map(int, list(input()))) if n[0] == 1 and sum(n) == 1: print(10) else: print(sum(n))
p03136
s240781176
Wrong Answer
input_angle = int(input()) input_length = input() _length = input_length.split(' ') length = [int(l) for l in _length] length.sort() sum = 0 for i in range(input_angle-2): sum += int(length[i]) if int(length[-1]) < sum: print('Yes') else: print('No')
p02554
s409693789
Wrong Answer
n = int(input()) if n == 1 or n == 2: print(n * (n-1)) else: print((10 * n * (n - 1) - (4 * n)) % (10 ** 9 + 7))
p02801
s435243874
Accepted
print(chr(ord(input())+1))
p03778
s924800546
Accepted
W,a,b=map(int,input().split()) if a<=b and a+W >= b: print(0) elif a<b: print(b-(a+W)) elif a>=b and b+W >= a: print(0) exit() elif a>b: print(a-(b+W))
p02659
s736692963
Accepted
from decimal import Decimal a,b = map(str,input().split()) a = Decimal(a) b = Decimal(b) ans = (a*b) print(int(ans))
p03360
s943997431
Accepted
A,B,C=list(map(int,input().split())) K=int(input()) m=max([A,B,C]) print(sum([A,B,C])-m+m*2**K)
p03041
s510968816
Accepted
N,K = map(int,input().split()) S = input() ans = S[:K-1] + S[K-1].lower() + S[K:] print(ans)
p02835
s190863441
Wrong Answer
a,b,c = map(int, input().split()) if (a+b+c)>22: print('bust') else: print('win')
p03469
s397758075
Accepted
S=input() print(S[:3]+"8"+S[4:])
p02760
s570692956
Accepted
S="012 345 678 036 147 258 048 246 " A=[input().split()for i in range(3)] B=A[0]+A[1]+A[2] for b in [input()for i in range(int(input()))]: if b in B: S=S.replace(str(B.index(b)),"") print(["No","Yes"][S.find(" ")>-1])
p03011
s190200282
Wrong Answer
P,Q,R = map(int,input().split()) print(P+Q+R-min(P,Q,R))
p03836
s794519076
Wrong Answer
sx,sy,tx,ty = map(int,input().split()) going1 = "" returning1 = "" going2 = "" returning2 = "" going1 = 'R' * (tx - sx) + 'U' * (ty - sy) returning1 = 'L' * (tx -sy) + 'U' * (ty - sy) going2 = 'D' + 'R' * (tx - sx + 1) + 'U' * (ty - sy + 1) + 'L' returning2 = 'U' + 'L' * (tx - sx + 1) + 'D' * (ty - sy + 1) + 'R' print...
p02996
s172894060
Accepted
n= int(input()) task = [list(map(int,input().split()))for i in range(n)] task.sort(key= lambda x: x[1]) time = 0 for i in range(n): time += task[i][0] if time > task[i][1]: print("No") break else: print("Yes")
p03241
s175799134
Wrong Answer
# https://atcoder.jp/contests/abc112/tasks/abc112_d n, m = map(int, input().split()) ans = 1 i = 1 limit = m ** 0.5 while i <= limit: if m % i == 0 and m // i >= n: ans = max(ans, i) i += 1 print(ans)
p03150
s612711198
Wrong Answer
import sys, re #input = sys.stdin.readline S = input() if S == 'keyence' or re.fullmatch(r'[a-z]+keyence', S) or re.match(r'k[a-z]+eyence', S) or re.match(r'ke[a-z]+yence', S) or re.match(r'key[a-z]+ence', S) or re.match(r'keye[a-z]+nce', S) or re.match(r'keyen[a-z]+ce', S) or re.match(r'keyenc[a-z]+e', S) or re.full...
p02556
s880275286
Wrong Answer
#import random n=int(input()) pnt=[] for i in range(n): pnt.append(list(map(int,input().split()))) #pnt.append([random.randint(int(-1e9),int(1e9)),random.randint(int(-1e9),int(1e9))]) pnt.sort(key=lambda x:abs(x[0])+abs(x[1]),reverse=True) mn=list(reversed(pnt)) mx=0 for i in range(min(n,6000)): for j in range(...
p03673
s674382596
Accepted
from collections import deque n = int(input()) a = list(input().split()) b = [] q = deque() for i in range(n): x = a[i] if n%2 == i%2: q.append(x) else: q.appendleft(x) print(" ".join(q))
p03860
s128066560
Accepted
a,b,c=input().split() print(a[0]+b[0]+c[0])
p02606
s085073563
Accepted
L,R,d=map(int,input().split()) list_num=range(L,R+1) ans=0 for i in list_num: if i%d==0: ans+=1 print(ans)
p02725
s922252375
Accepted
K, N = [int(i) for i in input().split()] A = [int(i) for i in input().split()] d = 0 for i in range(N): tmp = abs(A[i] - A[i-1]) if tmp > K / 2: tmp = K - tmp if tmp > d: d = tmp print(K - d)
p03795
s759144394
Accepted
N = int(input()) p = 800*N b = N//15 * 200 print(p-b)
p03037
s570651087
Wrong Answer
N,M = map(int,input().split()) LR = [list(map(int,input().split())) for i in range(M)] maxi = 0 mini = 10**6 for lr in LR: maxi = max(lr[0],maxi) mini = min(lr[1],mini) if mini-maxi+1 >= N: print(N) else: print(mini-maxi+1)
p02796
s226977737
Wrong Answer
n = int(input()) data = [] for i in range(n): x, l = map(int, input().split()) data.append([x, l]) data = sorted(data, key = lambda x: x[0]) ans = 1 pre = data[0][0] + data[0][1] for i in range(1, n): if data[i][0] - data[i][1] >= pre: ans += 1 pre = data[i][0] + data[i][1] print(ans)
p03557
s654226628
Accepted
from bisect import * def inpl(): return list(map(int, input().split())) N = int(input()) A = inpl() B = inpl() C = inpl() A.sort() C.sort() print(sum(bisect_left(A, b) * (N - bisect_right(C, b)) for b in B))
p03625
s898154515
Accepted
n = int(input()) a = list(map(int, input().split())) d = {} for x in a: d[x] = d.get(x, 0) + 1 d = sorted(d.items(), key=lambda x: x[0], reverse=True) l = [] ans = 0 for num, cnt in d: if cnt > 1: l.append(num) if len(l) == 2: ans = l[0] * l[1] print(ans) exi...
p02861
s536805795
Wrong Answer
from math import factorial def dist(x1, y1, x2, y2): return ((x1 - x2)**2 + (y1 - y2)**2)**0.5 N = int(input()) x, y = [0]*N, [0]*N for i in range(N): x[i], y[i] = map(int, input().split()) ans = 0 for i in range(N): for j in range(N): ans += dist(x[i], y[i], x[j], y[j]) * 2 ans /= factorial(N)...
p02784
s155884911
Wrong Answer
h , n = map(int, input().split()) a = list(map(int, input().split())) for i in range(n): h = h - a[i] if (h < 0): print("Yes") else: print("No")
p02911
s925319091
Accepted
import sys N, K, Q = [int(i) for i in input().split()] t = { k + 1: K for k in range(N) } for _ in range(Q): A = int(input()) t[A] += 1 for n in range(N): if t[n + 1] - Q > 0: print("Yes") else: print("No")
p02797
s701828515
Accepted
N,K,S=map(int,input().split()) answers=[str(S)]*K answers_=[str(S+1)]*(N-K) a=' '.join(answers) b=' '.join(answers_) if K==0: if S==pow(10,9): answers_ = ['1'] * (N - K) b = ' '.join(answers_) c=b else: c=b elif S==pow(10,9): answers_=['1']*(N-K) b = ' '.join(answers_) ...
p03408
s014151189
Accepted
N = int(input()) S = [input() for i in range(N)] M = int(input()) T = [input() for _ in range(M)] S1 = set(S) result = [] for a in S1: if a not in T: result.append(S.count(a)) else: if S.count(a) >= T.count(a): result.append(S.count(a) - T.count(a)) if not result: print(0) else...
p02571
s688374141
Accepted
S = input() T = input() len_S = len(S) len_T = len(T) ans = len_T for i in range(0, len_S - len_T + 1): match = 0 for s, t in zip(S[i:i + len_T], T): if s == t: match += 1 change = len_T - match ans = min(ans, change) print(ans)
p03592
s269734162
Accepted
n,m,k=map(int,input().split()) ans="No" for i in range(n+1): if (2*i-n)==0: if k==m*n//2: ans="Yes" else: if (k-n*m+m*i)%(2*i-n)==0 and 0<=(k-n*m+m*i)//(2*i-n)<=m: ans="Yes" print(ans)
p02659
s203538672
Wrong Answer
# -*- coding: utf-8 -*- import math i = list(input().split()) print(math.floor(int(i[0])*float(i[1])))
p04043
s884196668
Accepted
A, B, C = map(int, input().split()) fsf = [A, B, C] if (fsf.count(5) == 2) & (fsf.count(7) == 1): print("YES") else: print("NO")
p02866
s099732227
Accepted
from collections import defaultdict import sys MOD=998244353 N=int(input()) dlist=list(map(int,input().split())) if dlist[0]!=0: print(0) sys.exit(0) ddic=defaultdict(int) for d in dlist: ddic[d]+=1 if ddic[0]!=1: print(0) sys.exit(0) max_d=max(dlist) answer=1 for d in range(1,max_d+1): if ddic[d]...
p02848
s139612712
Accepted
N=int(input()) S=input() ans="" for i in range(len(S)): index=ord(S[i])+N if index>=91: index=index-26 ans=ans+chr(index) print(ans)
p02633
s154017142
Accepted
x = int(input()) idx = 0 tmp = 0 while 1: tmp += x idx += 1 if tmp % 360 == 0: break print(idx)
p02571
s127643691
Accepted
S = input() T = input() max_count = 0 for i in range(max(1, len(S) - len(T))): count = 0 for j in range(len(T)): if S[i+j] == T[j]: count += 1 max_count = max(max_count, count) print(len(T) - max_count)
p04031
s654861758
Wrong Answer
N = int(input()) a = list(map(int, input().split())) mincost = 1000000000000000 for i in range(-100, 100): cost = 0 for j in a: cost += (j - i) * (j - i) if cost < mincost: mincost = cost print(mincost)
p03339
s392530218
Accepted
N = int(input()) S = str(input()) W=[0] * N E=[0] * N for i in range(1, N): if S[i-1] == "W": W[i]=W[i-1]+1 else: W[i]=W[i-1] for i in range(N-2, -1, -1): if S[i+1] == "E": E[i]=E[i+1]+1 else: E[i]=E[i+1] tmp=W[0]+E[0] for i in range(1, N): if tmp > W[i]+E[i]: ...
p03723
s158291949
Accepted
a, b, c = map(int, input().split()) ans = 0 for i in range(10000): if a%2 == 0 and b%2 == 0 and c%2 == 0: A = (b + c)/2 B = (a + c)/2 C = (a + b)/2 a = A b = B c = C ans += 1 else: break if ans >= 10000: print(-1) else: print(ans)
p03042
s210578756
Wrong Answer
s = input() head = int(s[:2]) tail = int(s[2:]) if head > 12 and 0 < tail <= 12: print("YYMM") elif 0 < head <= 12 and tail > 12: print("MMYY") elif head <= 12 and tail <= 12: print("AMBIGUOUS") else: print("NA")
p03163
s890446406
Accepted
n, m = map(int, input().split()) dp = [[0] * (m+1) for i in range(n+1)] for i in range(n): w, v = map(int, input().split()) for j in range(m+1): if j < w: dp[i+1][j] = dp[i][j] else: dp[i+1][j] = max(dp[i][j-w]+v, dp[i][j]) print(dp[n][m])
p04030
s081924358
Accepted
s = input() ans = [] for a in s: if a == 'B': if len(ans) != 0: ans.pop() else: ans.append(a) print(*ans,sep='')
p02556
s384501110
Accepted
import sys input = sys.stdin.readline def main(): n = int(input()) p = [list(map(int, input().split())) for i in range(n)] p0, p1 = [0]*n, [0]*n for i in range(n): p0[i] = p[i][0] - p[i][1] p1[i] = p[i][0] + p[i][1] ans = max(max(p0)-min(p0), max(p1)-min(p1)) print(ans) ...
p03817
s139373423
Accepted
n = int(input()) div,mod = divmod(n,11) if mod == 0: print(div*2) elif mod <= 6: print(div * 2 +1) else: print(div*2+2)
p02983
s446448971
Accepted
L, R = map(int, input().split()) min_rad = 2019 R_max = min(L+2019, R) for i in range(L, R_max): for j in range(i+1, R_max+1): temp = i%2019 * j%2019 if temp < min_rad: min_rad = temp print(min_rad)
p02583
s846571860
Accepted
from sys import stdin import itertools def main(): input = stdin.readline N = int(input()) L = map(int,input().split()) ans = 0 for i in list(itertools.combinations(sorted(L), 3)): if (i[0] + i[1] > i[2]) & (i[0] != i[1]) & (i[1] != i[2]) & (i[0] != i[2]): ans += 1 prin...
p02717
s693273010
Accepted
x,y,z=map(int,input().split()) print(str(z)+' '+str(x)+' '+str(y))
p03434
s803481028
Wrong Answer
n=int(input()) a=sorted(map(int,input().split())) alice=0 bob=0 for i in range(n): if i%2==1: alice+=a[i] else: bob+=a[i] print(alice-bob)
p04012
s199890466
Wrong Answer
# -*- coding : utf- 8 -*- w = str(input()) for i in range(len(w)): if w.count(w[i]) % 2 == 1: print("NO") exit() print("Yes")
p02916
s720058859
Accepted
n = int(input()) a = list(map(int,input().split())) b = list(map(int,input().split())) c = list(map(int,input().split())) t = 0 t += b[a[0]-1] for i in range(1,n): t += b[a[i]-1] if a[i] - a[i-1] == 1: t += c[a[i-1]-1] print(t)
p02829
s317388688
Accepted
A = int(input()) B = int(input()) print(6-A-B)
p02771
s770818848
Accepted
def main(): A, B, C = map(int, input().split()) if len(set([A, B, C])) == 2: return "Yes" return "No" if __name__ == '__main__': print(main())
p02880
s178240935
Accepted
n = int(input()) li = [1,2,3,4,5,6,7,8,9] for i in range(9): for j in range(9): if li[i] * li [j] == n: print("Yes") exit() else: pass print("No")
p02661
s494280302
Wrong Answer
from sys import stdin input = stdin.readline N = int(input()) ab = [list(map(int, input().split())) for _ in range(N)] ab.sort() ran = [] for a, b in ab: ran.append(b - a + 1) ran.sort() if N % 2 == 0: a1, b1 = ab[N // 2 - 1] a2, b2 = ab[N // 2] xa = (a2 + a1) / 2 xb = (b2 + b1) / 2 print(...
p02701
s872812226
Accepted
n=int(input()) s={input() for i in range(n)} print(len(s))
p02693
s328666502
Accepted
N = int(input()) A,B = map(int,input().split()) for i in range(A,B+1): if i%N == 0: print('OK') exit() print('NG')
p02888
s097885733
Accepted
import bisect from itertools import combinations def main(): N = int(input()) L = sorted(list(map(int, input().split()))) ans = 0 for l in combinations(L, 2): a = l[0] b = l[1] x = bisect.bisect_left(L, a + b) y = bisect.bisect(L, b - a) if b - a < a : ...
p03351
s302754273
Accepted
a, b, c, d = list(map(int, input().split())) if abs(a - c) <= d: print("Yes") elif abs(a - b) <= d and abs(b - c) <= d: print("Yes") else: print("No")
p03836
s191631714
Accepted
A,B,C,D = map(int,input().split()) ans = "" ans += (C-A) * "R" + (D-B) * "U" ans += (C-A) * "L" + (D-B) * "D" ans += "L" + (D-B+1) * "U" + (C-A+1) * "R"+ "D" ans += "R" + (D-B+1) * "D" + (C-A+1) * "L"+ "U" print(ans)
p03673
s124732927
Wrong Answer
n=int(input()) a=list(map(int,input().split())) b=list() cnt=0 for i in a: if cnt==0: b.append(i) cnt=1 else: b.insert(0,i) cnt=0 L=[str(a) for a in b] L=" ".join(L) print(L)
p03241
s865798536
Accepted
N,M=map(int,input().split()) P=[] A=round(M**0.5)+2 for i in range(1,A): if M%i==0: P.append(i) P.append(M//i) P.sort() B=M//N ans=now=1 for p in P: now=p if now<=B: ans=now print(ans)
p03250
s225299676
Wrong Answer
l=list(map(int,input().split())) l.sort() s=10*l[0]+l[1] print(s+l[2])
p03289
s539434954
Wrong Answer
def main(): S = input() flag = True if S[0] == 'A': cnt = 0 pos = -1 for i in range(2, len(S)-1): if S[i] == 'C': cnt += 1 pos = i elif S[i].isupper(): flag = False if flag and cnt == 1: print...
p03814
s991048851
Wrong Answer
a=input() for i in range(len(a)): if a[i]=="A": b=i break for i in range(len(a)): if a[len(a)-i-1]: c=i break print(c-b)
p03239
s223768521
Wrong Answer
n, T = map(int, input().split()) ans = 1001 for _ in range(n): c, t = map(int, input().split()) if t <= T: ans = min(c, ans) print(ans)
p03860
s172521771
Accepted
l=input().split() print("A"+l[1][0]+"C")
p02608
s466559436
Accepted
n = int(input()) ans = [0 for i in range(n + 1)] for x in range(1,int(pow(n, 0.5)+1)): for y in range(1,int(pow(n, 0.5)+1)): for z in range(1,int(pow(n, 0.5)+1)): if x**2 + y**2+z**2 +x*y + x*z + y*z <= n: ans [x**2 + y**2+z**2 +x*y + x*z + y*z] += 1 for i in range(1,n+1): pr...
p03543
s116050019
Accepted
int_str = input() triple_same_digit = ['000'] first_three_digits = int_str[0:3] last_three_digits = int_str[-3:] for i in range(111, 1000, 111): triple_same_digit.append(str(i)) if first_three_digits in triple_same_digit: print('Yes') elif last_three_digits in triple_same_digit: print('Yes') else: pr...
p03760
s292285790
Accepted
import sys def input(): return sys.stdin.readline().strip() def resolve(): o=list(input()) e=list(input()) ans='' for x,y in zip(o,e): ans+=x+y if len(o)-len(e)==1: ans+=o[-1] print(ans) resolve()
p02833
s640036054
Accepted
n = int(input()) ans = 0 if n % 2 == 1: ans = 0 else: k = n // 2 f = 5 while k // f > 0: ans += (k // f) f *= 5 print(ans)