problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03862
s560128600
Accepted
n,x = map(int,input().split()) l = list(map(int,input().split())) count = 0 for i in range(n-1): if l[i]>x: count += (l[i]-x) l[i] -= (l[i]-x) if l[i]+l[i+1]>x: count += (l[i]+l[i+1]-x) l[i+1] -= (l[i]+l[i+1]-x) print(count)
p03352
s431899571
Wrong Answer
# AtCoder Beginner Contest 097 # B - Exponential X=int(input()) for i in range (X): a= (X-i)**0.5 if a==int(a): print(int(a)**2) exit()
p03331
s765631561
Accepted
N = int(input()) min = 1000000000 for i in range(1,N): A = str(N - i) B = str(i) temp = 0 for j in range(len(A)): temp += int(A[j]) for j in range(len(B)): temp += int(B[j]) if min > temp: min = temp print(min)
p03479
s972406157
Accepted
x,y=map(int,input().split()) ans=1 for i in range(1000): x=x*2 ans+=1 if x>=y: break print(ans+(0 if x==y else (-1)))
p03555
s480313014
Accepted
s1=input() s2=input() cnt=0 for i in range(len(s1)): if s1[i]==s2[-i-1]: cnt+=1 if cnt == 3: print("YES") else: print("NO")
p03037
s955113137
Accepted
N,M = list(map(int,input().split())) MAX = float('-inf') MIN = float('inf') for i in range(M): L,R = list(map(int,input().split())) MAX = max(MAX, L) MIN = min(MIN, R) count = MIN - MAX + 1 if count > 0: print(count) else: print(0)
p03645
s588663265
Accepted
n , m = map(int,input().split()) iki = set() nori = set() for i in range(m): a , b = map(int,input().split()) if a == 1: iki.add(b) if b == n: nori.add(a) if iki.isdisjoint(nori): print("IMPOSSIBLE") else: print("POSSIBLE")
p02694
s767550705
Accepted
x = int(input()) ans = 0 val = 100 while val < x: val = int(val * 1.01) ans += 1 print(ans)
p02660
s341796033
Accepted
m = int(input()) if m==1: print(0) exit() pf={} for i in range(2,int(m**0.5)+1): while m%i==0: pf[i]=pf.get(i,0)+1 m//=i if m>1:pf[m]=1 key=list(pf.keys()) used=[0]*len(key) #print(pf) cnt=0 for i in range(len(key)): k=key[i] tmp=0 while pf[k]>used[i]+tmp: tmp+=1 used[i]+=tmp cnt+=1 #print(used,tmp) print(cnt)
p03803
s037295939
Accepted
a,b=map(lambda x:(int(x)+13)%15,input().split()) print("Alice" if a>b else "Bob" if a<b else "Draw")
p03037
s381741186
Accepted
N, M = map(int, input().split()) table = [[int(i) for i in input().split()] for _ in range(M)] ans = [table[0][0], table[0][1]] cnt = 0 for i in table[1:]: if ans[0] <= i[0] <= ans[1]: ans[0] = i[0] if ans[0] <= i[1] <= ans[1]: ans[1] = i[1] if ans[1] < i[0] or i[1] < ans[0]: cnt += 1 break if cnt != 0: print(0) else: print(ans[1] - ans[0] + 1)
p03105
s901445917
Wrong Answer
a,b,c = map(int,input().split()) print(max(c,a//b))
p02597
s285657803
Accepted
ma = lambda :map(int,input().split()) ni = lambda:int(input()) yn = lambda fl:print("Yes") if fl else print("No") import collections import math import itertools import heapq as hq n = ni() cs = input() r = cs.count("R") print(cs[r:].count("R"))
p03785
s498382170
Accepted
N,C,K = map(int,input().split()) T = [int(input()) for _ in range(N)] T.sort() cnt = 0 pas = 0 time = T[0] for i in range(N-1): pas += 1 if pas and T[i] - time > K: pas,time = 1,T[i] cnt += 1 continue if pas == C: pas,time = 0,T[i+1] cnt += 1 print(cnt+1+(pas and T[N-1]-T[N-2]>=K))
p03723
s432942245
Wrong Answer
a, b, c=map(int, input().split()) if a==b and b==c: print(-1) else: cnt=0 while(1): if a%2==1 or b%2==1 or c%2==1: print(cnt) break cnt+=1 ha=a/2 hb=b/2 hc=c/2 a=hb+hc b=ha+hc c=ha+hb
p03761
s211263292
Accepted
n = int(input()) sn = [input() for _ in range(n)] ans = '' for s in sorted(set(sn[0])): cnt = min([sn[i].count(s) for i in range(n)]) ans += s*cnt print(ans)
p03852
s223401163
Accepted
s = input() aiueo = ["a", "i", "u", "e", "o"] if s in aiueo: print("vowel") else: print("consonant")
p02912
s575041327
Accepted
import math import heapq n, m = map(int, input().split()) a = [int(i) * (-1) for i in input().split()] heapq.heapify(a) i = 0 while i < m: max_a = - heapq.heappop(a) max_a /= 2 heapq.heappush(a, -max_a) i += 1 total = 0 for k in a: total += math.floor(-k) print(total)
p02765
s614134270
Accepted
n, r = map(int,input().split()) if n >= 10: print(r) else: print(r + 100 * (10 - n))
p02760
s961937717
Wrong Answer
A = [list(map(int, input().split())) for _ in range(3)] N = int(input()) b = [int(input()) for i in range(N)] def main(A, b): for i in range(3): for j in range(3): if not A[i][j] in b: break return "Yes" if (A[0][0] and A[1][1] and A[2][2]) in b: return "Yes" if (A[0][2] and A[1][1] and A[2][0]) in b: return "Yes" return "No" ans = main(A, b) print(ans)
p02952
s811606879
Wrong Answer
n=int(input()) cnt=0 for i in range(1, n): l=len(str(i)) if l%2==1: cnt+=1 print(cnt)
p03495
s295670064
Wrong Answer
n, k= map(int, input().split()) a = list(map(int, input().split())) print(len(set(a))-k+1 if len(set(a))>k else 0)
p03435
s299306530
Accepted
C = [list(map(int, input().split())) for _ in range(3)] x = C[0][0] a = [c[0] - x for c in C] b = [C[0][i]-a[0] for i in range(3)] ans = "Yes" for i in range(3): for j in range(3): if C[i][j] != a[i] + b[j]: ans = "No" print(ans)
p04019
s695872766
Accepted
S = input() NS = set() EW = set() for s in S: if s in ["N", "S"]: NS.add(s) if s in ["E", "W"]: EW.add(s) if len(NS) == 1 or len(EW) == 1: print("No") else: print("Yes")
p02681
s866212800
Accepted
if __name__ == "__main__": S = input() T = input() lenS = len(S) if (T[:lenS] == S and len(T) == lenS + 1): print("Yes") else: print("No")
p02627
s604798270
Accepted
a = input() if "A"<=a<="Z": print("A") elif "a"<=a<="z": print("a")
p03494
s094812868
Accepted
N = int(input()) lst = list(map(int, input().split())) flag = True count = 0 while flag: for i in range(N): if lst[i]%2 == 0: lst[i] = lst[i]/2 else: flag = False count += 1 print(count-1)
p02820
s036374327
Accepted
n, k = map(int, input().split()) r, s, p = map(int, input().split()) t = list(input()) d = {'r': p, 's': r, 'p': s} #勝ちスコア point = 0 for i in range(k): #kまでは普通に勝ってもよい point += d[t[i]] for i in range(k, n): #kからnまでは、k個前と同じなら、後の方を無得点化する if t[i] == t[i - k]: t[i] = 'x' continue point += d[t[i]] print(point)
p02688
s165594743
Accepted
N,K=map(int,input().split()) hoge=[0 for j in range(N)] for j in range(K): input() for i in input().split(): hoge[int(i)-1]+=1 print(sum([j==0 for j in hoge]))
p03944
s911676207
Accepted
W,H,N=map(int,input().split()) # 左下の座標 X=Y=0 for i in range(N): # 入力 x,y,a=map(int,input().split()) if a==1: X=max(X,x) elif a==2: W=min(W,x) elif a==3: Y=max(Y,y) else: H=min(H,y) # 出力 print(max(W-X,0)*max(H-Y,0))
p03544
s008876092
Wrong Answer
n = int(input()) l_list = [2, 1] if n < 2 : print(l_list[n]) else : for i in range(2,n+1) : new = l_list[i-1] + l_list[i-2] l_list.append(new) print(l_list[n])
p02642
s948452178
Accepted
n = int(input()) A = sorted(list(map(int, input().split()))) from collections import Counter c = Counter(A) dp = [1]*(max(A)+1) #print(dp) for i in c.keys(): j = i*2 while j<len(dp): dp[j] = 0 j += i #print(j, end=',') ans = 0 for i in c.keys(): if c[i] == 1: if dp[i] == 1: ans += 1 print(ans)
p04020
s683278462
Wrong Answer
N = int(input()) l = [] for i in range(N): l.append(int(input())) ans = 0 for i in range(N): ans += l[i] // 2 l[i] = l[i] % 2 if (0<i) and (l[i-1]+l[i]==2): ans += 1 l[i-1], l[i] = 0, 0 print(ans)
p03282
s838625369
Accepted
S = list(input()) for i in range(len(S)): S[i] = int(S[i]) K = int(input()) start = 1 loc = 101 for i in range(len(S)): if S[i] != 1: start = S[i] loc = i break if K > 100: print(start) elif K-1 >= loc: print(start) else: print(1)
p02694
s768534040
Wrong Answer
X = int(input()) S = 100 k = 0 while S < X: S = round(S*1.01) k += 1 print(k)
p02775
s184856017
Wrong Answer
n = input() digits = [] num_notes = 0 carry = 0 for _d in n[::-1]+'0': d = int(_d) + carry if d <= 5: num_notes += d carry = 0 else: num_notes += (10 - d) carry = 1 print(num_notes)
p03011
s635028149
Accepted
import sys input = sys.stdin.readline P=list(map(int,input().split())) print(sum(P)-max(P))
p03387
s200406254
Wrong Answer
abc = sorted(list(map(int,input().split()))) x = abc[0] y = abc[1] z = abc[2] cnt = (z-x)//2 + (z-y)//2 if z == 2*((z-x)//2)+x and z == 2*((z-y)//2)+y: print(cnt) elif z > 2*((z-x)//2)+x and z > 2*((z-y)//2)*y: print(cnt + 1) else: print(cnt + 2)
p03221
s293477158
Accepted
import bisect n,m=map(int,input().split()) a=dict() b=[] for i in range(m): p,y=map(int,input().split()) b.append((p,y)) if p not in a: a[p]=[y] else: a[p]+=[y] for i,l in a.items(): a[i]=sorted(l) for p,y in b: index=bisect.bisect_left(a[p],y)+1 a1=str(p).zfill(6) a2=str(index).zfill(6) print(a1+a2)
p03146
s431557969
Accepted
s=int(input()) a=set() a.add(s) cnt=2 while True: if s%2: t=3*s+1 else: t=s//2 if t in a: print(cnt) exit(0) a.add(t) cnt+=1 s=t
p03067
s911941296
Accepted
import sys import math import bisect def main(): a, b, c = map(int, input().split()) a, b = min(a, b), max(a, b) if c >= a and c <= b: print('Yes') else: print('No') if __name__ == "__main__": main()
p03644
s205083395
Accepted
#------------- N = int(input()) #------------- cnt = 0 while True: X = 2**cnt if N//2 >= X: cnt +=1 else: break print(X)
p02622
s294200747
Wrong Answer
S=input() T=input() S=list(S) T=list(T) for i in range(len(S)): if(S[i]!=T[i]): S[i]=T[i] print(i+1)
p02924
s051991382
Wrong Answer
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Created: Jul, 14, 2020 11:34:55 by Nobody # $Author$ # $Date$ # $URL$ __giturl__ = "$URL$" from sys import stdin input = stdin.readline def main(): N = int(input()) print(int((N-1)*N/2)) if(__name__ == '__main__'): main()
p02754
s816561377
Wrong Answer
N, A, B = map(int, input().split()) ans = int(N / (A + B)) r = N % (A + B) ans = ans + min(r, A) print(ans)
p03612
s715651364
Wrong Answer
N=int(input()) p=list(map(int,input().split())) ans=0 for i in range(N-1): if i+1==p[i]: temp=p[i+1] p[i+1]=p[i] p[i]=temp ans+=1 print(ans)
p03944
s725279255
Accepted
import numpy as np W, H, N = map(int, input().split()) BW = np.zeros([H,W]) for i in range(N): x, y, a = map(int, input().split()) if a == 1: BW[:, :x] = 1 elif a == 2: BW[:, x:] = 1 elif a == 3: BW[H-y:, :] = 1 elif a == 4: BW[:H-y, :] = 1 print(np.count_nonzero(BW-1))
p02584
s571065135
Accepted
X,K,D=map(int,input().split()) X=abs(X) m=min(K,X//D) X-=D*m K-=m K%=2 X-=D*K print(abs(X))
p02633
s852875250
Accepted
X = int(input()) k = 1 while True: if (X * k) % 360 == 0: print(k) exit() k += 1
p03328
s616945035
Wrong Answer
a, b = map(int, input().split()) temp = 0 bar_heights = [] for i in range(1, 1000): temp += i bar_heights.append(temp) for i in range(1, 499501): if (a + i) in bar_heights and (b + i) in bar_heights: print(i) break
p02621
s661502929
Accepted
a = int(input()) a2 = a*a a3 = a2*a print(a + a2 + a3)
p03076
s444758235
Accepted
a = [] for i in range(5): a.append(input()) ans = 0 a.sort(key = lambda x: x[-1]) flag = True for s in a: if s[-1] == '0' and flag: ans += int(s) elif flag: ans += int(s) flag = False else: x = int(s[-1]) ans += int(s) + 10 -x print(ans)
p02993
s501605512
Wrong Answer
S=input() if S[0]==S[1] or S[1]==S[2] or S[2]==S[3]: print("bad") else: print("good")
p02659
s958608476
Accepted
a,b=input().split() from decimal import * getcontext().prec = 100 a=Decimal(a) b=Decimal(b) print(int(a*b))
p03998
s775162233
Accepted
from collections import deque Sa = deque([s for s in str(input())]) Sb = deque([s for s in str(input())]) Sc = deque([s for s in str(input())]) def solve(turn): que = [] if turn == 'a': que = Sa elif turn == 'b': que = Sb elif turn == 'c': que = Sc if len(que) > 0: return que.popleft() else: return False this_turn = 'a' while True: next_turn = solve(this_turn) if next_turn == False: print(this_turn.upper()) break else: this_turn = next_turn
p03219
s221787693
Accepted
import math x, y = map(int,input().split()) print(math.floor(x + (y/2)))
p03329
s732714373
Wrong Answer
list=[1, 1, 1, 1, 1] for i in range(1, 7): list.append(6**i) for j in range(1, 7): list.append(9**i) sorted(list, reverse=True) N=int(input()) count=0 for i in list: if i < N: N=N-i count+=1 if i == N: count+=1 print(count)
p02881
s908217071
Accepted
import math ans=1000000000000000 n=int(input()) for i in range(1,int(math.sqrt(n))+2): if n%i==0: tmp = (i-1)+(int(n//i)-1) ans = min(tmp,ans) print(ans)
p02948
s140057540
Wrong Answer
import heapq n, m = map(int, input().split()) d = [] heapq.heapify(d) for _ in range(n): a, b = map(int, input().split()) heapq.heappush(d, (-b, -a)) cnt = m ans = 0 while True: hp = heapq.heappop(d) if hp[1]*(-1) <= cnt: ans += (hp[0]*(-1)) cnt -= 1 if cnt == 0 or (not d): break print(ans)
p04005
s540737568
Wrong Answer
a,b,c = map(int, input().split()) if a % 2 == 0 or b % 2 == 0 or c % 2 == 0: print(0) else: square = a*b*c/max(a,b,c) print(int(square))
p02813
s585855173
Wrong Answer
import itertools n = int(input()) p = list(map(int, input().split())) q = list(map(int, input().split())) count = 0 p_count = 0 q_count = 0 for v in itertools.permutations(sorted(p), n): if list(v) == p: p_count = count elif list(v) == q: q_count = count count += 1 print(abs(p_count - q_count))
p03767
s918326305
Accepted
N = int(input()) a = list(map(int, input().split())) a.sort() #print(a) # @0~N-1, !N,N+1,!N+2,N+3,!N+4, ... ,!N+N=2N a = a[N::2] print(sum(a))
p03127
s803115607
Wrong Answer
N = int(input()) A = list(map(int, input().split())) A.sort() dig = 0 a = A[0] while a >= 10: a = a // 10 dig += 1 ans = 2 for i in range(N): b = A[i] // 10 ** dig if b % 2 == 1: ans = 1 break print(ans * 10 ** dig)
p03408
s566052406
Accepted
N = int(input()) As = [input() for _ in range(N)] M = int(input()) Bs = [input() for _ in range(M)] c = max([As.count(a) - Bs.count(a) for a in As]) print(0 if c < 0 else c)
p03145
s161620285
Wrong Answer
a,b,c = map(int,input().split()) print(a*b*c/2)
p02882
s051544092
Wrong Answer
import math a,b,x = map(int,input().split()) def f(t): t = math.radians(t) if a * math.tan(t) <= b: return a**2 * b - a**2 * math.tan(t) / 2 else: return b**2 / math.tan(t) * a / 2 tmax = 90 tmin = 0 for i in range(10**5): tmid = tmin + (tmax-tmin) / 2 if f(tmid) < x: tmax = tmid else: tmin = tmid print(tmid)
p02773
s685642511
Wrong Answer
n,*s=open(0).read().split() t=set(sorted(s)) c=[0]*len(t) for i,a in enumerate(t): c[i]=s.count(a) m=max(c) for i,a in zip(c,t): if i==m: print(a)
p03035
s330894128
Accepted
a,b=map(int,input().split()) if a>=13: print(b) if a<=12 and a>=6: print(int(b/2)) if a<=5: print(0)
p02923
s758334786
Wrong Answer
n = int(input()) h = [int(xi) for xi in input().split()] step =0 mstep = 0 for xi in range(n-1): if h[xi]>=h[xi+1]: step +=1 # print("ok") else: if mstep<step: mstep = step step = 0 # print("ng") if mstep<step: mstep = step print(mstep)
p02694
s865340739
Wrong Answer
X = int(input()) n = 100 year_count = 0 while n < X: # n = int(n * 1.01) n *= 1.01 n = int(n) year_count += 1 print(year_count)
p03435
s550070849
Wrong Answer
cc = [list(map(int, input().split())) for i in range(3)] tc = [sum(x) for x in cc] if sum(tc) % 3 != 0: print('No') else: print('Yes')
p03799
s108566118
Accepted
N, M = map(int, input().split()) if 2 * N > M: print(M // 2) else: C = M // 2 n = (C - N) // 2 print(max(min(N+n-1, C-n+1), min(N+n, C-n), min(N+n+1, C-n-1)))
p03545
s531014652
Accepted
S = list(input()) L = len(S) for i in range(0, 1 << L-1): f = S[0] ans = int(S[0]) for j in range(L-1): if (i >> j) & 1: f += "+" f += S[j+1] ans += int(S[j+1]) else: f += "-" f += S[j+1] ans -= int(S[j+1]) if ans == 7: print(f, "=7", sep="") exit()
p02792
s971116331
Wrong Answer
n=int(input()) l=[[0]*9]*9 for i in range(1,n): 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)
p02982
s330335601
Accepted
n,d = map(int, input().split()) arr = [] for i in range(n): arr.append(list(map(int, input().split()))) res = 0 for i in range(n-1): for j in range(i+1,n): dist = 0 for k in range(d): dist += (arr[i][k] - arr[j][k])**2 if dist == float(int(pow(dist,1/2))**2): res += 1 print(res)
p02946
s033421154
Wrong Answer
X, K = map(int, input().split()) lis = list() if X == 1: lis.append(K) else: for i in range(K - X +1,K + X -1): lis.append(i) for j in lis: print(j,end=" ")
p02801
s900908551
Accepted
import sys def I(): return int(sys.stdin.readline().rstrip()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) #空白あり def LI2(): return list(map(int,sys.stdin.readline().rstrip())) #空白なし def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) #空白あり def LS2(): return list(sys.stdin.readline().rstrip()) #空白なし C = S() print(chr(ord(C)+1))
p02661
s087456930
Wrong Answer
n = int(input()) info = [list(map(int, input().split())) for i in range(n)] if n % 2 == 1: info = sorted(info) l = info[n // 2][0] info = sorted(info)[::-1] r = info[n // 2][1] print(r - l + 1) else: info = sorted(info) l, lmax = info[n // 2 - 1] info = sorted(info)[::-1] rmin, r = info[n // 2 - 1] length = [] for i in range(n): length.append(min(r, info[i][1]) - max(l, info[i][0]) + 1) length = sorted(length, reverse=True) print(length[0] + length[1] - 1)
p02917
s945319411
Wrong Answer
n = int(input()) b = list(map(int,input().split())) result = b[0] + b[-1] for i in range(len(b)-2): c = [b[i+1],b[i+2]] result += min(c) if n == 3: result = b[0]*2 + b[1] print(result)
p02759
s042444093
Accepted
from math import ceil n=int(input()) print(ceil(n/2))
p02724
s587375722
Accepted
X = int(input()) s1, a = divmod(X, 500) s2 = a // 5 print(s1*1000+s2*5)
p02687
s836281069
Accepted
s=input() if s[1]=="B": print("ARC") else: print("ABC")
p02594
s768606604
Accepted
x = int(input()) if x >= 30: print("Yes") else: print("No")
p02778
s816883656
Accepted
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' ------------------------ author : iiou16 ------------------------ ''' def main(): S = input() s = len(S) out = "x" * s print(out) if __name__ == '__main__': main()
p02994
s180480663
Accepted
N,L=map(int,input().split()) s=[] for i in range(1,N+1): s.append(L+i-1) s.sort(key=lambda x: abs(x)) del s[0] print(sum(s))
p03309
s069798798
Accepted
n=int(input()) l=list(map(int,input().split())) m=sorted([a-i for i,a in enumerate(l, start=1)]) b1,b2=m[n//2],m[n//2-1] print(min(sum([abs(a-b1) for a in m]),sum([abs(a-b2) for a in m])))
p02598
s428877347
Accepted
import math def resolve(): _,K = list(map(int, input().split())) A = list(map(int, input().split())) start = 0 end = 10**9 while end - start > 1: cnt = 0 mid = (start + end) // 2 for a in A: cnt += math.ceil(a/mid) - 1 if cnt <= K: end = mid else: start = mid print(end) resolve()
p02723
s043655069
Accepted
date=input() date=list(date) if date[2]==date[3] and date[4]==date[5]: print("Yes") else: print("No")
p03331
s921552424
Accepted
n = int(input()) def Checker(sum, x): sum = 0 while x > 0: sum += x % 10 x = x // 10 return sum sum_list = [] for a in range(1, n): b = n - a sum_a = 0 sum_b = 0 y = Checker(sum_a, a)+ Checker(sum_b, b) sum_list.append(y) print(min(sum_list))
p02676
s484318931
Accepted
k = int(input()) s = input() if len(s) <= k: print(s) else: print(s[:k]+"...")
p04029
s814581399
Wrong Answer
N = int(input()) # 1+2+3+4+...+(N-2)+(N-1)+N # N+(N-1)+(N-2)+...+4+3+2+1 # 上と下を足し算して、2で割る a = N+1 b = N print( a * b / 2 )
p02706
s848109222
Accepted
n, m = [int(i) for i in input().split(' ')] s = sum(int(i) for i in input().split(' ')) x = max(n - s, -1) print(x)
p03479
s125577400
Accepted
X, Y = map(int, input().split()) cnt = 0 while X <= Y: X *= 2 cnt += 1 else: print(cnt)
p02699
s868175316
Accepted
n,m = map(int,input().split()) if(m>=n): print("unsafe") else: print("safe")
p02795
s753917178
Accepted
import math h = int(input()) w = int(input()) n = int(input()) m = max(h, w) answer = math.ceil(n / m) print(answer)
p04029
s805790573
Accepted
N = int(input()) print(int(N * (N + 1) / 2))
p03317
s196555184
Wrong Answer
import math n , k = map(int, input().split()) a = list(map(int, input().split())) print(math.ceil(n/k))
p02624
s973528307
Accepted
def main(): N = int(input()) d = [2 for _ in range(N+1)] d[1] = 1 # v = int(math.sqrt(N)) for i in range(2, N//2+1): for j in range(i+i, N+1, i): d[j] += 1 # if j//i > v: d[j] += 1 ans = 0 for i in range(1, N+1): ans += i * d[i] return ans if __name__ == '__main__': print(main())
p03095
s474090556
Wrong Answer
from itertools import combinations N = int(input()) S = input() chars = set() cnt = {} for s in S: if s not in chars: chars.add(s) cnt[s] = 1 else: cnt[s] += 1 ans = N r = 2 chars = list(chars) while r <= len(chars): combs = combinations(chars, r) for comb in combs: res = 1 for c in comb: res *= cnt[c] ans += res r += 1 print(ans)
p03457
s606297336
Accepted
n = int(input()) txy = [] for i in range(n): txy.append(list(map(int, input().split()))) flag = True px, py = 0, 0 for i in range(n): t, x, y = txy[i] d = abs(x-px) + abs(y-py) if d <= t: if d % 2 != t % 2: flag = False else: flag = False if flag: print("Yes") else: print("No")