problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03059
s999624583
Accepted
a,b,t=map(int,input().split()) print(int(((t+0.5)//a)*b))
p03254
s168729164
Wrong Answer
N, x = map(int, input().split()) a = list(map(int, input().split())) a = sorted(a) ans = 0 for i in range(N): if a[i] <= x: x -= a[i] ans += 1 if x > 0 and ans > 0: ans -= 1 print(ans) elif x == 0: print(ans) else: print(0)
p03778
s242186638
Accepted
w,a,b=map(int,input().split()) print(max(0,max(a,b)-w-min(a,b)))
p03493
s224121055
Accepted
s=input() print(s.count("1"))
p02618
s817866763
Accepted
d = int(input()) cl = list(map(int, input().split())) sl = [] for _ in range(d): sl.append(list(map(int, input().split()))) for i in range(d): print(i%26 + 1)
p02714
s718290965
Accepted
n=int(input()) s=input() r=s.count("R") g=s.count("G") b=s.count("B") ans=r*g*b for i in range(n-2): for j in range(i+1,n): k=2*j-i if k>(n-1): break if s[i]!=s[j]!=s[k]!=s[i]: ans-=1 print(ans)
p03835
s353533113
Accepted
K, S = map(int, input().split()) Sum = 0 for i in range(K + 1): for j in range(K + 1): if 0 <= S - i - j <= K: Sum += 1 print(Sum)
p02911
s400509220
Accepted
import sys input = sys.stdin.readline n, k, q = [int(w) for w in input().split()] score = [0] * n for i in range(q): a = int(input()) score[a - 1] += 1 for s in score: print('Yes' if s + k - q > 0 else 'No')
p02555
s599418568
Accepted
MOD = 10**9+7 s = int(input()) a = [0 for i in range(s+1)] a[0] = 1 for i in range(3, s+1): a[i] = sum(a[:i-2]) % MOD print(a[s])
p02699
s366544147
Accepted
line = [int(s) for s in input().split()] if line[0] > line[1]: print('safe') else: print('unsafe')
p02705
s038136005
Accepted
# abc163 import math r = int(input()) ans = r*2*math.pi print(ans)
p03001
s328208550
Accepted
w,h,x,y = map(int,input().split()) sq = w*(1/2)*h if x==(w/2) and y==(h/2): print(sq,1) else: print(sq,0)
p03493
s011023267
Accepted
import re firststr = input() result = re.findall(r'1',firststr) print(len(result))
p03457
s466227494
Accepted
n = int(input()) d = [list(map(int, input().split())) for i in range(n)] t, x, y = 0, 0, 0 flag = True for ti, xi, yi in d: if ti >= xi + yi: if (ti - t) % 2 != (abs(xi - x) + abs(yi - y)) % 2: flag = False break t = ti x = xi y = yi else: flag = False break print("Yes" if flag else "No")
p03041
s168449129
Wrong Answer
N, K = map(int, input().split()) S = input() S = S.replace(S[K - 1],S[K - 1].lower()) print(S)
p03474
s826625311
Wrong Answer
a,b = map(int,input().split()) num = input() if len(num) == a+b+1 and num[:a].isdecimal() and num[a]== "-" and num[b:].isdecimal(): print("Yes") else: print("No")
p03309
s027784939
Accepted
import sys from itertools import combinations def input(): return sys.stdin.readline().strip() def main(): N = int(input()) A = list(map(int, input().split())) for i in range(N): A[i] -= i + 1 A.sort() ans = 0 for a in A: ans += abs(a - A[N // 2]) print(ans) if __name__ == "__main__": main()
p02972
s648151405
Accepted
N = int(input()) a = list(map(int, input().split())) b = [0]*(N+1) for i in range(N, 0, -1): if sum(b[i::i])%2 != a[i-1]: b[i] = 1 print (sum(b)) ans = [] for i, j in enumerate(b): if j == 1: ans.append(i) print (*ans)
p03862
s522367380
Accepted
f=lambda:map(int,input().split());n,x=f();t=a=0 for i in f():t=min(i,x-t);a+=i-t print(a)
p02971
s387508703
Wrong Answer
n = int(input()) a = [0]*n for i in range(n): a[i] = int(input()) b = sorted(a,reverse=True) if b[0] == b[1] and b[0] == max(a): for i in range(n): print(max(a)) else: for i in range(n): if a[i] == max(a): print(max(a)-1) else: print(max(a))
p02700
s526911202
Wrong Answer
i = list(map(int, input().split())) while i[0] <= 0 or i[2] <= 0: i[2] -= i[1] if i[2] <= 0: break i[0] -= i[3] if i[0] <= 0: break if i[0] <= 0: print("No") else: print("Yes")
p03637
s836214871
Accepted
N = int(input()) A = list(map(int, input().split())) cnt4 = 0 cnt2 = 0 for a in A: if a % 4 == 0: cnt4 += 1 elif a % 2 == 0: cnt2 += 1 ans = "No" if N - cnt4*2 <= 1: ans = "Yes" elif N - cnt4*2 > 1: if N - cnt4*2 <= cnt2: ans = "Yes" elif N - cnt4*2 == N: if N == cnt2*2: ans = "Yes" print(ans)
p03645
s111270008
Accepted
import sys input = sys.stdin.readline N,M = [int(i) for i in input().split()] nes = [0] * (N+1) for i in range(1,N+1) : nes[i] = [] for i in range(M) : a,b = [int(i) for i in input().split()] nes[a].append(b) nes[b].append(a) ans = "IMPOSSIBLE" for i in nes[1] : for j in nes[i] : if j == N : ans = "POSSIBLE" break print(ans)
p02661
s565237313
Wrong Answer
n=int(input()) AB=[] A=[] B=[] for _ in range(n): a,b = map(int,input().split()) AB.append((a,b)) A.append(a) B.append(b) #AB = sorted(AB,key=lambda x: x[1]) med = n//2 if n%2 != 0: print(B[n//2]-A[n//2]+1) else: p = (A[n//2] + A[n//2-1])/2 q = (B[n//2] + B[n//2-1])/2 print(int((q-p)*2+1))
p02790
s884568072
Accepted
#a,b a,b=(int(x) for x in input().split()) i = 1 if a == b: while (i<=a): print(a, end="") i += 1 elif a>b: while (i<=a): print(b, end="") i += 1 elif a<b: while (i<=b): print(a, end="") i += 1 print()
p03815
s026132024
Wrong Answer
x = int(input()) x11 = x/11 num = [1,2,3,4,5,6] num2= [7,8,9,10] if x in num: print(1) elif x in num2: print(2) elif int(x11) == x11: print(int(x11)*2) elif x+5 >int(x11)*2 + 6 >= x: print(1+int(x11)*2) else: print(2+int(x11)*2)
p03943
s261664173
Accepted
a,b,c = map(int, input().split()) print("Yes" if a + b == c or a + c == b or b + c == a else "No")
p03767
s855590601
Wrong Answer
#! /usr/bin/env python3 import sys import numpy as np int1 = lambda x: int(x) - 1 read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(500000) N, *A = map(int, read().split()) A = sorted(A) A = A[N:-N] print(sum(A))
p02603
s401833079
Accepted
n = int(input()) a = list(map(int,input().split())) joutai = "nasi" m = 1000 k = 0 for i in range(n-1): if joutai == "nasi": if a[i] < a[i+1]: k = m // a[i] m -= k * a[i] joutai = "ari" else: if a[i] > a[i+1]: m += k * a[i] k = 0 joutai = "nasi" m += k * a[n-1] print(m)
p03106
s414014988
Wrong Answer
# abc120_b.py A, B, K = map(int,input().split()) cnt = 0 for i in range(1,10000): if A%i==0 or B%i==0: cnt += 1 if cnt == K: print(i) exit()
p02789
s104926930
Accepted
N, M = list(map(int,input().strip().split(" "))) if N == M: print("Yes") else: print("No")
p03417
s666310831
Accepted
n,m=map(int,input().split()) if n<=2 and m<=2: if n==m==1: print(1) else: print(0) elif n==1 or m==1: print(max(n,m)-2) elif n==2 or m==2: print(0) else: print((n-2)*(m-2))
p03150
s246351682
Wrong Answer
import sys s = input() target = "keyence" for i in range(len(target)): sbst1 = target[0:i] sbst2 = target[i:] ind = s.find(sbst1) indx = s.find(sbst2) if ind != -1 and ind < indx: print("YES") sys.exit() print("NO")
p03017
s826673822
Wrong Answer
N,A,B,C,D=map(int,input().split()) S=input() answer="Yes" possibility=True if (A>B and C>D) or (A<B and C<D): if "##" in S[min(A,C):max(A,C)]: answer="No" elif "##" in S[min(B,D):max(B,D)]: answer="No" else: if "..." not in S: answer="No" print(answer)
p03632
s896708139
Accepted
a,b,c,d =map(int,input().split()) answer = min(b,d) - max(a,c) print(max(0,answer))
p02688
s058578126
Wrong Answer
N,K = map(int, input().split()) d = [] n = [] for k in range(K): d.append(input()) n.append(input().split()) def flatten(nested_list): return [e for inner_list in nested_list for e in inner_list] nfu = set(flatten(n)) print(nfu) print(N - len(nfu))
p03380
s405070391
Accepted
data = int(input()) array = list(map(int, input().split())) high = max(array) array.remove(high) p = high/2 a_m = [abs(array[i]-p) for i in range(data-1)] print(high, array[a_m.index(min(a_m))])
p02639
s862468473
Wrong Answer
xlist = list(map(int,input().split())) print(xlist.index(0))
p03087
s574386451
Wrong Answer
l = [int(x) for x in input().split(" ")] N,Q = l[0],l[1] cumsum = [0] string = input() flag = False for i in range(N): if not (string[i]=="A" or string[i]=="C"): flag = False elif string[i] == "A": flag = True elif string[i] == "C": if flag == True: cumsum.append(cumsum[-1]+1) continue cumsum.append(cumsum[-1]) for i in range(Q): t = [int(x) for x in input().split(" ")] print(cumsum[t[1]]-cumsum[t[0]])
p02948
s231938010
Wrong Answer
# D - Summer Vacation # 価値、日数で降順ソートして上から取ってく n, m = map(int, input().split()) w = [] for _ in range(n): w.append(list(map(int, input().split()))) w = sorted(w, key=lambda x: (x[1], x[0]), reverse=True) ans = 0 for w1 in w: if m >= w1[0]: ans += w1[1] else: break m -= 1 print(ans)
p02996
s147333943
Accepted
n=int(input()) task=[list(map(int,input().split())) for _ in range(n)] task.sort(key=lambda x: x[1]) deadline=0 now=0 for i in range(n): now += task[i][0] deadline = task[i][1] if now > deadline: print('No') exit() print('Yes')
p02556
s581537535
Accepted
N = int(input()) X = [0]*N Y = [0]*N for TN in range(0,N): A,B = (int(T) for T in input().split()) X[TN] = A-B Y[TN] = A+B print(max(max(X)-min(X),max(Y)-min(Y)))
p02714
s727224096
Accepted
import collections N=int(input()) S=input() lis=list(S) C= collections.Counter(lis) count=list(C.values()) c=0 for i in range(N): for j in range(i,(N+i-1) // 2+1): if(lis[i]!=lis[j]): if(lis[j]!=lis[2*j-i]): if(lis[i]!=lis[2*j-i]): c+=1 if(len(count)==3): print(count[0]*count[1]*count[2]-c) else: print(0)
p03435
s914889151
Wrong Answer
def solve(): C = [list(map(int, input().split())) for _ in range(3)] A = [min(c) for c in C] B = [min(C[0][i], C[1][i], C[2][i]) for i in range(3)] # print(A,B) ret = all([C[i][j] == A[i]+B[j] for j in range(3) for i in range(3)]) print('Yes' if ret else 'No') solve()
p02631
s852509227
Accepted
from functools import reduce from operator import xor N = int(input()) A = list(map(int, input().split())) xor_sum = reduce(xor, A) for a in A: print(xor(a, xor_sum), end=" ") print()
p03998
s966088150
Accepted
a=list(input()) b=list(input()) c=list(input()) ans="a" while True: try: if ans == "a": ans=a[0] a=a[1:] elif ans == "b": ans = b[0] b=b[1:] elif ans == "c": ans = c[0] c=c[1:] except: print(ans.upper()) break
p02582
s519123472
Accepted
S = input() if S[0] == 'R' and S[1] == 'R' and S[2] == 'R': print(3) elif (S[0] == 'R' and S[1] == 'R') or (S[1] == 'R' and S[2] == 'R'): print(2) elif S[0] == 'R' or S[1] == 'R' or S[2] == 'R': print(1) else: print(0)
p02702
s592240025
Accepted
import sys import heapq import math import fractions import bisect import itertools from collections import Counter from collections import deque from operator import itemgetter def input(): return sys.stdin.readline().strip() def mp(): return map(int,input().split()) def lmp(): return list(map(int,input().split())) s=input()[::-1] n=len(s) a=[0]*2019 a[0]=1 c,d=0,1 for i in s: c+=int(i)*d c%=2019 d*=10 d%=2019 a[c]+=1 ans=0 for i in a: ans+=i*(i-1)//2 print(ans)
p03437
s321361111
Accepted
import sys from fractions import gcd sys.setrecursionlimit(10 ** 8) ini = lambda: int(sys.stdin.readline()) inm = lambda: map(int, sys.stdin.readline().split()) inl = lambda: list(inm()) ins = lambda: sys.stdin.readline().rstrip() debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw)) X, Y = inm() def solve(): if X % Y == 0: return -1 return X * (Y + 1) print(solve())
p02771
s423883436
Accepted
import sys #sys.stdin.readline() import heapq #heap from collections import defaultdict fastinp = lambda: sys.stdin.readline().split(' ') inp = lambda: input().split(' ') ml = lambda x, y=int: list(map(y, x)) debug = lambda *args: print(*args, sep=' | ') a, b, c = ml(inp()) if a == b and a != c: print('Yes') elif b == c and a != b: print('Yes') elif a == c and b != a: print('Yes') else: print('No')
p02724
s868876470
Wrong Answer
x = int(input()) print((x/500)*1000 + ((x%500)/5)*5)
p03543
s332959809
Wrong Answer
n = set(map(int, input())) print(len(n))
p03071
s774406150
Wrong Answer
A, B = map(int,input().split()) def ma(A, B): x = max(A, B) ans = 2 * x - 1 return ans print(ma(A, B))
p02603
s362912628
Accepted
N = int(input()) arr = list(map(int, input().split())) ans = 1000 kabu = 0 flg = True for i in range(N-1): if flg and arr[i] < arr[i+1]: tmp = ans//arr[i] ans -= tmp*arr[i] kabu += tmp flg = False if not flg and arr[i] > arr[i+1]: ans += kabu*arr[i] kabu = 0 flg = True print(ans+kabu*arr[-1])
p02718
s253335195
Accepted
#B import numpy as np n,m=map(int,input().split()) a=list(np.fromstring(input(),int,sep=' ')) a.sort(reverse=True) if a[m-1]<sum(a)/(4*m): print("No") else: print("Yes")
p02552
s329495409
Accepted
print(0 if input()=='1' else 1)
p02618
s196475362
Accepted
d = int(input()) c = list(map(int, input().split())) s = [list(map(int, input().split())) for _ in range(d)] for i in range(d): print(i % 26 + 1)
p02971
s860209071
Accepted
N = int(input()) A = [] for _ in range(N): A.append(int(input())) B = sorted(A, reverse = True) m1, m2 = B[0], B[1] for i in range(N): if m1 > A[i]: print(m1) else: print(m2)
p02916
s734992045
Accepted
N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) ans = sum(B) for i in range(N-1): if A[i]+1 == A[i+1]: #print(str(A[i])+ " : " +str(A[i+1])) ans += C[A[i]-1] print(ans)
p02982
s718989201
Wrong Answer
a = [i*i for i in range(80)] n,d = map(int,input().split()) x = [] for _ in range(n): x.append(list(map(int,input().split()))) ans = 0 for i in range(n-1): for j in range(i+1, n): s = 0 for k in range(d): s += (x[i][k]-x[j][k])**2 if s in a: ans += 1 print(ans)
p02630
s714550578
Wrong Answer
n = int(input()) a = set(map(int, input().split())) q = int(input()) ll = [] for i in range(q): l = list(map(int, input().split())) ll.append(l) for i in ll: if i[0] in a: a = [i[1] if j == i[0] else j for j in a] print(sum(a)) else: print(sum(a))
p03017
s577175941
Accepted
N, A, B, C, D = map(int, input().split()) S = input() print('No' if '##' in S[A:C-1] or '##' in S[B:D-1] or C == D or C > D and '...' not in S[B-2:D+1] else 'Yes')
p02606
s138664818
Wrong Answer
L,R,d=map(int,input().split()) print(int(R/d)-int(L/d))
p03971
s695990475
Accepted
n,a,b=map(int,input().split()) s=list(input()) ryo,kai=0,0 for i in range(len(s)): if s[i] == 'a' and ryo<(a+b): ryo+=1 print('Yes') elif s[i] == 'b' and ryo<(a+b) and kai<b: ryo+=1 kai+=1 print('Yes') else: print('No')
p02873
s500618301
Accepted
s=input() a=[0]*(len(s)+1) r=0 l=0 for i in range(len(a)): j=i if r==0: while j < len(s) and s[j] == '>': r+=1 j+=1 else: r-=1 if i !=0 and s[i-1] == '<': l+=1 else: l=0 a[i]=max(l,r) print(sum(a))
p02923
s270287146
Accepted
import math import bisect import heapq from collections import deque n = int(input()) h = list(map(int,input().split())) l = [0] * n l[0] = 0 for i in range(1,n): l[i] = l[i-1] + 1 if h[i-1] >= h[i] else 0 print(max(l))
p03814
s631468668
Wrong Answer
S = input() resA=0 resZ=0 for i in range(len(S)): if S[i]=='A' and resA==0: resA=i elif S[i]=='Z': resZ=i if resA !=0 and resZ !=0: print(resZ-resA+1) else: print(0)
p02633
s794910881
Accepted
import sys def lcm(a, b): a, b = max(a, b), min(a, b) c = a * b while a % b > 0: a, b = b, a % b return c // b def solve(): input = sys.stdin.readline X = int(input()) L = lcm(360, X) print(L // X) return 0 if __name__ == "__main__": solve()
p03206
s844268219
Accepted
#!/usr/bin/env python3 D = int(input()) if D == 25: print("Christmas") elif D == 24: print("Christmas Eve") elif D == 23: print("Christmas Eve Eve") elif D == 22: print("Christmas Eve Eve Eve")
p03778
s487790426
Accepted
w,a,b=map(int,input().split()) A=[i for i in range(a,a+w+1)] B=[i for i in range(b,b+w+1)] if a in B or b in A: print(0) else: print(min(abs(a+w-b),abs(b+w-a)))
p03861
s019011483
Accepted
A, B, X = map(int, input().split()) def f(N): return N // X print(f(B) - f(A - 1))
p02983
s769196974
Accepted
import sys l, r = map(int, input().split()) lmod673 = l % 673 dif = r - l if lmod673 + dif >= 673: print(0) sys.exit() min_val = 2018 for bigger in range(l, r+1): for smaller in range(l, bigger): min_val = min(min_val, bigger*smaller % 2019) print(min_val)
p03161
s076171444
Wrong Answer
[N,K]=list(map(int, input().split())) h=list(map(int, input().split())) K=min(N,K) dp=[[0 for i in range(K+1)] for j in range(N)] for i in range (1,K): for j in range (0,i): dp[i][j]=dp[i-j-1][K]+abs(h[i-j-1]-h[i]) dp[i][K]=min(dp[i][0:j+1]) for i in range (K,N): for j in range (0,K): dp[i][j]=dp[i-j-1][K]+abs(h[i-j-1]-h[i]) print(dp[N-1][K])
p03485
s103226466
Wrong Answer
import sys a, b = [int(x) for x in sys.stdin.readline().strip().split(" ")] if (a + b) % 2 == 1: print((a + b + 1) / 2) else: print((a + b) / 2)
p03338
s178825941
Wrong Answer
N = int(input()) S = list(input()) ans = 0 for i in range(N): A = S[:i] B = S[i:] C = list(set(A) & set(B)) print(C) c = len(C) if c > ans: ans += 1 print(ans)
p04020
s611773384
Accepted
n = int(input()) hold = 0 res = 0 for i in range(n): a = int(input()) if i==0: res += a//2 hold = a%2 else: if a < hold: res += a hold = 0 else: res += hold a -= hold res += a//2 hold = a%2 print(res)
p03385
s892500350
Accepted
S = list(input()) S = ''.join(sorted(S)) print('Yes' if S == 'abc' else 'No')
p03699
s162721784
Wrong Answer
n = int(input()) s = [int(input()) for _ in range(n)] a = sum(s) m = min(s) print(a if a % 10 else a - m)
p03106
s635674915
Accepted
import fractions A, B, K = map(int, input().split()) answer = [] ans = 1 max_ans = fractions.gcd(A, B) while ans <= max_ans: if A % ans == 0 and B % ans == 0: answer.append(ans) ans += 1 else: ans += 1 answer = sorted(answer, reverse=True) print(answer[K-1])
p02664
s604518518
Accepted
T = input() T = T.replace('?', 'D') print(T)
p02765
s355524604
Wrong Answer
N,R=map(int,input().split()) if N<10: print(100*(10-N)) else: print(R)
p02595
s370386831
Wrong Answer
import numpy as np N,D = map(int,input().split()) a=0 for i in range(N): x,y = map(int,input().split()) if np.sqrt(x^2+y^2)>=D: a=a+1 print(a)
p02628
s835285223
Accepted
N,K = map(int,input().split()) p = list(map(int,input().split())) s = sorted(p) ans = 0 for i in range(N): ans += s[i] if i == K-1: break print(ans)
p02663
s758977042
Wrong Answer
import sys input = lambda: sys.stdin.readline().rstrip() h1, m1, h2, m2, k = map(int, input().split()) m = (h2 - h1)*60 a = m2 - m1 if m2 - m1 >= 0 else 60 + m2 - m1 if m + a - k >= 0: print(m + a - k) else: print(0)
p02772
s358331742
Wrong Answer
rangeNum = int(input()) n = list(map(int, input().split())) ans = True for ni in range(rangeNum): if n[ni] % 2 == 0: if n[ni] % 3 == 0: break elif n[ni] % 5 == 0: break else: ans = False else: ans = False if ans==True: print("APPROVED") else: print("DENIED")
p02759
s479815893
Wrong Answer
N = int(input()) print(N // 2 + (0 if N % 2 == 0 else 0))
p02881
s017590147
Accepted
n=int(input()) import math move_min=1+n-2 for i in range(2,int(math.sqrt(n)+1)): if n%i==0: move_min=min(move_min,i+n//i-2) print(move_min)
p02802
s481988804
Wrong Answer
N, M = map(int, input().split()) ac = 0 wa = 0 l = [0] * (N + 1) for num in range(M): p, s = input().split() p = int(p) if s == "AC": if l[p] == 0: ac += 1 l[p] = 1 else: if l[p] == 0: wa += 1 print(*[ac, wa])
p02994
s861052341
Wrong Answer
n, l = map(int, input().split()) a = [l + i for i in range(n)] if l + n - 1 < 0: a.pop(n - 1) elif l > 0: a.pop(0) print(a) print(sum(a))
p03659
s847188338
Wrong Answer
N=int(input()) a=input().split() A=[int(b) for b in a] first=A[0] last=A[-1] del A[0] del A[-1] if N==2: print(abs(first-last)) else: average = sum(A) // 2 number = 0 for a in range(1, N - 1): number += A[a] if number >= average: break a1 = abs(sum(A[:a]) + first - last - sum(A[a:])) a2 = abs(sum(A[:a + 1]) + first - last - sum(A[a + 1:])) print(min(a1, a2))
p02556
s753533907
Wrong Answer
n = int(input()) xy = [list(map(int,input().split())) for _ in range(n)] a = [] b = [] for i in range(n): a.append(abs(xy[i][0]+xy[i][1])) b.append(abs(xy[i][0]-xy[i][1])) a_sort = sorted(a) b_sort = sorted(b) print(max(a_sort[-1]-a_sort[0],b_sort[-1]-b_sort[0]))
p04033
s782552141
Accepted
a,b = map(int,input().split()) if a>0: print("Positive") elif a<=0 and b>=0: print("Zero") else: n = b-a+1 if n%2==0: print("Positive") else: print("Negative")
p02784
s651376498
Accepted
h,n = map(int,input().split()) a = [int(i) for i in input().split()] print("Yes" if sum(a) >= h else "No")
p03352
s212747445
Accepted
x = int(input()) c=1 for b in range(1,x): for p in range(2,x): if b**p<=x: c=max(c,b**p) else:break print(c)
p03861
s099508826
Accepted
def main(): a, b, x = map( int, input().split()) print(b//x - (a-1)//x) if __name__ == '__main__': main()
p03289
s895355572
Wrong Answer
s=input() if s.count("A")==1 and s.count("C")==1: if "C" in s[2:len(s)-1] and s[0]=="A": s=s.replace("A","") s=s.replace("C","") if s.isupper()==False: print("AC") else: print("WA") else: print("WA") else: print("WA")
p03000
s160565586
Accepted
import itertools import bisect N, X = map(int, input().split()) *L, = map(int, input().split()) A = list(itertools.accumulate(L)) print(bisect.bisect(A, X) + 1)
p02838
s347600936
Accepted
import numpy as np N = int(input()) A = np.array(list(map(int, input().split()))) Cn, ans = N * (N-1) // 2, 0 for i in range(60): count = int(np.sum(A % 2)) A //= 2 if count == 0: continue ans += (Cn - (count*(count-1)//2 + (N-count)*(N-count-1)//2)) * (2**i) print(ans % (10**9 + 7))
p02953
s463510156
Wrong Answer
N=int(input()) h=list(map(int, input().split())) ans = 'Yes' for i in range(N-1): if h[i] <= h[i+1]: ans = 'Yes' continue print(i) if h[i] == (h[i+1]-1): ans = 'Yes' continue else: ans = 'No' print(ans)
p02847
s634256960
Accepted
s=input() day=['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'] for i in range(len(day)): if(s==day[i]): print(7-i) break