problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03804
s601338234
Wrong Answer
N,M = map(int, input().split()) A = [input() for _ in range(N)] B = [input() for _ in range(M)] def func(): for i in range(N-M+1): for j in range(N-M+1): if B[0] == A[i][j:j+M]: for k in range(1, M): if B[k] != A[i+k][j:j+M]: return False return True return False print('Yes' if func() else 'No')
p03637
s283027127
Wrong Answer
N = int(input()) a = [int(x) for x in input().split()] cnt4 = 0 cnt2 = 0 for x in a: if x % 4 == 0: cnt4 += 1 continue if x % 2 == 0: cnt2 += 1 if N-cnt2 > 2*cnt4: print('No') else: print('Yes')
p02995
s763294440
Accepted
import fractions A, B, C, D = (int(abcd) for abcd in input().split()) lcm_CD = C*D // fractions.gcd(C, D) in_B = B - ((B//C + B//D) - B//lcm_CD) in_under_A = (A-1) - (((A-1)//C + (A-1)//D) - (A-1)//lcm_CD) print(in_B - in_under_A)
p03475
s532995375
Accepted
N = int(input()) CSF = [list(map(int, input().split())) for _ in range(N - 1)] for i in range(N): t = 0 for c, s, f in CSF[i:]: if t > s: if t % f: t += f - t % f else: t = s t += c print(t)
p03852
s439757253
Accepted
p = input() if p=='a' or p=='i' or p=='u' or p=='e' or p=='o': print('vowel') else: print('consonant')
p02811
s570405321
Accepted
K,X=[int(x) for x in input().rstrip().split()] if (X<=K*500): print("Yes") else: print("No")
p03644
s679651477
Accepted
N=int(input()) ans=[] l=[] for i in range(1,N+1): l=list(str(format(i,'b'))) l.reverse() l_=l.index('1') ans.append([l_,i]) ans.sort(reverse=True) print(ans[0][1])
p02982
s936955771
Accepted
import math n,d=map(int,input().split()) l=[list(map(int,input().split())) for i in range(n)] cnt=0 for i in range(0,len(l)-1): for j in range(i+1,len(l)): sum_num=0 for k in range(d): sum_num+=(l[i][k]-l[j][k])**2 sum_num=math.sqrt(sum_num) if int(sum_num)==sum_num: cnt+=1 print(cnt)
p04019
s968956669
Wrong Answer
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ s = input() if len(set(s))%2 == 1: print("No") else: print("Yes")
p02690
s000164869
Accepted
x =int(input()) a =[i**5 for i in range(120)] for i in range(120): for j in range(i+1,120): if a[j] -a[i] ==x: print(j,i) break if a[j] +a[i] ==x: print(j,-i) break
p03803
s655110121
Wrong Answer
a,b=map(int,input().split()) if a==1: a=a+13 if b==1: b=b+13 print(a,b) print("Draw" if a==b else "Alice" if a>b else "Bob")
p03469
s552048266
Accepted
s = list(input()) s[3] = '8' print(''.join(s))
p02548
s991582345
Accepted
#!/usr/bin/env python3 import sys def input(): return sys.stdin.readline().rstrip() def main(): n=int(input()) ans=0 for i in range(1,n): ans+=(n-1)//i print(ans) if __name__ == '__main__': main()
p04034
s796054606
Wrong Answer
n, m = map(int, input().split()) box = [[0, 1] for _ in range(n+1)] box[0][1] = 0 box[1][0] = 1 for i in range(m): x, y = map(int, input().split()) if box[x][0]: box[x][1] -= 1 box[y][0] = 1 box[y][1] += 1 if box[x][1] == 0: box[x][0] = 0 print(sum(box[x][0] for x in range(1,n+1)))
p03252
s447153469
Accepted
import numpy as np import functools import math import collections import scipy import fractions import itertools def rle(l): hoge = list(set(l)) huga = [] for i in hoge: huga.append(l.count(i)) huga.sort() return huga def solve(): s = list(input()) t = list(input()) if rle(s) == rle(t): print("Yes") else: print("No") return 0 if __name__ == "__main__": solve()
p02982
s988780471
Accepted
from itertools import combinations import math N, D = map(int, input().split()) X = [list(map(int, input().split())) for _ in range(N)] ans = 0 for v in combinations(range(N), 2): a = sum([(i - j) ** 2 for i, j in zip(X[v[0]], X[v[1]])]) if math.ceil(a ** 0.5) == a ** 0.5: ans += 1 print(ans)
p02790
s537395171
Accepted
a,b = map(int, input().split()) A = "" for i in range(b): A += str(a) B = "" for i in range(a): B += str(b) print(max(int(A),int(B)))
p02706
s472742977
Accepted
N, M = map(int, input().split()) days = list(map(int, input().split())) if N >= sum(days): print(N - sum(days)) else: print(-1)
p03720
s523386231
Accepted
n, m = map(int, input().split()) ar = [0] * n for i in range(m): a, b = map(int, input().split()) ar[a-1] += 1 ar[b-1] += 1 for i in range(n): print(ar[i])
p03449
s433833628
Accepted
n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) maxans=0 for i in range(n): ans=sum(a[0:i+1]+b[i:n]) maxans=max(ans,maxans) print(maxans)
p03160
s920893847
Accepted
n = int(input()) h = [int(i) for i in input().split(" ")] dp = [float("inf")] * n dp[0] = 0 dp[1] = dp[0] + abs(h[0] - h[1]) for i in range(1, n-1, 1): dp[i+1] = min(dp[i-1] + abs(h[i-1] - h[i+1]), dp[i] + abs(h[i] - h[i+1])) print(dp[-1])
p04020
s580500268
Wrong Answer
n = int(input()) A = [int(input()) for _ in range(n)] B = [0]*(n+1) ans = 0 for i in range(n): q, r = divmod(A[i]+B[i], 2) ans += q if r: B[i+1] += A[i]%2 print(ans)
p02612
s422484134
Accepted
n = int(input()) b = 0 while b < n: b += 1000 print(b-n)
p04043
s672440184
Wrong Answer
A,B,C = map(int, input("").split()) if A == 5: if B == 5: if C == 7: print("YES") elif B == 7: if C == 5: print("YES") else: print("NO") else: print("NO") if A == 7: if B == 5: if C == 5: print("YES") else: print("NO") else: print("NO")
p04019
s773011150
Accepted
print('YNeos'[set(input())not in map(set,['NS','EW','NEWS'])::2])
p03086
s545009932
Accepted
S = list(input()) acgt = ["A", "C", "G", "T"] res = 0 t = 0 for s in S: if s in acgt: t += 1 else: res = max(res, t) t = 0 res = max(res, t) print(res)
p03109
s184099324
Accepted
#119_A S=input() print('TBD' if int(S[5:7])>4 else 'Heisei')
p02912
s192676345
Wrong Answer
# coding: utf-8 import heapq N, M = map(int, input().split()) A = list(map(int, input().split())) A = list(map(lambda x: -1 * x, A)) # A.sort(reverse=True) heapq.heapify(A) for i in range(M): tmp = heapq.heappop(A) heapq.heappush(A, tmp // 2) print(-sum(A))
p03262
s832354986
Accepted
from fractions import gcd def gcds(List): __ = 0 for _ in List: __ = gcd(__, _) return __ n,x = map(int,input().split()) l = list(map(int,input().split())) y = [] for i in range(n): y.append(abs(l[i]-x)) print(gcds(y))
p03815
s183067992
Wrong Answer
import math import itertools import statistics #import collections x = int(input()) s = x/11 ans = math.ceil(s*2) print(ans)
p02881
s417704657
Accepted
N=int(input()) move=int(N**.5) while N%move!=0: move-=1 print(N//move+move-2)
p02595
s846232797
Wrong Answer
import math n,d = map(int,input().split()) ans = 0 for i in range(n): x,y = map(int,input().split()) if math.sqrt((x ** 2) + (y ** 2)) >= d: ans += 1 print(ans)
p03632
s436981600
Accepted
a,b,c,d = map(int,input().split()) x = [0]*(202) x[a] += 1 x[b] -= 1 x[c] += 1 x[d] -= 1 for i in range(201): x[i+1] += x[i] ans = 0 for i in range(202): if x[i] == 2: ans += 1 print(ans)
p02783
s821828741
Wrong Answer
h,a=[int(x) for x in input().split()] print(h//a + 1)
p02718
s630774847
Accepted
n,m=map(int,input().split()) a=list(map(int,input().split())) a.sort(reverse=True) suma=sum(a) cnt=0 for i in a: #print(i) if i*4*m>=suma: cnt+=1 if cnt>=m:print('Yes') else:print('No')
p03693
s980626186
Wrong Answer
r,g,b = map(int,input().split()) print("YES" if r*100 + g*10 + b%4==0 else "N0")
p03804
s159820551
Accepted
n,m = map(int, input().split()) a = [input() for _ in range(n)] b = [input() for _ in range(m)] ans = False for pattern_h in range(n-m+1): for pattern_w in range(n-m+1): p = [] for h in range(m): p.append(a[pattern_h+h][pattern_w:pattern_w+m]) if p==b: ans = True break if ans: break print('Yes' if ans else 'No')
p03309
s493719360
Wrong Answer
n = int(input()) g = map(int, input().split()) a = [v-(i+1) for i,v in enumerate(g)] s = sum(a) b,r = divmod(s, n) if r*2 > n and s > 0: b += 1 if r*2 < n and s < 0: b += 1 print(sum(map(lambda x:abs(x-b), a)))
p02606
s383405213
Wrong Answer
from math import * l,r,d=map(int,input().split()) k=r-l+1 ans=k//d print(ans)
p02793
s261874050
Accepted
import sys,fractions input = sys.stdin.readline mod = 10**9+7 n = int(input()) lst_a = list(map(int, input().split())) lcm = 1 for a in lst_a: lcm = a*lcm//fractions.gcd(a,lcm) lcm %= mod ans = 0 for a in lst_a: ans += lcm*pow(a,mod-2,mod) ans %= mod print(ans)
p02658
s426029543
Wrong Answer
n = int(input()) a = list(map(int, input().split())) import numpy as np arr = np.array(a) pro = np.product(arr) if pro > 10 ** 18: print(-1) else: print(pro)
p03331
s936837948
Wrong Answer
n = int(input()) min_v = 100000 for i in range(2, n - 1): b = n - i s = sum(list(map(int, str(i)))) + sum(list(map(int, str(b)))) if s <= min_v: min_v = s print(min_v)
p03759
s366682550
Wrong Answer
a, b, c = map(int, input().split()) if b - a == c - b: print("Yes") else: print("No")
p02982
s802720213
Wrong Answer
MM = input().split() N = int(MM[0]) D = int(MM[1]) list1 =[] count = 0 for i in range(N): aa = input().split() list1.append(aa) for i in range(N): for j in range(i+1,N): total = 0 for k,l in zip(list1[i],list1[j]): total += (int(k) -int(l))**2 for m in range(40): if total == m**2 and total !=0: count +=1 print(count)
p03962
s017753194
Accepted
print(len(set(input().split())))
p02802
s007089410
Accepted
N, M = map(int, input().split()) ac = [False] * N wa_cnt = [0] * N ac_cnt = 0 for i in range(M): p, s = input().split() p_i = int(p) - 1 if s == 'WA': if not ac[p_i]: wa_cnt[p_i] += 1 else: if not ac[p_i]: ac[p_i] = True ac_cnt += 1 wa_cnt_sum = 0 for i in range(N): if ac[i]: wa_cnt_sum += wa_cnt[i] print(ac_cnt,wa_cnt_sum)
p02547
s350538019
Accepted
n = int(input()) count = 0 ans = "No" for i in range(n): a,b = input().split() if a == b: count += 1 else: count = 0 if count == 3: ans ="Yes" print(ans)
p02958
s059307958
Accepted
n = int(input()) s = list(map(int,input().split())) t = s.copy() t.sort() cnt = 0 for i in range(n): if s[i] != t[i]: cnt += 1 if cnt<3: print("YES") else: print("NO")
p03633
s485029720
Wrong Answer
def gcd(a,b): if b==0: return a return gcd(b, a%b) from itertools import accumulate N = int(input()) T = [int(input()) for _ in range(N)] ans = list(accumulate(T, func=gcd))[-1] print(ans)
p02959
s157658129
Accepted
def main(): N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) ans = 0 for i in range(N): b = B[i] if A[i] >= b: ans += b else: b -= A[i] ans += (A[i] + min(b, A[i+1])) A[i+1] = max(A[i+1] - b, 0) print(ans) if __name__ == "__main__": main()
p03785
s922027108
Accepted
import sys N, C, K = map(int, sys.stdin.readline().strip().split()) T = [] for _ in range(N): T.append(int(sys.stdin.readline().strip())) T.sort() ans = 0 n = 0 left_min = float("inf") for t_i in T: left_min = min(t_i, left_min) if left_min + K < t_i: ans += 1 left_min = t_i n = 1 continue n += 1 if n == C: ans += 1 n = 0 left_min = float("inf") if n > 0: ans += 1 print(ans)
p02952
s267025121
Accepted
import math N = int(input()) i=0 num=0 #桁数 while 10**i <= N: i=i+1 if i==1: num=N elif i==2: num=9 elif i==3: num=9+N-99 elif i==4: num=9+999-99 elif i==5: num=9+900+N-9999 elif i==6: num=9+900+99999-9999 print(num)
p03721
s705633755
Accepted
def nyu(): N,K = map(int,input().split()) A = [list(map(int,input().split())) for _ in range(N)] A.sort() return N,K,A def kansu(N,K,A): sum = 0 ans = -1 for a in range(len(A)): sum += A[a][1] # print(sum,A[a][1]) if (K <= sum): ans = A[a][0] break print(ans) N,K,A = nyu() kansu(N,K,A)
p03210
s172638970
Accepted
n = input() print("YES" if n in "753" else "NO")
p02633
s646627933
Accepted
x = int(input()) y = 0 n =0 while(1): n += 1 y += x y %= 360 if(y==0): print(n) exit()
p02995
s274684897
Accepted
import fractions def lcm(a,b): return a*b //fractions.gcd(a, b) A, B,C,D = map(int, input().split()) b_num = B//C + B//D - B//lcm(C, D) a_num = (A-1)//C + (A-1)//D - (A-1)//lcm(C, D) print((B-(A-1))-(b_num-a_num))
p02717
s878952600
Accepted
X, Y, Z = map(int, input().split()) print(Z, X, Y)
p03417
s593873676
Wrong Answer
n,m=map(int,input().split()) n,m = max(n,m),min(n,m) print((n-2)*(m-2) if m>=3 else (0 if n==2 or m==2 or n==m==1 else n-2))
p02802
s789512425
Accepted
N,M = map(int,input().split()) AC = [0 for i in range(N+1)] WA = [0 for i in range(N+1)] for i in range(M): a,b=input().split() a2 = int(a) if b == 'AC': AC[a2 - 1] = 1 elif b == 'WA' and AC[a2 - 1] == 0: WA[a2-1]+= 1 ans_WA = 0 for i, j in zip(WA, AC): ans_WA += i * j print(sum(AC), ans_WA)
p03779
s820252169
Accepted
#coding: utf-8 import math import heapq import bisect import numpy as np from collections import Counter, deque #from scipy.misc import comb X = int(input()) ans = 0 i = 1 while 1: ans += i if X <= ans: print(i) break i += 1
p02598
s352399505
Accepted
def resolve(): def is_ok(mid): cnt = 0 for a in A: cnt += (a-1)//mid return cnt <= K N, K = map(int, input().split()) A = list(map(int, input().split())) ok = max(A) ng = 0 while ok - ng > 1: mid = (ok+ng)//2 if is_ok(mid): ok = mid else: ng = mid print(ok) if __name__ == "__main__": resolve()
p03705
s300261084
Accepted
N, A, B = map(int, input().split()) if A > B: print(0) exit() else: if N == 1: if A != B: print(0) exit() else: print(1) exit() else: # (N-1)*A+B以上 A+(N-1)*B以下の全ての値が可能 ans = (N - 2) * (B - A) + 1 print(ans)
p02706
s282159402
Accepted
N, M = map(int,input().split()) l = list(map(int,input().split())) su = sum(l) if N < su: print('-1') else: print(N - su)
p03659
s109719583
Accepted
def resolve(): N = int(input()) A = list(map(int, input().split())) minabs = float("inf") tmpx = 0 tmpy = sum(A) for i in range(N-1): tmpx += A[i] tmpy -= A[i] if abs(tmpx - tmpy) < minabs: minabs = abs(tmpx - tmpy) print(minabs) if '__main__' == __name__: resolve()
p03785
s310152446
Accepted
n, c, k = map(int, input().split()) t = [ int(input()) for _ in range(n) ] t.sort() now = 0 past = t[0] num = 0 ans = 1 for i in range(n): now = t[i] num += 1 if now-past > k or num > c: ans += 1 num = 1 past = t[i] print(ans)
p02705
s071510831
Accepted
r = int(input()) l = 2*r*3.141592 print(l)
p02683
s960247065
Accepted
from itertools import product from operator import add n, m, x = map(int, input().split()) ca = [list(map(int, input().split())) for _ in range(n)] p = list(product([0, 1], repeat=n)) ans = float('inf') for i in range(len(p)): total = [0]*m money = 0 for j in range(n): if p[i][j] == 1: total = list(map(add, total, ca[j][1:m+1])) money += ca[j][0] if len([y for y in total if y >= x]) == m: ans = min(ans, money) if ans == float('inf'): print(-1) else: print(ans)
p02675
s189660367
Accepted
n = input() if int(n[-1]) in [2, 4, 5, 7, 9]: print('hon') elif int(n[-1]) in [0, 1, 6, 8]: print('pon') else: print('bon')
p02772
s215833900
Accepted
N = int(input()) A = list(map(int, input().split())) for i in A: if i%2 == 0: if i%3 != 0 and i%5 != 0: print('DENIED') exit() print('APPROVED')
p02664
s398622522
Accepted
print(input().replace('?','D'))
p02630
s708159450
Wrong Answer
import copy n = int(input()) a = list(map(int, input().split())) q = int(input()) for i in range(q): b, c = map(int, input().split()) d = copy.copy(a) sum = 0 for j in range(len(a)): if d[j] == b: d[j] = c sum += d[j] print(sum)
p03339
s555491724
Accepted
def schange(s): if s=="E": return 1 else: return 0 n = int(input()) s = list(map(schange,input())) ssum = [0]*(n+1) for i in range(n): ssum[i+1] = ssum[i] + s[i] ans = float('inf') for i in range(1,n+1): turnE = (i-1)-ssum[i-1] turnW = ssum[-1] - ssum[i] ans=min(ans,turnE+turnW) print(ans)
p03804
s134054875
Accepted
N,M=map(int,input().split()) A=[input() for _ in range(N)] B=[input() for _ in range(M)] res=False for dh in range(N-M+1): for dw in range(N-M+1): tres=True for h in range(M): for w in range(M): if B[h][w]!=A[h+dh][w+dw]: tres=False res|=tres print("Yes"if res else "No")
p04045
s953383246
Wrong Answer
import sys N, K = map(int, input().split()) Ds = list(input()) number = N-1 while True: number += 1 for j in range(K): if Ds[j] in str(number): break if j == K-1: print(number) sys.exit(0)
p03474
s403294699
Wrong Answer
a,b = map(int,input().split()) num = input() if num[:2].isdecimal() and num[3]== "-" and num[4:].isdecimal(): print("Yes") else: print("No")
p03778
s943662866
Accepted
w,a,b=map(int,input().split()) print(0 if b<=a<=b+w or a<=b<=a+w else min(abs(b-a-w),abs(a-b-w)))
p03711
s645797152
Accepted
x, y = map(int, input().split()) def grp(z): if z in [1,3,5,7,8,10,12]: return 'a' elif z in [4,6,9,11]: return 'b' elif z == 2: return 'c' print('Yes' if grp(x) == grp(y) else 'No')
p03711
s076197456
Accepted
x, y = list(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) or (x in b and y in b) or (x in c and y in c): print('Yes') else: print('No')
p02572
s445824953
Accepted
n=int(input()) a=list(map(int,input().split())) s=sum(a) ans=0 for i in range(n-1): s-=a[i] ans+=a[i]*s if ans>(10**9+7): ans=ans%(10**9+7) print(ans)
p02923
s355869305
Accepted
N=int(input()) A=list(map(int,input().split())) ans=0 num=0 for i in range(1,N): if A[i-1]<A[i]: ans=max(ans,num) num=0 else: num+=1 ans=max(ans,num) print(ans)
p02691
s534836470
Accepted
N=int(input()) A=map(int,input().split()) A=list(A) L = {} R = {} for i in range(N+1): L[i] = [] R[i] = [] for i in range(N): key = i+1+A[i] if key<N+1: L[key].append(i+1) for i in range(N): key = i+1-A[i] if (key<N+1)and(0<=key): R[key].append(i+1) ans=0 for x in range(N+1): ans+=len(L[x])*len(R[x]) print(ans)
p02951
s785006313
Accepted
A, B, C = map(int, input().split()) D = B + C - A print(max(0, D))
p02594
s154752750
Accepted
x = int(input()) if x < 30: print("No") else: print ("Yes")
p02576
s403542235
Wrong Answer
N, X, T = [int(s) for s in input().split(" ")] t = T * (N + X - 1) / X print(t)
p02684
s806838924
Wrong Answer
N, K = map(int, input().split()) A = list(map(int, input().split())) l = [0 for _ in range(N)] now = 0 l[now] = 1 count = 0 loop = [0] while count < K: count += 1 now = A[now]-1 loop.append(now) if l[now] == 1: loop = loop[loop.index(now):-1] break else: l[now] = 1 if count == K: print(now + 1) else: ans = loop[K % len(loop)] print(ans + 1)
p02786
s622115887
Wrong Answer
def split_monster(n, count): if n == 0: return count count += 1 count = split_monster(int(n/2), count) count = split_monster(int(n/2), count) return count n = int(input()) count = 0 if n > 1: count = split_monster(n, count) print(count)
p03282
s530296652
Accepted
S = input() K = int(input()) not_1_idx = -1 not_1_num = 1 for i, c in enumerate(S): if c != "1": not_1_idx = i not_1_num = c break if not_1_idx >= 0: print(1) if K < not_1_idx + 1 else print(not_1_num) else: print(not_1_num)
p02831
s174345776
Accepted
#C A,B=map(int,input().split()) GCD=1 for i in range(2,10**5+1): if A%i==0 and B%i==0: GCD=i LCM=A*B/GCD print(int(LCM))
p03730
s563309412
Accepted
A, B, C = map(int,input().split()) for i in range(1,B+1): a = A*i if a % B == C: print('YES') exit() print('NO')
p02687
s827822599
Accepted
s=input() if s=='ABC': print('ARC') else: print('ABC')
p02973
s490441318
Wrong Answer
N = int(input()) A = [int(input()) for i in range(N)] now = A[0] ans = 1 for i in range(1,N): if now < A[i]: continue else: now = A[i] ans += 1 print(ans)
p03075
s732323051
Accepted
S=[int(input()) for i in range(5)] K=int(input()) def antenna(s,k): while True: for i in range(5): for j in range(5): if i!=j: if abs(s[i]-s[j])>k: return ':(' return 'Yay!' print(antenna(S,K))
p03264
s485134079
Accepted
k=int(input()) if k%2==0: print((k//2)**2) else: print((k//2)*(k//2+1))
p03475
s416549464
Accepted
N = int(input()) M = [list(map(int, input().split())) for _ in range(N-1)] for i in range(N-1): tm = 0 #時刻を表す for j in range(i, N-1): if tm < M[j][1]: #開通していない tm = M[j][1] elif tm % M[j][2] != 0: #発車していない tm += M[j][2] - (tm % M[j][2]) tm += M[j][0] print(tm) print(0)
p03127
s747403456
Accepted
import math N = int(input()) A = list(map(int, input().split())) g = A[0] for i in range(1, N): g = math.gcd(g, A[i]) print(g)
p03095
s898351731
Accepted
N = int(input()) S = input() MOD = 10 ** 9 + 7 from collections import defaultdict dic = defaultdict(int) for s in S: dic[s] += 1 ans = 1 for value in dic.values(): ans *= (value + 1) ans %= MOD print((ans - 1) % MOD)
p03136
s364475668
Wrong Answer
input_angle = int(input()) input_length = input() length = input_length.split(' ') length.sort() sum = 0 for i in range(input_angle-1): sum += int(length[i]) if sum >= int(length[-1]): print('Yes') else: print('No')
p02718
s417479639
Wrong Answer
n,m=map(int,input().split()) a=list(map(int,input().split())) x=sum(a)//4*m c=0 for i in range(n): if a[i]>=x: c+=1 if c<m: print('No') else: print('Yes')
p03723
s733503549
Wrong Answer
a,b,c=map(int,input().split()) ab,bc,ca=abs(a-b),abs(b-c),abs(c-a) ans=0 if a==b==c: print(-1) else: while ab%2==0 and bc%2==0 and ca%2==0: ab//=2 bc//=2 ca//=2 ans+=1 print(ans)
p03632
s372205330
Wrong Answer
A,B,C,D=map(int, input().split()) if A<C: if C<A+B: if C+D<A+B: print(D) else: print(A+B-C) else: print(0) else: if A<C+D: if A+B<C+D: print(B) else: print(C+D-A) else: print(0)