problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03625
s790325302
Accepted
N = int(input()) A = list(map(int, input().split())) dic = {} for a in A: if a in dic: dic[a] += 1 else: dic[a] = 1 l = [] for k, v in dic.items(): if v >= 2: l.append(k) l.sort() if len(l) == 0: print(0) elif len(l) == 1: if dic[l[-1]] >= 4: print(l[-1] ** 2) else: print(0) else: if dic[l[-1]] >= 4: print(l[-1] ** 2) else: print(l[-1] * l[-2])
p02835
s858391479
Wrong Answer
a1, a2, a3 = map(int, input().split()) print('burst' if a1 + a2 + a3 >= 22 else 'win')
p02771
s347466773
Wrong Answer
a,b,c = map(int,input().split()) if a == b and a == c: print("No") else: print("Yes")
p02988
s039138776
Accepted
n=int(input()) p=list(map(int,input().split())) cnt=0 for i in range(1,n-1): if (p[i-1]<p[i]<p[i+1] or p[i+1]<p[i]<p[i-1]): cnt+=1 print(cnt)
p02720
s227726439
Accepted
K = int(input()) ans = [1, 2, 3, 4, 5, 6, 7, 8, 9] for i in ans: if len(ans) > K: break if i%10 == 0: ans.append(i*10+i%10) ans.append(i*10+i%10+1) elif i%10 == 9: ans.append(i*10+i%10-1) ans.append(i*10+i%10) else: ans.append(i*10+i%10-1) ans.append(i*10+i%10) ans.append(i*10+i%10+1) print(ans[K-1])
p03680
s507209070
Accepted
import sys n=int(input()) an=[0]*(n+1) for i in range(n): an[i+1]=int(input()) t=1 cnt=0 for _ in range(n*2): t=an[t] cnt+=1 if t==2: print(cnt) sys.exit() print(-1)
p02584
s526768939
Wrong Answer
X, K, D = map(int, input().split()) k = K - (X // D) x = X % D while True: if abs(x) < D: if k % 2 == 0: print(abs(x)) else: print(D-abs(x)) exit() x = abs(x - D) k -= 1 if k == 0: print(x) exit()
p03556
s224536209
Accepted
n = int(input()) m = int(n ** 0.5 + 3) for i in range(m): if i ** 2 > n: print((i - 1) ** 2) break
p03103
s144553315
Accepted
import sys def input(): return sys.stdin.readline().rstrip() def main(): n,m=map(int,input().split()) C=[tuple(map(int,input().split())) for i in range(n)] C.sort() honsu=m cost=0 for i,c in enumerate(C): cost+=c[0]*min(honsu,c[1]) honsu-=c[1] if honsu<=0: break print(cost) if __name__=='__main__': main()
p03448
s668478301
Accepted
A, B, C, X = [int(input()) for i in range(4)] print(sum([500*a+100*b+50*c == X for a in range(A+1) for b in range(B+1) for c in range(C+1)]))
p03644
s011811745
Accepted
N=int(input());n=0;print([2**i for i in range(N) if 2**i<=N][-1])
p03814
s889632178
Wrong Answer
s=str(input()) s=list(s) for i in range(0,len(s)): if s[i]=="A": temp1=i break for j in range(temp1+1,len(s)): if s[j]=="Z": temp2=j break print(temp2-temp1+1)
p03644
s829083540
Accepted
n = int(input()) L = [] j = 0 for i in range(n): s = list(bin(i+1)[2:])[::-1] cnt = 0 while j <=n-1: if s[j] == "0": cnt +=1 j +=1 #print(j,cnt) elif s[j] == "1": L.append((cnt,i+1)) cnt=0 break j =0 print(max(L)[1])
p03673
s547189497
Accepted
n=int(input()) a=list(map(int,input().split())) af=[] al=[] for i in range(n): if i%2==0: af.append(a[i]) else: al.append(a[i]) if n%2==0: al=al[::-1] for a in al: print(a,end=" ") for a in af: print(a,end=" ") else: af=af[::-1] for a in af: print(a,end=" ") for a in al: print(a,end=" ")
p02772
s646806501
Accepted
N = int(input()) A = list(map(int, input().split())) j = 0 for i in A: if i % 2 == 0: if i % 3 == 0 or i % 5 == 0: pass else: j += 1 else: pass if j > 0: print('DENIED') else: print('APPROVED')
p03711
s917562312
Accepted
x, y = map(int, input().split()) a = [1, 3, 5, 7, 8, 10, 12] b = [4, 6, 9, 11] c =[2] if x in a and y in a: print("Yes") elif x in b and y in b: print("Yes") elif x in c and y in c: print("Yes") else: print("No")
p02831
s015520371
Accepted
# -*- coding: utf-8 -*- """ Created on Sat May 9 16:09:21 2020 @author: shinba """ import fractions a,b = map(int,input().split()) print(int(a*b/fractions.gcd(a,b)))
p03211
s826176135
Wrong Answer
s = input() n = len(s) a = 0 for i in range(n-2): if abs(753-a)>abs(753-int(s[i:i+3])): a = int(s[i:i+3]) print(753-a)
p03408
s142864348
Accepted
n=int(input()) nlst=[input() for i in range(n)] m=int(input()) mlst=[input() for i in range(m)] ans=0 for i in nlst: plus=nlst.count(i) minus=mlst.count(i) ans=max(ans,plus-minus) print(ans)
p02778
s826474103
Accepted
U=str(input()) l=len(U) print("x"*l)
p03261
s585673824
Wrong Answer
def main(): n = int(input()) result = True used = {' ':0} for order in range(0,n): word = str(input()) print(sorted(used.keys())[len(used) -1]) if word in used or sorted(used.keys())[len(used) -1][-1] == word[0]: print('NO') result = False break else: used.setdefault(word,0) if result: print('Yes') if __name__ == "__main__": main()
p03037
s543265318
Accepted
n,m = map(int,input().split()) gate_list = [ list(map(int,input().split())) for i in range(m)] #print(gate_list) ans1 = gate_list[0][0] ans2 = gate_list[0][1] for i in range(1,m): ans1 = max(ans1,gate_list[i][0]) for i in range(1,m): ans2 = min(ans2,gate_list[i][1]) ans = ans2 - ans1 if ans < 0: print(0) else: print(ans+1)
p03041
s239212402
Accepted
N, K = map(int, input().split()) S = list(input()) S[K-1] = chr(ord(S[K-1])+32) print("".join(S))
p03721
s921873406
Accepted
import sys readline = sys.stdin.readline N,K = map(int,readline().split()) AB = [list(map(int,readline().split())) for i in range(N)] AB = sorted(AB, key = lambda x:x[0]) amount = 0 for a,b in AB: amount += b if amount >= K: print(a) break
p02993
s800331096
Wrong Answer
s=list(input()) ss=list(set(s)) print('Good' if len(s)==len(ss) else 'Bad')
p03061
s077732298
Wrong Answer
from fractions import gcd N = int(input()) A = map(int, input().split()) B = [0] * (N + 1) B[0] = next(A) B[1] = next(A) B[2] = B[0] B[0] = gcd(B[0], B[1]) for i, a in enumerate(A): i += 3 B[i] = gcd(B[0], a) for j in range(i): B[j] = gcd(B[j], a) print(max(B))
p02548
s992681160
Accepted
n = int(input()) res = 0 for a in range(1, n+1): for b in range(1, int((n+1)/a)+1): c = n-a*b if c>0 and a*b+c==n: res+=1 print(res)
p03456
s806199848
Wrong Answer
a,b = map(int,input().split()) num = int(str(a)+str(b)) ans = 'No' for i in range(1,101): if num == i**2: ans = 'Yes' break print(ans)
p03827
s146090819
Accepted
N=int(input()) S=input() x = 0 ans = x for c in S: if c == 'I': x += 1 elif c == 'D': x -= 1 if x > ans: ans = x print(ans)
p02707
s250082447
Accepted
N = int(input()) A = list(map(int, input().split())) B = [0] * N #部下の人数 for a in A: B[a-1] += 1 for b in B: print(b)
p02702
s044396619
Accepted
S = input() P =2019 ans = 0 count = [0] * P count[0] = 1 u = 0 for i, s in enumerate(reversed(S)): u = (int(s) * pow(10, i, P) + u) % P ans += count[u] count[u] += 1 print(ans)
p03038
s277761638
Wrong Answer
n,m=map(int,input().split()) a=list(map(int,input().split())) a.sort() for i in range(m): b,c=map(int,input().split()) for j in range(b): if a[j]<c: a[j]=c else: break if j>0: a.sort() print(sum(a))
p03071
s050310313
Accepted
import sys import fractions import math import itertools a,b=list(map(int,input().split())) ans=0 if a>=b: ans+=a a-=1 else: ans+=b b-=1 if a>=b: ans+=a a-=1 else: ans+=b b-=1 print(ans)
p02598
s523116358
Wrong Answer
import copy import math n, k = map(int,input().split()) a = list(map(int,input().split())) ub = 10**9 lb = 0 while ub - lb > 0.01: x = (ub + lb) / 2 cnt = 0 for i in a: cnt += math.ceil(i/x) if cnt <= n+k: ub = copy.deepcopy(x) else: lb = copy.deepcopy(x) ans = round(ub, 1) print(math.ceil(ans))
p02711
s166439275
Wrong Answer
n = input() for letter in n: if letter == '7': result = "Yes" else: result = 'No' print(result)
p04020
s298368354
Accepted
N = int(input()) A = [int(input()) for i in range(N)] ans = 0 tmp = 0 for a in A: if a == 0: tmp = 0 a += tmp ans += a // 2 tmp = a % 2 print(ans)
p03719
s869340328
Accepted
a,b,c=map(int, input().split()) print("Yes" if a<=c<=b else "No")
p02613
s165236843
Accepted
# -*- coding: utf-8 -*- """ Created on Sun Jul 5 21:05:16 2020 @author: asaka """ N = int(input()) ans = [0]*4 for n in range(N): h = input() if h == "AC": ans[0] += 1 elif h == "WA": ans[1] += 1 elif h == "TLE": ans[2] += 1 elif h == "RE": ans[3] += 1 print("AC x ", ans[0]) print("WA x ", ans[1]) print("TLE x ", ans[2]) print("RE x ", ans[3])
p02546
s521815504
Accepted
S=input() tmp = list(S)[-1] if tmp=="s": print(S+"es") else: print(S+"s")
p02548
s047033932
Accepted
n = int(input()) ans = 0 for a in range(1, n): for b in range(1, n //a + 1): if a * b < n: ans += 1 print(ans)
p02583
s974817601
Wrong Answer
import itertools N = int(input()) L = list(map(int,input().split(" "))) S = set(L) X = [] if len(S) < 3: print(0) else: for i in S: if L.count(i) > 1: X.append(L.count(i)) ans = len(list(itertools.combinations(S, 3))) for i in X: ans *= i print(ans)
p03472
s872355599
Wrong Answer
from math import ceil N,H=map(int, input().split()) A=[0]*N B=[0]*N for i in range(N): a,b=map(int, input().split()) A[i]=a B[i]=b A=sorted(A) B=sorted(B, reverse=True) amax=max(A) ans=0 for i in range(N): b=B[i] if b>amax: H-=b ans+=1 else: break if H>0: ans+=ceil(H/amax) print(ans)
p02681
s304575648
Accepted
s = input(); t= input() if(s == t[0:-1] and len(s)+1==len(t)): print("Yes") else: print("No")
p03329
s143335315
Accepted
import itertools N = int(input()) nine_list = [9**i for i in range(0, 6)] six_list = [6**i for i in range(1, 7)] ans = float("inf") for combi in itertools.product([i for i in range(6)], repeat=6): # print(combi) count = sum(combi) six_sum = sum([a*b for a, b in zip(six_list, combi)]) if N < six_sum: continue rest = N - six_sum for nine in reversed(nine_list): if nine > rest: continue count += rest // nine rest = rest % nine ans = min(ans, count) print(ans)
p03239
s268214933
Wrong Answer
n, T = map(int, input().split()) cost = [] time = [] ans = 1000 for i in range(n): c, t = map(int, input().split()) cost.append(c) time.append(t) for c, t in zip(cost, time): if t <= T and ans > c: ans = c print(ans if ans != 1000 else 'TLE')
p02594
s446488130
Wrong Answer
#https://atcoder.jp/contests/abc174/tasks/abc174_a N= [] N= int(input(" ")) if N >=30: print("YES") else: print("NO")
p03481
s049452099
Accepted
def main(): x, y = map(int, input().split()) cnt = 1 while True: x *= 2 if x <= y: cnt += 1 else: break print(cnt) if __name__ == "__main__": main()
p02912
s555835016
Wrong Answer
import heapq import math def LI(): return [int(s) for s in input().split()] N,M = LI() a = LI() a = list(map(lambda x: x*(-1), a)) # 各要素を-1倍 heapq.heapify(a) for i in range(M): x = (-1)*(abs(heapq.heappop(a))//2) print(x) heapq.heappush(a,x) cost = 0 for i in range(N): x = heapq.heappop(a) cost+=abs(x) print(cost)
p02689
s942386948
Accepted
n, h = map(int, input().split()) li = list(map(int, input().split())) li_a = [[0] for i in range(n)] for i in range(h): a, b = map(int, input().split()) li_a[a-1].append(li[b-1]) li_a[b-1].append(li[a-1]) ans = 0 for j in range(n): if li[j] > max(li_a[j]): ans += 1 print(ans)
p03386
s032019549
Wrong Answer
a,b,k=map(int,input().split()) if k*2>b: for i in range(a,b+1): if i<a+k: print(i) elif b-k<i: print(i) else: for i in range(a,min(a+k,b+1)): print(i) for i in range(max(a,b-k+1),b+1): print(i)
p03633
s139387610
Accepted
import fractions N = int(input()) T = [int(input()) for i in range(N)] ans = T[0] for i in range(N-1): ans = ans * T[i+1]//fractions.gcd(ans, T[i+1]) print(ans)
p02847
s064460704
Accepted
S=input() slist={"SUN":7,"MON":6,"TUE":5,"WED":4,"THU":3,"FRI":2,"SAT":1} print(slist[S])
p02600
s128146828
Wrong Answer
x = int(input()) if x <= 599: print(8) exit() x -= 599 for i in range(9): x -= 199 if x <= 0: print(7 - i) exit()
p03146
s279912565
Wrong Answer
s=int(input()) a=[] na=[] a.append(s) for i in range(1,10**6): if a[i-1]%2==0: a.append(a[i-1]/2) else: a.append(a[i-1]*3+1) na=set(a) if len(na)!=i+1: print(a[i]) exit()
p02832
s567727355
Wrong Answer
n=int(input()) a=list(map(int,input().split())) count=0 for i in range(n): if a[i]!=i+1-count: count=count+1 print(count)
p03011
s329441659
Accepted
a, b, c = map(int, input().split()) print(min([a+b, a+c, b+c]))
p02646
s034865191
Wrong Answer
a,v = map(int, input().split()) b,w = map(int, input().split()) t = int(input()) distance = b - a speed_remainder = v - w if distance <= 0: print("NO") elif distance <= t * speed_remainder: print("YES") else: print("NO")
p03011
s805489308
Accepted
nums=list(map(int, input().split())) nums.sort() print(nums[0]+nums[1])
p03817
s355171578
Wrong Answer
x=int(input()) ans=0 for i in range(100000000000): if (i+1)%2==1: x-=5 ans+=1 if x<=0: print(ans) break else: x-=6 if x<=0: print(ans) break
p02854
s057776733
Wrong Answer
from itertools import accumulate N = int(input()) A = list([int(x) for x in input().split()]) count = 0 ironbar = list(accumulate(A)) i = 0 j = len(A) - 1 while i + 1 < j: left = ironbar[i] right = ironbar[-1] - ironbar[i] if right <= left: j = (i+j) // 2 else: i = (i+j) // 2 # iかjが正解 i_bar = abs(ironbar[i] - (ironbar[-1] - ironbar[i])) j_bar = abs(ironbar[j] - (ironbar[-1] - ironbar[j])) print(min(i_bar, j_bar))
p02861
s483708692
Wrong Answer
N = int(input()) XY = [[0]*2]*N dis = 0 for i in range(N): XY[i] = [int(_) for _ in input().split()] for i in range(N): Xi = XY[i][0] Yi = XY[i][1] for j in range(i+1,N): Xj = XY[j][0] Yj = XY[j][1] dis += ((Xi-Xj)**2 + (Yi-Yj)**2)**0.5 _N = 1 for n in range(N,0,-1): _N *= n print(dis/_N)
p03262
s722303175
Accepted
N,X = map(int,input().split()) x = list(map(int,input().split())) x = sorted([abs(i-X) for i in x]) y = x[0] for i in range(1,N): z = x[i] y,z = max(y,z),min(y,z) while z!=0: y,z = z,y%z print(y)
p03699
s311915951
Accepted
n=int(input()) l=[0]*(10000+1) l[0]=1 for i in range(n): s=int(input()) for j in range(10000,s-1,-1): if l[j-s]:l[j]=1 for j in range(10000,-1,-1): if j%10 and l[j]:print(j);exit() print(0)
p03696
s244391381
Wrong Answer
N = int(input()) X = input() L = len([i for i in X if i != "("]) R = len(X) - L mL = 0 for i in X: if i == ")": mL += 1 else: break mR = 0 for i in X[::-1]: if i == "(": mR += 1 else: break #print(L, R, mL, mR) result = "" if L >= R: result += "(" * max([L-R, mL]) result += X if R >= L: result += ")" * max([R-L, mR]) print(result)
p02783
s008574260
Accepted
H,A=map(int,input().split()) ans=0 while H>0: H=H-A ans+=1 print(ans)
p02553
s600666560
Accepted
a, b, c, d = map(int, input().split()) answer = max(a*c, a*d, b*c, b*d) print(answer)
p03150
s481720408
Accepted
s = input() l = "keyence" if s[0:7] == l: print("YES") elif s[-7:] == l: print("YES") else: for i in range(7): if s[:i+1] == l[:i+1] and s[i-6:] == l[i+1:]: print("YES") exit() print("NO")
p02608
s973418337
Accepted
import sys input = sys.stdin.readline N=int(input()) ANS=[0]*(10**5+1) for x in range(1,10**2+1): for y in range(1,10**2+1): for z in range(1,10**2+1): ANS[x*x+y*y+z*z+x*y+y*z+z*x]+=1 print(*ANS[1:N+1])
p03377
s306286817
Wrong Answer
a,b,c = map(int,input().split()) print("YES" if a + (b-c) == c else "NO")
p02924
s999547227
Accepted
n =int(input()) ans = n * (n - 1) // 2 print(ans)
p02879
s958974779
Accepted
a,b = map(int,input().split()) c = -1 if a < 10: if b < 10: c = a*b print(c)
p02780
s979032397
Wrong Answer
M=[] for i in range(1001): m=(i+1)/2 M.append(m) N,K=map(int,input().split()) P=list(map(int,input().split())) S=[] s=0 for i in range(N): a=P[i] s=s+M[a] S.append(s) Q=[] Q.append(S[0]) q=0 for i in range(N-K): q=S[i+K]-S[i] Q.append(q) q=0 print(max(Q))
p03803
s079071125
Wrong Answer
a, b = map(int, input().split()) if a == b: print('Draw') elif a < b: print('Bob') else: print('Alice')
p02682
s637434514
Wrong Answer
a,b,c,k=map(int,input().split()) print(a-max(k-a-b,0))
p02706
s964338649
Wrong Answer
n = input().split(" ") a = input().split(" ") n[0] = int(n[0]) sum_HomeworkDays = 0 for i in a: sum_HomeworkDays += int(i) if n[0]-sum_HomeworkDays > 0: print(n[0]-sum_HomeworkDays) else: print("-1")
p02602
s538820134
Accepted
N, K = map(int, input().split()) a = [int(x) for x in input().split()] a.insert(0,0) for i in range(K,N): if a[i-K+1]<a[i+1]: print("Yes") else: print("No")
p02730
s248727014
Wrong Answer
S = list(input()) N = len(S) flag = 1 S1 = S[0:int((N-1)/2)] S2 = S[int((N+1)/2):N] for i in range(int((N-1)/2)): if S1[i] != S1[len(S1)-i-1]: flag = 0 if S2[i] != S2[len(S2)-i-1]: flag = 0 if flag == 1: print('Yes') else: print('No')
p02923
s678282625
Accepted
# https://atcoder.jp/contests/abc139/tasks/abc139_c n = int(input()) nums = [int(i) for i in input().split()] nums.append(float('inf')) ans = 0 t = 0 for i in range(n): if nums[i] >= nums[i + 1]: t += 1 else: ans = max(ans, t) t = 0 print(ans)
p03478
s257234961
Accepted
N, A, B = map(int, input().split()) ans = 0 for i in range(1, N + 1): sum_digits = sum(map(int, list(str(i)))) if A <= sum_digits <= B: ans += i print(ans)
p02963
s053317074
Wrong Answer
s=int(input()) if s+1<=10**9: b=str(s+1) a=['0','0',b,'1','1','1'] else: x2=int(s**(1/2)) y3=int(s**(1/2))+1 if x2*y3<s: if y3==10**9: x2+=1 else: y3+=1 x2=str(x2) y3=str(y3) y2=str(1) x3=str(int(x2)*int(y3)-s) x1=str(0) y1=str(0) a=[x1,y1,x2,y2,x3,y3] print((' ').join(a))
p03698
s419349014
Wrong Answer
S = list(input()) print('Yes' if len(S)==len(set(S)) else 'No')
p02705
s534046402
Accepted
import math print(2*int(input())*(math.pi))
p02633
s746446603
Accepted
x=int(input()) for i in range(1,1000): if 360*i%x==0: ans=360*i//x break print(ans)
p02767
s375941288
Wrong Answer
N = int(input()) X = [int(n) for n in range(N)] min_ans = +float('inf') for i in range(N): ans = 0 for x in X: ans += (x - i)**2 min_ans = min([min_ans, ans]) print(min_ans)
p03360
s532962226
Wrong Answer
a, b, c = map(int, input().split()) k = int(input()) res = max([a, b, c]) * (2 * k - 1) + a + b + c print(res)
p02640
s098183706
Accepted
x,y = map(int,input().split()) for i in range(x+1): if i*2+(x-i)*4==y: print("Yes");break else: print("No")
p02802
s248071428
Accepted
n,m=map(int,input().split()) ac=[0]*(n+1) wa=0 for i in range(m): p,c=input().split() if c=='WA' and ac[int(p)]!=1: ac[int(p)]-=1 elif c=='AC' and ac[int(p)]!=1: wa+=abs(ac[int(p)]) ac[int(p)]=1 print(ac.count(1),wa)
p02630
s820719423
Accepted
from collections import Counter n = int(input()) l = list(map(int,input().split())) ans = sum(l) counter = Counter(l) q = int(input()) for i in range(q): b,c = map(int,input().split()) ans += (c-b)*counter[b] print(ans) counter[c] += counter[b] counter[b] = 0
p03075
s431087028
Accepted
a,b,c,d,e,f = [ int(input()) for i in range(6) ] if e-a <= f: print("Yay!") else: print(":(")
p03323
s273569465
Accepted
a,b = map(int, input().split()) if (a<=8)&(b<=8): print("Yay!") else: print(":(")
p02743
s178413019
Accepted
import math from decimal import Decimal def main(): a,b,c = map(int,input().split()) if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt(): print("Yes") else: print("No") main()
p02595
s511124265
Accepted
import math N,D=(int(x) for x in input().split()) X=Y=p=count=0 for i in range(N): X,Y=(int(x) for x in input().split()) p =math.sqrt(X**2+Y**2) if p <= D: count += 1 print(count)
p03804
s483195351
Wrong Answer
n,m = map(int,input().split()) a = [input() for _ in range(n)] b = [input() for _ in range(m)] ans = 0 for i in range(n-m+1): for j in range(n-m+1): if a[i][j:j+m+1]==b[0]: ans = 1 for k in range(1,m): if a[i+k][j:j+m+1] != b[k]: ans = 0 if ans == 1: break if ans==1: print('Yes') else: print('No')
p03435
s524233134
Accepted
c11,c12,c13=map(int, input().split()) c21,c22,c23=map(int, input().split()) c31,c32,c33=map(int, input().split()) ans="No" for a1 in range(c11+1): b1=c11-a1 b2=c12-a1 b3=c13-a1 a2=c21-b1 a3=c31-b1 if c22==a2+b2 and c23==a2+b3 and c32==a3+b2 and c33==a3+b3: ans="Yes" break print(ans)
p02766
s785306632
Wrong Answer
from sys import stdin import math n, k = [int(x) for x in stdin.readline().rstrip().split()] cnt = 1 if n < k: print(cnt) exit kk = k for i in range(100): kk = kk * k cnt += 1 if n < kk: break print(cnt)
p03723
s689445570
Wrong Answer
A,B,C = map(int,input().split()) ans = 0 if A == B == C: print(-1) else: while A % 2 == 0 and B % 2 == 0 and C % 2 == 0: n_A = (B + C) / 2 n_B = (A + C) / 2 n_C = (A + B) / 2 A = n_A B = n_B C = n_C print(A,B,C) ans += 1 print(ans)
p02553
s208204025
Accepted
a,b,c,d = [int(x) for x in input().split()] print(max(a*c,a*d,b*c,b*d))
p02756
s420688851
Accepted
s = input() q = int(input()) h, t = [], [] p = 0 for i in range(q): c = input().split() if c[0] == '1': h, t = t, h p = 1 - p else: if c[1] == '1': h.append(c[2]) else: t.append(c[2]) if p == 1: s = s[::-1] print("".join(h[::-1]) + s + "".join(t))
p03799
s643044356
Accepted
n, m = map(int, input().split()) if n * 2 >= m: print(m // 2) else: print(n + (m - 2 * n) // 4)
p02682
s018041077
Wrong Answer
A,B,C,K =map(int,input().split()) if A >= K: print(A) elif A + B >= K: print(A) elif A + B < K: c = -1 * (K-(A+B)) #print(c) #print(A) cc = A + c print(cc)