problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03605
s365469798
Accepted
n = list(input()) if '9' in n: print('Yes') else: print('No')
p02761
s494384092
Wrong Answer
n, m = map(int, input().split()) tmp = ["0" for i in range(n)] check = [0 for i in range(n)] for i in range(m): s, c= map(str, input().split()) check[int(s)-1]+=1 tmp[int(s)-1] = c flag = True for i in check: if i >= 2: flag = False ans = int("".join(tmp)) if len(str(ans)) == n and flag: print(ans) else: print(-1)
p02773
s970615366
Accepted
def main(): n = int(input()) cnt = {"":0} ans = 0 for i in range(n): s = input() if cnt.get(s) == None: cnt[s] = 1 else: cnt[s] += 1 ans = max(ans, cnt[s]) ls = [] for k in cnt: if cnt[k] == ans: ls.append(k) ls.sort() for i in range(len(ls)): print(ls[i]) main()
p03672
s974026900
Wrong Answer
S = [i for i in input()] while True: S.pop(-1) if len(S)%2==0: s = ''.join(S) s1 = s[:(len(S)//2)] s2 = s[len(S)//2:] print(s1, s2) if s1 == s2: print(len(S)) exit(0) elif len(S)==0: print(0) exit(0)
p02675
s026760290
Accepted
n = int(input()) if n % 10 == 3: print('bon') elif n % 10 == 0 or n % 10 == 1 or n % 10 == 6 or n % 10 == 8: print('pon') else: print('hon')
p03416
s742476504
Wrong Answer
A, B = input().split() ans_list =[] for i in range(int(A), int(B)): i_reversed = int(str(i)[::-1]) if i_reversed == i: ans_list.append(i) i += 1 print(len(ans_list))
p02627
s649405565
Accepted
c=input() print(['a','A'][ord('A')<=ord(c)<=ord('Z')])
p03457
s784992273
Wrong Answer
n = int(input()) points = [] for i in range(n): points.append([i for i in map(int, input().split())]) can = True for i in range(len(points)-1): move_n = points[i+1][0] - points[i][0] dist = abs(points[i+1][1] - points[i][1]) + abs(points[i+1][2] - points[i][2]) if move_n < dist or dist % 2 != move_n % 2: can = False break if can: print('YES') else: print('NO')
p02989
s257028008
Accepted
N = int(input()) d = list(map(int, input().split())) d.sort() print(d[int(N/2)]-d[int(N/2)-1])
p02772
s412686029
Accepted
n = int(input()) a = list(map(int,input().split())) for i in range(n): if a[i] % 2 == 0: if a[i] % 3 != 0 and a[i] % 5 != 0: print('DENIED') exit(0) print('APPROVED')
p03407
s359634962
Accepted
#!/usr/bin/env python3 a,b,c = map(int,input().split()) print("Yes" if a+b >= c else "No")
p03456
s698008071
Accepted
import sys import math a,b = map(int,input().split()) if not (1 <= a <= 100 and 1 <= b <= 100): sys.exit() result = math.sqrt(int(str(a)+str(b))).is_integer() print('Yes') if result == True else print('No')
p02790
s871949086
Accepted
a,b = map(int,input().split()) print(min(str(a)*b,str(b)*a))
p03323
s571339244
Accepted
def resolve(): A, B = list(map(int, input().split(" "))) if A < B: A, B = B, A res = (A - B) <= (16 - 2 * B) / 2 print("Yay!" if res else ":(") if '__main__' == __name__: resolve()
p02600
s253835122
Accepted
X = int(input()) if (400<=X and X<=599): print(8) elif (600<=X and X<=799): print(7) elif (800<=X and X<=999): print(6) elif (1000<=X and X<=1199): print(5) elif (1200<=X and X<=1399): print(4) elif (1400<=X and X<=1599): print(3) elif (1600<=X and X<=1799): print(2) elif (1800<=X and X<=1999): print(1)
p02601
s373366789
Wrong Answer
import numpy as np A = [int(x) for x in input().split()] src = np.array(A) K = int(input()) flag = 0 for i in range(K): if(src[0] < src[1]): if(src[1] < src[2]): flag = 1 break else: src[2] *= 2 else: src[1] *= 2 if(src[0] < src[1]): if(src[1] < src[2]): print("yes") else: print("no")
p03448
s371485495
Accepted
A=int(input()) B=int(input()) C=int(input()) X=int(input()) l=0 for i in range(A+1): for j in range(B+1): for k in range(C+1): Total=500*i+100*j+50*k if Total==X: l+=1 print(l)
p03208
s524000842
Accepted
n,k = map(int, input().split()) h = [[] for i in range(n)] for i in range(n): h[i] = int(input()) h.sort() ans = float("inf") for i in range(n-k+1): a = h[i+k-1]-h[i] ans = min(ans, a) print(ans)
p03419
s767657843
Wrong Answer
N, M = map(int, input().split()) print(2 * N + 2 * M - 4)
p03126
s791037382
Wrong Answer
n, m = [int(i) for i in input().split()] list_a = [[int(i) for i in input().split()] for j in range(0, n)] list_ans = [1 for i in range(0, m)] if n == 1: print(list_a[0][0]) exit() for i in range(0, n): for j in range(1, len(list_a[i])): if list_ans[list_a[i][j] - 1] == 1: list_ans[list_a[i][j] - 1] = 0 print(sum(list_ans))
p03387
s402475987
Accepted
A,B,C = map(int,input().split()) cnt = 0 A,B,C = sorted([A,B,C]) i = C - B cnt += i B += i A += i j = C - A if j % 2 == 0: cnt += j // 2 else: cnt += j // 2 + 2 print(cnt)
p03472
s084187673
Accepted
import bisect N, H = map(int, input().split()) Attack = [] Throw = [] for _ in range(N): a, b = map(int, input().split()) Attack.append(a) Throw.append(b) attack = max(Attack) Throw.sort() Throw_num = bisect.bisect_left(Throw, attack) Throw_sum = sum(Throw[Throw_num:]) if Throw_sum <= H: print((H - Throw_sum - 1) // attack + 1 + N - Throw_num) else: Throw.sort(reverse=True) for i in range(N): H -= Throw[i] if H <= 0: print(i + 1) exit()
p03012
s691379741
Accepted
N = int(input()) W = list(map(int, input().split())) ans = 10**7 for i in range(N): if i == 0: continue ans = min(ans, abs(sum(W[:i]) - sum(W[i:]))) print(ans)
p02555
s399419770
Accepted
from scipy.special import comb S = int(input()) sho = S // 3 ans = 1 S -= 5 if sho > 0: for i in range(1,sho): ans += comb(S, i, exact=True) S -= 2 print(int(ans)%(10**9+7)) else: print(0)
p03086
s105092987
Accepted
s = input() l = 0 ans = 0 for c in s: if c in ('A', 'C', 'G', 'T'): l += 1 ans = max(ans, l) else: l = 0 print(ans)
p02681
s564751919
Accepted
s = input() t = input() if s == t[:-1]: print('Yes') else: print('No')
p02547
s945890803
Accepted
n = int(input()) c = 0 for i in range(n): x,y=map(int,input().split()) if x==y: c+=1 else: c=0 if c==3: print('Yes') break else: print("No")
p04034
s088657341
Accepted
n,m=map(int,input().split()) ans=[0]*n ans[0]=1 b=[1]*n for i in range(m): x,y=map(int,input().split()) if ans[x-1]==1 and b[x-1]>1: ans[y-1]=1 b[x-1]=b[x-1]-1 b[y-1]=b[y-1]+1 elif ans[x-1]==1 and b[x-1]==1: ans[x-1]=0 ans[y-1]=1 b[x-1]=b[x-1]-1 b[y-1]=b[y-1]+1 else: b[x-1]=b[x-1]-1 b[y-1]=b[y-1]+1 print(sum(ans))
p02785
s204214755
Accepted
n,k = map(int,input().split()) h_list = list(map(int,input().split())) h_list.sort(reverse = 1) ans = 0 for i in range(k,n): ans += h_list[i] print(ans)
p02946
s484689276
Accepted
K, X = list(map(int, input().split())) for i in range(X - K + 1, X + K): print(i)
p02548
s336838225
Wrong Answer
import math def comb(A,B) : return math.factorial(A) // (math.factorial(A - B) * math.factorial(B)) base = comb(31,2) print(base+8)
p02618
s231315559
Wrong Answer
d=int(input()) c = list(map(int,input().split())) s=[None]*d for i in range(d): s[i] = list(map(int,input().split())) for ss in s: print(max(ss))
p03264
s950040896
Wrong Answer
k = int (input ()) if k%2 == 0: print ((k**2)/4) else: kk = (k//2)+1 kg = k//2 print (kk*kg)
p02660
s288669252
Accepted
N = int(input()) res = {} ans = 0 i = 2 for i in range(2,int(N**(1/2))+1) : while(N%i == 0) : if(i not in res) : res[i] = 1 else : res[i] += 1 N /= i if(N != 1) : res[N] = 1 for i in res : b = 1 s = res[i] while(b <= s) : ans += 1 s -= b b += 1 print(ans)
p02789
s381022349
Wrong Answer
n, m=input().split() if n==m: print("AC") else: print("WA")
p02603
s599187299
Accepted
n = int(input()) A = [*map(int, input().split())] + [0] yen = 1000 kabu_yen = kabu_n = 0 for i in range(n): if A[i] < A[i+1]: # buy m = yen // A[i] cost = m * A[i] yen -= cost kabu_yen += cost kabu_n += m elif A[i] > A[i+1]: # sell yen += kabu_n * A[i] kabu_yen = kabu_n = 0 print(yen)
p03345
s846872644
Accepted
A, B, C, K = map(int, input().split()) ans = A-B if K % 2 == 0 else B-A print(ans if abs(ans) <= 10**18 else 'Unfair')
p03043
s922131511
Accepted
from collections import Counter,defaultdict,deque from heapq import heappop,heappush,heapify import sys,bisect,math,itertools,fractions sys.setrecursionlimit(10**8) mod = 10**9+7 INF = float('inf') def inp(): return int(sys.stdin.readline()) def inpl(): return list(map(int, sys.stdin.readline().split())) n,k = inpl() res = 0 for i in range(1,n+1): cnt = 0 now = i if i > k: res += 1/n continue while now < k: now *= 2 cnt += 1 res += 1/n*(1/2**cnt) print(res)
p03309
s464674593
Accepted
N = int(input()) alist = list(map(int, input().split())) blist = [] for i in range(N): blist.append(alist[i]-i-1) blist.sort() mid = blist[len(blist)//2] ans = 0 for i in range(N): ans += abs(blist[i]-mid) print(ans)
p03815
s650780345
Accepted
x=int(input()) if x%11>6: ans=(x//11)*2+2 elif x%11==0: ans=(x//11)*2 else: ans=(x//11)*2+1 print(ans)
p03427
s427147925
Accepted
n=input() nn=len(n) if nn==1: print(n) exit() flg=True for i in range(1,nn): if n[i]!="9": flg=False ans=0 if flg: for i in range(nn): ans+=int(n[i]) print(ans) exit() if flg==False: if n[0]!="1": print(int(n[0])-1+9*(nn-1)) if n[0]=="1": print(9*(nn-1))
p02678
s761831737
Accepted
from collections import deque def main(): N,M,*AB=map(int,open(0).read().split()) to=[[] for _ in range(N)] for a,b in zip(*[iter(AB)]*2): to[a-1].append(b-1) to[b-1].append(a-1) q=deque([0]) r=[0]*N while q: x=q.popleft() for i in to[x]: if not r[i]: q.append(i) r[i]=x+1 print("Yes",*r[1:],sep="\n") if __name__=='__main__': main()
p02882
s549522529
Wrong Answer
a,b,x=map(int,input().split()) import math if a**2*b>=2*x: print(math.degrees(math.atan(2*(a**2*b-x)/(a**3)))) else: print(math.degrees(math.atan(b**2*a/(2*x))))
p02621
s499014873
Accepted
a = int(input()) print(a + a**2 + a**3)
p03345
s504828857
Wrong Answer
A, B, C, K = map(int, input().split()) for i in range(K): A, B, C = B+C, A+C, A+B if abs(A) > 10**18 or abs(B) > 10**18 or abs(C) > 10**18: print('Unfair') exit() print(A-B)
p02789
s082478563
Wrong Answer
N, M = input().split() if N==M : print('YES') else: print('NO')
p02773
s352045179
Wrong Answer
from collections import Counter N = int(input()) S = [input() for _ in range(N)] S.sort() c = Counter(S).most_common() a = c[0][1] for v in c: if v[1] != a: break print(v[0])
p03059
s012526227
Wrong Answer
a,b,t = map(int,input().split()) sum = 0 for i in range(1,90): if i*a > t+ (1/2): ans = i-1 break for j in range(1,i): sum += j*b print(sum)
p03854
s827875158
Accepted
def main(S): listdreamereraser = ['dreamer','eraser','dream','erase'] while True: for i in listdreamereraser: if i in S[-len(i):]: S = S[:-len(i)] break else: return False if len(S) == 0: return True S = input() print('YES' if main(S) else 'NO')
p03011
s941271291
Accepted
P, Q, R = map(int, input().split()) if P >= Q and P >= R: print(Q + R) elif Q >= P and Q >= R: print(P + R) else: print(P + Q)
p02717
s189071494
Wrong Answer
X, Y, Z = [int(i) for i in input().split()] print("{} {} {}".format(Z, Y, X))
p02768
s194494143
Accepted
n,a,b=map(int,input().split()) mod=10**9+7 ans=pow(2,n,mod)-1 cma=1 a,b=min(a,b),max(a,b) for i in range(1,a+1): cma=cma*(n-i+1)*pow(i,mod-2,mod)%mod ans-=cma if a==b: print(ans);exit() for i in range(a+1,b+1): cma=cma*(n-i+1)*pow(i,mod-2,mod)%mod print((ans-cma)%mod)
p03962
s305051366
Wrong Answer
a = list(input().split()) print(set(a))
p03161
s538913079
Accepted
n, k= map(int, input().split()) h = list(map(int, input().split())) h = [0] + h dp = [10 ** 9] * (n+1) dp[1] = 0 for i in range(1, n+1): for d in range(1, k+1): if i > d: dp[i] = min(dp[i], dp[i - d] + abs(h[i] - h[i - d])) print(dp[n])
p02700
s771859324
Accepted
A,B,C,D = map(int,input().split()) Takahashi_HP = A Takahashi_Damage = B Aoki_HP = C Aoki_Damage = D while Takahashi_HP > 0 or Aoki_HP > C: Aoki_HP -= Takahashi_Damage if Aoki_HP <= 0: print('Yes') break Takahashi_HP -= Aoki_Damage if Takahashi_HP <= 0: print('No') break
p03309
s754049008
Wrong Answer
n = int(input()) a = list(map(int,input().split())) c = [a[i]-i-1 for i in range(n)] ans = 0 c.sort() print(c) if n%2 == 1: b = c[n//2] for i in range(n): ans += abs(c[i]-b) else: b = (c[n//2]+c[n//2-1])//2 #print(b) for i in range(n): ans += abs(c[i]-b) print(ans)
p02706
s941483751
Accepted
n,m = map(int,input().split()) a = list(map(int,input().split())) if n >= sum(a): print(n - sum(a)) else: print(-1)
p02706
s628356665
Accepted
# coding:utf-8 n,m =map(int,input().split()) a=list(input().split()) for i in range(len(a)): n=n- int(a[i]) if n>=0: print(n) else: print(-1)
p02726
s165265614
Wrong Answer
import numpy as np N, X, Y = map(int, input().split()) K = Y - X ans = np.zeros(N-1,dtype = int) for i in range(X-1): ans[i] += X-i-1 for i in range(N-Y-1): ans[i] += N-Y-i-1 for i in range(1, X+1): for j in range(X+1,N+1): ans[Y-j +X-i] += 1 for i in range(X+1, Y+1): for j in range(i+1,N+1): tmp = min(j-i,abs(Y-j) +1 + abs(X-i)) ans[tmp-1] += 1 for i in range(N-1): print(ans[i])
p02818
s234468639
Wrong Answer
a,b,k = map(int, input().split()) if a <= k: print(0,b-(k-a)) else: print(a-k,b)
p02556
s398859358
Accepted
import sys input = sys.stdin.readline def main(): N = int( input()) U = [] V = [] for _ in range(N): x, y = map( int, input().split()) u, v = x+y, x-y U.append(u) V.append(v) U.sort() V.sort() print( max(U[-1]-U[0], V[-1]-V[0])) if __name__ == '__main__': main()
p04034
s671025525
Accepted
n,m = [int(x) for x in input().split()] xy = [] for _ in range(m): tmp = [int(x)-1 for x in input().split()] xy.append(tmp) num = [1 for _ in range(n)] red = [False for _ in range(n)] red[0] = True for i in range(m): if red[xy[i][0]]: red[xy[i][1]] = True num[xy[i][0]] -= 1 num[xy[i][1]] += 1 if num[xy[i][0]] == 0: red[xy[i][0]] = False print(sum([1 for x in red if x == True]))
p02706
s229523364
Wrong Answer
N, M = map(int, input().split()) day_cost = [int(i) for i in input().split()] holidays = N-sum(day_cost) if holidays > 0: print(holidays) else: print(-1)
p03860
s437372935
Accepted
A = list(input().split()) print(A[0][0] + A[1][0] + A[2][0])
p03485
s484400071
Wrong Answer
import math a,b = list(map(int,input().split())) print(math.ceil(a+b/2))
p03309
s572096691
Accepted
n = int(input()) a = list(map(int, input().split())) box = [0]*n ans = 0 for i in range(n): box[i] = a[i] - (i+1) box.sort() idx = n//2 b = box[idx] for i in range(n): ans += abs(a[i]-(i+1+b)) print(ans)
p03208
s649717949
Accepted
N, K = map(int, input().split()) res = float("inf") l = sorted([int(input())for i in range(N)]) for i in range(N-K+1): res = min(res, l[i+K-1]-l[i]) print(res)
p03479
s796288364
Wrong Answer
a,b=input().split() a=int(a) b=int(b) c=b/a d=1 e=0 for i in range(60): d=2*d e=e+1 if d>c: print(e) break
p02760
s516001512
Accepted
a = [input().split() for _ in range(3)] n = int(input()) b = [input() for _ in range(n)] ans = "No" flag = [ [False for _ in range(3)] for _ in range(3)] for i in range(n): for j in range(3): for k in range(3): if b[i] == a[j][k]: flag[j][k] = True for i in range(3): if all((flag[0][i],flag[1][i],flag[2][i])) or all((flag[i][0],flag[i][1],flag[i][2])): ans = "Yes" if all((flag[0][0],flag[1][1],flag[2][2])) or all((flag[0][2],flag[1][1],flag[2][0])): ans = "Yes" print(ans)
p02618
s841797693
Wrong Answer
d=int(input()) c=list(map(int,input().split())) s=[list(map(int,input().split())) for i in range(d)] for i in range(d): cand=0 for j in range(26): if c[cand]>c[j]: cand=j print(cand)
p03860
s530826122
Accepted
s=str(input()) s=list(s) print("A"+s[8]+"C")
p02681
s420648194
Wrong Answer
s = input() t = input() length_s = len(s) length_t = len(t) if s in t and length_s + 1 == length_t: print("Yes") else: print("No")
p02899
s472046347
Accepted
num = int(input()) li = list(map(int, input().split())) number = list(range(num)) data = dict(zip(number, li)) data_sorted = sorted(data.items(), key = lambda x:x[1]) data_key = [str(i[0] + 1) for i in data_sorted] print(" ".join(data_key))
p03438
s668328215
Accepted
n=int(input()) *a,=map(int,input().split()) *b,=map(int,input().split()) ans=0 for i in range(n): if a[i]>b[i]: ans-=a[i]-b[i] else: ans+=(b[i]-a[i])//2 print('No' if ans<0 else 'Yes')
p03773
s469461506
Accepted
a,b = map(int,input().split()) print((a+b)%24)
p03035
s468458260
Wrong Answer
a,b=map(int,input().split()) print(b>>(5<a<13))
p02859
s805623121
Accepted
r=int(input()) print(r**2)
p03760
s275390408
Wrong Answer
o=list(input()) e=list(input()) for x,y in zip(o,e):print(x+y,end="")
p03836
s231051217
Wrong Answer
sx, sy, tx, ty = map(int, input().split()) dx = abs(tx - sx) dy = abs(ty - sy) s = ["L"]+["U"]*dy+["R"]*dx+["D"] + ["R"]+["D"]*dy+["L"]*dx+["U"] + ["U"]*dy+["R"]*dx + ["D"]*dy+["L"]*dx print("".join(s))
p03592
s194425393
Accepted
N, M, K = map(int, input().split()) # 1回押すと変わるマス = N * M - 1 # 2回目押すと黒になるマス = N * M - 1 - 2 # 3 = N * M - 1 - 4 cnt = 0 for i in range(N + 1) : for j in range(M + 1) : cnt = i * M + j * N - 2 * i * j if cnt == K : print("Yes") exit() print("No")
p02584
s994097730
Wrong Answer
x,k,d=map(int, input().split()) x=abs(x) if x>=k*d: print(x-k*d) exit() if k%2==1: x=x-d kaisu=int(x/(2*d)) ans=abs(x-kaisu*d*2) print(ans)
p02547
s364954612
Wrong Answer
n = int(input()) xy = [map(int, input().split()) for _ in range(n)] x, y = [list(i) for i in zip(*xy)] count = 0 for k in range(n-2): if x[k] == y[k] and x[k+1] == y[k+1] and x[k+2] == y[k+2]: count += 1 if count >= 1: print('Yes') else: print('NO')
p03286
s819457524
Accepted
n = int(input()) s = '' while(n != 0): s = str(n % 2)+s n = -(n//2) print(0 if(s == "") else s)
p02723
s483599315
Accepted
S = input() if S[2]==S[3] and S[4]==S[5]: print("Yes") else: print("No")
p03061
s989641231
Accepted
import math N=int(input()) A=list(map(int,input().split())) L=[0]*(N+1) R=[0]*(N+1) for i in range(N): L[i]=math.gcd(L[i-1],A[i]) for i in range(N-1,0,-1): R[i]=math.gcd(R[i+1],A[i]) ans=0 for i in range(0,N): ans=max(ans,math.gcd(L[i-1],R[i+1])) print(ans)
p03745
s901937924
Accepted
n=int(input()) A=list(map(int,input().split())) zo=0 ; mi=0 ;ans=1 for i in range(n-1): #print(zo,mi,i) if zo==mi==0: if A[i]==A[i+1]: continue elif A[i]>A[i+1]: mi=1; continue else: zo=1;continue if zo: if A[i+1]<A[i]: zo=0; ans+=1 if mi and A[i]<A[i+1]: mi=0 ; ans+=1 print(ans)
p03274
s482139857
Accepted
import sys import itertools # import numpy as np import time import math import heapq from collections import defaultdict sys.setrecursionlimit(10 ** 7) INF = 10 ** 18 MOD = 10 ** 9 + 7 read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines # map(int, input().split()) N, K = map(int, input().split()) X = list(map(int, input().split())) left = 0 right = K - 1 ans = INF while right < len(X): val1 = abs(X[left]) + abs(X[right] - X[left]) val2 = abs(X[right]) + abs(X[right] - X[left]) ans = min(ans, val1, val2) left += 1 right += 1 print(ans)
p03127
s852442986
Wrong Answer
from fractions import gcd N = int(input()) lisA = list(map(int,input().split())) lisA.sort() ans = gcd(lisA[0],lisA[1]) print(ans)
p03478
s890275058
Wrong Answer
N, A, B = map(int, input().split()) someSums = 0 for i in range(1, N+1): if A <= (i // 1000) % 10 + (i // 100) % 10 + (i // 10) % 10 + (i % 10) <= B: someSums += i print(someSums)
p03479
s594857184
Accepted
X, Y = list(map(int, input().split())) ans = 0 while X <= Y: ans += 1 X = X * 2 print(ans)
p02683
s161502270
Wrong Answer
import numpy as np n,m,x=map(int,input().split()) li=[list(map(int,input().split())) for i in range(n)] li=np.array(li) y=np.sum(li, axis=0) if(np.min(y[1:])<x): print(-1) for i in range(n): for j in range(n): pass
p03286
s285881183
Wrong Answer
N = int(input()) ans = [] N = -N while N != 0: ans.append(N%2) N //= -2 ans.reverse() print(*ans, sep="")
p02795
s943551515
Accepted
#!/usr/bin/env python3 import sys, math, itertools, collections, bisect input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') inf = float('inf') ;mod = 10**9+7 mans = inf ;ans = 0 ;count = 0 ;pro = 1 h=int(input()) w=int(input()) n=int(input()) k=max(h,w) print(math.ceil(n/k))
p03861
s589846268
Accepted
#import itertools #import fractions #import numpy as np #mod = 10**4 + 7 """def kiri(n,m): r_ = n / m if (r_ - (n // m)) > 0: return (n//m) + 1 else: return (n//m)""" # Written by NoKnowledgeGG @YlePhan #import math #mod = 10**9+7 def main(): a,b,x = map(int,input().split()) print(b//x - (a-1)//x) if __name__ == '__main__': main()
p02555
s242223914
Wrong Answer
import math S = int(input()) if S < 3: print(0) exit() def check(s, i): re = (i ** s) % (10 ** 9 + 7) return re n = S // 3 ans = 0 for i in range(n): S_i = S - (3 * (i + 1)) ans += check(S_i, i) print(ans % (10 ** 9 + 7))
p03761
s189752146
Accepted
n=int(input()) abc_li=[0]*26 S=input() for i in range(len(S)): abc_li[ord(S[i])-97]+=1 for i in range(n-1): S=input() tmp_abc_li=[0]*26 for j in range(len(S)): tmp_abc_li[ord(S[j])-97]+=1 for k in range(26): abc_li[k]=min(abc_li[k],tmp_abc_li[k]) ans='' for i in range(26): if abc_li[i]>0: ans=ans+(chr(i+97)*abc_li[i]) print(ans)
p02633
s524452462
Accepted
X = int(input()) ans = 1 while(True): if (X*ans) %360 == 0: break else: ans += 1 print(ans)
p03127
s312907044
Accepted
n = int(input()) A = list(map(int, input().split())) import fractions #import math from functools import reduce def gcd(*numbers): return reduce(fractions.gcd, numbers) #return reduce(math.gcd, numbers) def gcd_list(numbers): return reduce(fractions.gcd, numbers) #return reduce(math.gcd, numbers) g = gcd_list(A) print(g)
p02594
s697036625
Accepted
t=int(input()) if t>=30: print("Yes") else: print("No")
p02553
s586838944
Accepted
a,b,c,d = map(int, input().split()) print(max(a*c,a*d,b*c,b*d))