problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03379
s625581854
Accepted
n = int(input()) x = list(map(int,input().split())) y = sorted(x) lidx = n//2 sidx = lidx-1 for v in x: if v <= y[sidx]: print (y[lidx]) else: print (y[sidx])
p02963
s035676426
Accepted
def main(s): #s=10**17-0 a=10**9 if s<=10**9: x1,y1,x2,y2,x3,y3=0,0,s,0,0,1 elif s%a==0: x1,y1,x2,y2,x3,y3=0,0,a,0,a,s//a else: x1,y1=0,0 x2,y2=s//a+1,a-s%a x3,y3=1,a print(x1,y1,x2,y2,x3,y3) if __name__=='__main__': s=int(input()) main(s)
p02657
s206950521
Wrong Answer
# -*- coding: utf-8 -*- import sys # スペース区切りの整数の入力 N, *d = map(int, open(0).read().split()) A = 1 for O in d: A = A*O print(O) if A > 10 ** 18: A = -1 break print(A)
p03494
s849718227
Wrong Answer
N = int(input()) A = input().split() count = 0 count_min = 0 for i in range(N): count = 0 Ai = int(A[i]) while Ai % 2 == 0: count += 1 Ai = Ai / 2 if count_min == 0: count_min = count elif count_min > count: count_min = count print(count_min)
p02786
s891272789
Accepted
import sys H = int(input()) if H == 1: print(1) sys.exit(0) ans = 0 count = 0 while H > 0: H = H // 2 ans += 2**count count += 1 print(ans)
p02663
s791441256
Accepted
H1, M1, H2, M2, K = map(int, input().split()) print((H2 - H1) * 60 + (M2 -M1) - K)
p02642
s677374303
Wrong Answer
N = input() A = list(map(int, input().split())) A.sort() first = A[0] cnt = 0 while cnt < len(A): div = A[cnt] for l in range(cnt): if div%A[l] == 0: continue delete_index = [] for k in range(cnt+1, len(A)): amari = A[k] % div if amari == 0: delete_index.append(k) for j in sorted(delete_index, reverse=True): A.pop(j) cnt += 1 if len(A)==1 and A[0]==first: print(0) else: print(len(A))
p02987
s753310477
Accepted
s=input() s0=s[0] s1=s[1] if s0==s1: if s[2]==s[3] and s[2]!=s0: print("Yes") else: print("No") else: if (s[2]==s0 and s[3]==s1) or (s[2]==s1 and s[3]==s0): print("Yes") else: print("No")
p02552
s855308511
Accepted
def main(): import sys input = sys.stdin.readline sys.setrecursionlimit(10**6) x = int(input()) print(x ^ 1) if __name__ == '__main__': main()
p02900
s188867169
Wrong Answer
a,b = [int(x) for x in input().split()] import fractions g = fractions.gcd(a,b) ans = 1 flag = 0 mama = int(g**(1/2)) for i in range(2,mama+1): while True: if a%i != 0 or b%i != 0: break else: a = a/i b = b/i flag = 1 if flag == 1: ans += 1 flag = 0 if g == a and ans == 1: ans += 1 print(ans)
p02754
s518099936
Accepted
N, A, B = list(map(int, input().split())) shou = N // (A + B) amari = N % (A + B) print(shou * A + min(A, amari))
p03455
s293605717
Accepted
A,B = map(int, input().split()) if A*B%2 == 0: print('Even') else: print('Odd')
p03524
s891269874
Accepted
S=input() k=S.count('a') l=S.count('b') m=S.count('c') if abs(k-l)<=1 and abs(l-m)<=1 and abs(m-k)<=1: print('YES') else: print('NO')
p03408
s001185682
Wrong Answer
s = [] t = [] N = int(input()) for _ in range(N): s.append(str(input())) M = int(input()) for _ in range(M): t.append(str(input())) from collections import Counter sc = Counter(s) tc = Counter(t) s_keys, s_values = zip(*sc.most_common()) t_keys, t_values = zip(*tc.most_common()) ans = 0 for i in range(len(s_values)): for j in range(len(t_values)): minus = 0 if s_keys[i] == t_keys[j]: minus = t_values[j] ans = max(ans, s_values[i] - minus) print(ans)
p02778
s744192390
Accepted
# -*- coding:utf-8 -*- def solve(): S = input() ans = "" for moji in S: ans += "x" print(ans) if __name__ == "__main__": solve()
p02613
s304683574
Wrong Answer
import math def main(): judge_l = {'AC':0, 'WA':0, 'TLE':0, 'RE':0} l = int(input().rstrip()) for i in range(l): judge = input().rstrip() judge_l[judge] += 1 for key in judge_l.keys(): print('{} × {}'.format(key, judge_l[key])) if __name__ == "__main__": main()
p02708
s573067237
Accepted
mod=10**9+7 N,K=map(int,input().split()) ans=0 for i in range(K,N+2): MIN=(i*(i-1))//2 MAX=((N+1)*N)//2-((N-i+1)*(N-i))//2 ans+=MAX-MIN+1 ans%=mod #print(i,MIN,MAX) print(ans)
p03434
s043713532
Accepted
N = int(input()) A = list(map(int,input().split())) A.sort(reverse=True) Alice = 0 Bob = 0 for i in range(N): if i%2 == 0: Alice += A[i] else : Bob += A[i] print(Alice - Bob)
p03043
s526871750
Accepted
from fractions import Fraction N , K = list(map(int,input().split())) denom_list = [] Z=0 def detame_keisan( N , K , i ): kijun = K score = i count = 0 while score < kijun: count += 1 score = ( score * 2 ) return N * (2 ** count) for i in range( 1,N+1 ): X = detame_keisan( N , K , i) denom_list.append( X ) for item in denom_list: #Z += 1/item Z += Fraction(1, item) #print( Z) print( float( Z ))
p02744
s241589180
Wrong Answer
N = int(input()) arr=[1]*N if(N==1): print("a") exit() def num2alpha(num): return chr(num+96) def keta(num): if(arr[num-1]<arr[num]): keta(num-1) else: for k in range(num+1,N): arr[k] = 1 arr[num] += 1 i = N-1 while arr[0]==1: ans = map(num2alpha,arr) print((''.join(ans))) keta(N-1)
p03385
s973803945
Wrong Answer
n = sorted(input()) print("Yes" if n == "abc" else "No")
p02916
s664405330
Accepted
n=int(input()) l=list(map(int,input().split())) d=list(map(int,input().split())) k=list(map(int,input().split())) s=sum(d) for i in range(n-1): if(l[i]+1==l[i+1]): s+=k[l[i]-1] print(s)
p03821
s414571696
Accepted
import sys sys.setrecursionlimit(10 ** 7) input = sys.stdin.readline n = int(input()) a = [0]* n b = [0]* n for i in range(n): a[i], b[i] = map(int, input().split()) ans= 0 for i in reversed(range(n)): a[i]+=ans tmp = -(-a[i] // b[i]) ans += tmp*b[i]-a[i] print(ans)
p02682
s524189863
Accepted
A,B,C,K = map(int,input().split()) if A >= K: print(K) elif A+B >= K: print(A) else: print(A-(K-A-B))
p03545
s051213000
Accepted
def dfs(i, f, sum): if i == 3: if sum == 7: print(f + '=7') exit() else: dfs(i + 1, f + '-' + s[i + 1], sum - int(s[i + 1])) dfs(i + 1, f + '+' + s[i + 1], sum + int(s[i + 1])) s = input() dfs(0, s[0], int(s[0]))
p03323
s575504208
Accepted
a,b=map(int,input().split()) if a>8 or b>8: print(":(") else: print("Yay!")
p03548
s481878660
Accepted
x, y, z = map(int, input().split()) print((x-z)//(y+z))
p02796
s112844568
Accepted
n=int(input()) rob=[list(map(int,input().split())) for i in range(n)] rob=[[sum(rob[i]), rob[i][0]-rob[i][1]] for i in range(n)] rob.sort(key=lambda i:i[0]) robp=[rob[i][0] for i in range(n)] robm=[rob[i][1] for i in range(n)] #print(robp) #print(robm) ans=0 x=-10**9 for i in range(n): if x<=robm[i]: ans+=1 x=robp[i] print(ans)
p03220
s203168655
Accepted
# input N = int(input()) T, A = map(int, input().split()) H = list(map(int, input().split())) check = [] append = check.append for i, h in enumerate(H): append( { "index": i + 1, "temp": T - h * 0.006 } ) check.sort(key=lambda x: abs(A - x["temp"])) print(check[0]["index"])
p02727
s231048497
Accepted
from collections import deque x, y, a, b, c = map(int, input().split()) p = list(map(int, input().split())) p.sort(reverse=True) q = list(map(int, input().split())) q.sort(reverse=True) r = list(map(int, input().split())) ans = [] ans.extend(p[:x]) ans.extend(q[:y]) ans.extend(r) ans.sort(reverse=True) print(sum(ans[:x+y]))
p02797
s982000172
Wrong Answer
n, k, s = map(int, input().split()) if k == n: print(" ".join([str(s) for _ in range(n)])) exit() x = 0 if k == 0: arr = [s - 1] else: arr = [1] while True: if x == k: break arr.append(s - arr[-1]) x += 1 while len(arr) < n: arr.append(8 ** 9 + 9999) # テキトー print(" ".join(list(map(str, arr))))
p02678
s865458368
Wrong Answer
n, m = tuple(map(int, input().split())) paths = [tuple(map(int, input().split())) for _i in range(m)] shirube = [0] * n for f, t in paths: temp_path = shirube[f - 1] + 1 if shirube[t - 1] == 0 or temp_path < shirube[t - 1]: shirube[t - 1] = temp_path if all([e != 0 for e in shirube[1:]]): print("Yes") else: print("No") for e in shirube[1:]: print(e)
p03338
s168771263
Accepted
# coding: utf-8 # https://atcoder.jp/contests/abc098/tasks/abc098_b def main(): N = int(input()) S = input() ans = 0 for i in range(1, N): X = S[:i] Y = S[i:] tmp = 0 for code in range(97, 97+26): c = chr(code) if c in X and c in Y: tmp += 1 if tmp > ans: ans = tmp return ans print(main())
p02879
s004083517
Accepted
a, b = map(int, input().split()) if 0<a<10 and 0<b<10: print(a*b) else: print(-1)
p02676
s474388419
Accepted
K=int(input()) S=list(input()) T=int(len(S)) if T>K: X=S[0:K] Y=str("".join(X)) Z=str("...") print(Y+Z) else: print("".join(S))
p02624
s572054598
Accepted
n = int(input()) ans = 0 for i in range(1, n + 1): for j in range(i, n + 1, i): ans += j print(ans)
p03659
s585293623
Accepted
n=int(input()) a=list(map(int,input().split())) t=sum(a) m=10**9 flag=0 for i in range(len(a)-1): t-=2*a[i] if i==0: m=abs(t) else: m=min(abs(t),m) print(m)
p02854
s338943399
Wrong Answer
n = int(input()) a = list(map(int,input().split())) num = sum(a) x = 0 ans = 10**9 for i in range(n): x += a[i] num -= a[i] ans = min(ans,abs(num-x)) print(ans)
p02725
s069376805
Accepted
import numpy as np k, n = map(int, input().split()) A = list(map(int, input().split())) A.append(A[0] + k) a = np.array(A) max_dist = np.max(np.diff(A)) print(k - max_dist)
p03127
s452908011
Accepted
def gcd(a,b): while b!=0: a,b=b,a%b return a n = int(input()) l = list(map(int,input().split())) l.sort() tmp = gcd(l[0],l[1]) for i in range(2,len(l)): tmp = gcd(tmp,l[i]) print(tmp)
p03071
s139813815
Accepted
a, b = map(int, input().split()) ans = 0 for _ in range(2): choice = max(a, b) ans += choice if choice == a: a -= 1 else: b -= 1 print(ans)
p03252
s474442785
Wrong Answer
s = input() t = input() d = dict() for i in range(len(s)): if not s[i] in d: d[s[i]] = t[i] else: if d[s[i]] != t[i]: print('No') exit() print('Yes')
p02836
s116094808
Accepted
s = input() counter = 0 for i in range(int(len(s)/2)): if s[i] != s[len(s) - 1 - i]: counter += 1 print(counter)
p02627
s203732951
Accepted
a = input() if a.isupper(): print("A") else: print("a")
p03612
s118612986
Accepted
N = int(input()) p = list(map(int, input().split())) i = 0 ans = 0 while i < N: if p[i] == i+1: if (i+1<N) and (p[i+1]==i+2): ans += 1 i += 2 else: ans += 1 i += 1 else: i += 1 print(ans)
p02583
s206891974
Wrong Answer
n=int(input()) boulist=list(map(int,input().split())) boulist.sort(reverse=True) count=0 for i in range(n): for j in range(i,n): for k in range(j,n): if boulist[j] != boulist[k] and boulist[i] != boulist[j] and boulist[i]+boulist[j]>boulist[k]: count+=1 print(count)
p02658
s917744400
Wrong Answer
N = int(input()) a = [int(i) for i in input().split()] A = 1 if 0 in a: A = 0 else: for i in range(N-1): A = A * a[i] if A > 1000000000000000000: A = -1 break print(A)
p03107
s081141174
Accepted
s = str(input()) s_0,s_1 = 0,0 for i in range(len(s)): if(s[i] == "0"): s_0 += 1 else: s_1 += 1 c = len(s)-(max(s_0,s_1)-min(s_0,s_1)) print(c)
p02708
s123978349
Accepted
#!/usr/bin/python3 from functools import reduce from operator import add import sys def main(): N, K = map(int, input().split(' ')) sys.setrecursionlimit(N + 50) C = 1 for i in range(K, N + 1): C += (N * (N + 1) // 2 - (N - i) * (N - i + 1) // 2) \ - ((i * (i - 1)) // 2) \ + 1 print(C % 1000000007) if __name__ == '__main__': main()
p02777
s126665965
Accepted
S,T = input().split() A,B = map(int,input().split()) U = input() if S==U: A -= 1 else: B -= 1 print(A,B)
p02727
s847378011
Accepted
import sys from collections import deque sys.setrecursionlimit(10 ** 7) read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines X, Y, A, B, C = map(int, input().split()) P = list(map(int, input().split())) Q = list(map(int, input().split())) R = list(map(int, input().split())) P.sort(reverse=True) Q.sort(reverse=True) R.sort(reverse=True) P = P[:X] Q = Q[:Y] ALL = P + Q + R ALL.sort(reverse=True) ans = sum(ALL[: X + Y]) print(ans)
p03377
s632456760
Wrong Answer
a,b,c=map(int,input().split()) if a<=c: if a+b>=c: print('Yes') else: print('No') else: print('No')
p03221
s260216831
Accepted
from collections import defaultdict def main(): d = defaultdict(int) n, m = [int(i) for i in input().split()] py = {} for i in range(m): p, y = [int(i) for i in input().split()] py[i] = (p, y) res = [''] * m for v in sorted(py.items(), key=lambda x:x[1]): d[v[1][0]] += 1 res[v[0]] = str(v[1][0]).zfill(6) + str(d[v[1][0]]).zfill(6) for r in res: print(r) if __name__ == '__main__': main()
p03699
s252814417
Accepted
n = int(input()) a = [int(input()) for _ in range(n)] s = sum(a) m = s if s % 10: print(s) exit() for x in a: if x % 10: m = min(m, x) else: print(s - m)
p02660
s959947394
Wrong Answer
n = int(input()) cnt = 0 cntN = n for i in range(2,n+1): p = i while n%p ==0: cnt += 1 cntN /= p p *= p if cntN+1 <= i: break print(cnt)
p03449
s087193452
Accepted
n = input() a = [list(map(int,raw_input().split())) for i in range(2)] print max([sum(a[0][:i+1])+sum(a[1][i:]) for i in range(n)])
p02675
s532424598
Accepted
n = input() hon = ["2", "4", "5", "7", "9"] pon = ["0", "1", "6", "8"] bon = ["3"] if n[-1] in hon: print("hon") elif n[-1] in pon: print("pon") else: print("bon")
p03239
s298771735
Accepted
N,T=map(int,input().split()) cc=1001 for i in range(N): c,t=map(int,input().split()) if cc>c and T>=t: cc=c if cc==1001: print("TLE") else: print(cc)
p03617
s503856907
Wrong Answer
a = input().split() q = int(a[0]) * 4 h = int(a[1]) * 2 s = int(a[2]) d = int(a[3]) / 2 b = int(input()) if min([q,h,s,d]) != d: print(int(b * min([q,h,s]))) else: if b % 2 == 0: print(int(b * d)) elif b != 1: print(int((b-1) * d + min([q,h,s]))) else: print(int(min([q,h,s])))
p02572
s597421579
Accepted
n=input() a = list(map(int,input().split())) suma = sum(a) r = 0 for i in range(0, len(a) - 1): suma -= a[i] r += a[i] * suma print(r % (10 ** 9 + 7))
p04043
s061326851
Accepted
icase=42 if icase==42: a=list(map(int,input().split())) a.sort() if a[0]==5 and a[1]==5 and a[2]==7: print("YES") else: print("NO")
p02842
s914965248
Accepted
n = int(input()) stp = int(n/1.08) while True: cost = int(stp*1.08) if cost == n: ans = stp break elif cost > n: ans = ':(' break else: stp += 1 print(ans)
p02676
s887393388
Accepted
k = int(input()) s=input() if len(s) <= k: print(s) else: print(f'{s[:k]}...')
p02881
s618569497
Accepted
n=int(input()) t=int(n**0.5)+2 ans=10**18 for i in range(1,t): if n%i==0: if ans>(i-1)+((n//i)-1): ans=(i-1)+((n//i)-1) print(ans)
p02712
s071203519
Wrong Answer
n=int(input()) summ=0 for i in range(1,n): if i%3!=0 and i%5!=0: summ+=i print(summ)
p03705
s306517480
Accepted
n,a,b = map(int, input().split()) if n == 1 and abs(a-b) + 1 != n: print(0) elif a > b: print(0) else: print((b*(n-1)+a) - (a*(n-1)+b) + 1)
p02552
s635533529
Accepted
def resolve(): x = int(input()) print(1 if x == 0 else 0) if __name__ == '__main__': resolve()
p03069
s818760638
Wrong Answer
N = int(input()) print(input().count('#.'))
p03075
s512991071
Accepted
x = [int(input()) for _ in range(6)] if x[4] - x[0] <= x[5]: print('Yay!') else: print(':(')
p03077
s772304643
Wrong Answer
from math import floor N = int(input()) l = [None] * 5 for i in range(5): l[i] = int(input()) split = 0 if floor(N/min(l)) <= 1 else floor(N/min(l)) print(5+split)
p03774
s361393046
Accepted
n, m = map(int, input().split()) student = [] for i in range(n): student.append(tuple(map(int, input().split()))) point = [] for i in range(m): point.append(tuple(map(int, input().split()))) for i in range(n): dis = 10 ** 20 idx = 0 for j in range(m): temp = abs(student[i][0] - point[j][0]) + abs(student[i][1] - point[j][1]) if temp < dis: dis = temp idx = j + 1 print(idx)
p03449
s235729150
Accepted
N = int(input()) A = [list(map(int, input().split())) for x in range(2)] ans = 0 for i in range(N): res = sum(A[0][:i+1]) + sum(A[1][i:]) if res > ans: ans = res print(ans)
p02802
s159465530
Accepted
import numpy as np # 入力 N,M = map(int,input().split()) Check_AC = np.zeros(N) WA_Counter = np.zeros(N) for i in range(M): pi,Si = input().split() pi = int(pi) # まだ正解していない問題 if Check_AC[pi-1] == 0: if Si == "AC": Check_AC[pi-1] = 1 else: WA_Counter[pi-1] += 1 print(str(int(sum(Check_AC))) + " " + str(int(np.dot(Check_AC,WA_Counter))))
p02712
s739897839
Accepted
N = int(input()) A=0 for i in range(1,N+1): if not ((i%3==0 and i%5==0) or i%3==0 or i%5==0): A=A+i print(A)
p02935
s802501001
Accepted
n=int(input()) lst=map(int, input().split()) lst=sorted(lst, reverse=True) new=[lst[i]*(1/2)**(i+1) for i in range(n-1)] print(sum(new)+lst[-1]*(1/2)**(n-1))
p03379
s871955597
Accepted
n = int(input()) x = list(map(int, input().split())) # list() xsorted = sorted(x) mannaka=n//2 median_a = xsorted[mannaka-1]#3 median_b = xsorted[mannaka]#4 ''' print(x) print(xsorted) print(mannaka) print(median_a) print(median_b) ''' for i in range(n): if(x[i]<=median_a): print(median_b) else: print(median_a)
p02862
s622050824
Accepted
MOD=10**9+7 x , y = map(int, input().split()) a=(2*x-y)//3 b=(2*y-x)//3 if 2*a+b!=x: print(0) exit() factorial = [1] inverse = [1] n=a+b r=a for i in range(1, n+2): factorial.append(factorial[-1] * i % MOD) inverse.append(pow(factorial[-1], MOD - 2, MOD)) def combi(n, r): if n < r or r < 0: return 0 elif r == 0: return 1 return factorial[n] * inverse[r] * inverse[n - r] % MOD ans = combi(n,r) print(ans)
p04030
s177865494
Accepted
def main(): s = input() display = list() for i in range(len(s)): if s[i] == "B" : if len(display) > 0: display.pop() else: display.append(s[i]) print("".join(map(str,display))) main()
p02729
s834045543
Wrong Answer
s = input() n = len(s) if(s==s[::-1] and s[:(n-1)//2]==s[:(n-1)//2][::-1]): print('Yes') else: print('No')
p02854
s478242424
Wrong Answer
n = int(input()) as_ = list(map(int, input().strip().split())) total_length = sum(as_) current = 0 for a in as_: if current + a == total_length // 2: print(0) exit(0) if current + a > total_length / 2: candidate1 = current candidate2 = current + a break current += a ans = min(total_length - candidate1, total_length - candidate2) print(ans)
p03681
s699764355
Accepted
import math as m N,M=map(int,input().split()) w=1000000007 if abs(N-M)<2: if N==M: print((m.factorial(N)**2*2)%w) else: print((m.factorial(N)*m.factorial(M))%w) else: print(0)
p03720
s177228378
Accepted
#061_B n,m=map(int,input().split()) ans=[0 for _ in range(n)] for _ in range(m): a,b=map(int,input().split()) ans[a-1]+=1 ans[b-1]+=1 print(*ans,sep='\n')
p02951
s318741492
Wrong Answer
a, b, c = map(int, input().split()) print(c-(a-b))
p02916
s907933313
Wrong Answer
n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) c=list(map(int,input().split())) s=0 s += sum(b) for i in range(n-1): if a[i]==a[i+1]+1: s += c[i-1] print(s)
p03456
s842094798
Wrong Answer
a, b = map(str, input().split()) ab = int(a+b) flag = False for i in range(110): if i**2 == ab: flag = True if flag: print("Yes") else: print("No")
p02754
s857721922
Wrong Answer
n, a, b = map(int, input().split()) Total = n d = a + b c = n // d n = n % d if n <= a: print(Total - c*b) else: print(a * c)
p03455
s744563839
Accepted
# A - Product a,b=list(map(int,input().split())) if (a*b)%2==0: print("Even") else: print("Odd")
p03030
s731292747
Accepted
N = int(input()) iSP = [] for i in range(N): S, P = input().split() iSP.append([i + 1, S, int(P)]) iSP.sort(key = lambda x: x[2], reverse = True) iSP.sort(key = lambda x: x[1]) for x in iSP: print(x[0])
p03127
s131528730
Accepted
from math import * N=int(input()) A=list(map(int,input().split())) c=A[0] for i in range(N): c=gcd(A[i],c) print(c)
p02693
s838793341
Accepted
n = int(input()) a, b = map(int, input().split()) ans = 'NG' for i in range(a, b+1): if i % n == 0: ans = 'OK' break print(ans)
p03210
s181870561
Accepted
X=input() if X in '753': print('YES') else: print('NO')
p04012
s020438786
Wrong Answer
# -*- coding:utf-8 -*- import sys input = sys.stdin.readline w = input() w_set = set(w) for i in w_set: if w.count(i)%2==1: print("No") sys.exit() else: continue print("Yes")
p02795
s343451817
Wrong Answer
H = int(input()) W = int(input()) N = int(input()) print(N // max(H, W))
p03351
s122042146
Accepted
a, b, c, d = map(int, input().split()) if abs(c-a)<=d: print('Yes') elif abs(b-a)<=d and abs(c-b)<=d: print('Yes') else : print('No')
p03449
s774130117
Accepted
n = int(input()) a = [list(map(int, input().split())) for i in range(2)] print(max(sum(a[0][: i + 1] + a[1][i:]) for i in range(n)))
p02548
s851538359
Accepted
n = int(input()) ans = 0 for a in range(1, n): ans += (n - 1) // a print(ans)
p03241
s330467503
Wrong Answer
from math import sqrt from math import floor n,m = map(int,input().split()) d = m // n ans = 1 for i in range(1,floor(sqrt(m))+1): if m % i == 0: if i <= d: ans = i else: break print(ans)
p02823
s683986666
Accepted
n,a,b = map(int,input().split()) if a%2 == b%2: print((b-a)//2) else: print(min(a-1,n-b)+1+(b-a-1)//2)
p03208
s477226382
Wrong Answer
import numpy as np n,k=map(int,input().split()) H=[int(input()) for i in range(n)] H.sort() H=np.array(H) Hb,Ha=H[-k:],H[:k] print(min(Hb-Ha))
p03319
s268907049
Wrong Answer
N, K = map(int, input().split()) A = list(map(int, input().split())) print(-(-N // (K - 1)))