problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03059
s018978457
Wrong Answer
a,b,t=map(int,input().split()) a=float(a) t=float(t) c=0 n=2.0 while True: if a<=t+0.5: c+=b k=a*n a=k n+=1.0 else: break print(c)
p02912
s659872219
Accepted
#!/usr/bin/python3 # -*- coding:utf-8 -*- import heapq def main(): MAX = 10**9 n, m = map(int, input().strip().split()) As = sorted(list(map(lambda x:-int(x), input().strip().split()))) hq = heapq.heapify(As) for _ in range(m): x = heapq.heappop(As) x = -(-x//2) x = heapq.heappush(As, x) print(-sum(As)) if __name__=='__main__': main()
p03474
s078256466
Accepted
a,b=map(int,input().split()) s=input() if s[a]!="-": print("No") else: cnt=0 for i in range(a+b+1): if s[i]=="-": cnt+=1 if cnt!=1: print("No") else: print("Yes")
p02836
s847840618
Wrong Answer
s = list(open(0).read()) len_rev = len(s) // 2 cnt = 0 for i in range(len_rev): if s[i] != s[-i-1]: cnt += 1 print(cnt)
p03785
s184043358
Accepted
import sys N, C, K = map(int, input().split()) A = list(map(int, sys.stdin.readlines()))+[10**10] A.sort() a, c, t = 0, 1, A[0]+K for i in A[1:]: if i <= t and c < C: c += 1 else: t, c = i + K, 1 a += 1 print(a)
p02708
s291612296
Accepted
n,k=map(int,input().split()) cnt=0 p=10**9+7 for i in range(k,n+2): cnt+=1+(i*(2*n-i+1))//2-(i*(i-1))//2 if cnt>=p: cnt%=p print(cnt)
p03659
s402718731
Accepted
n, *A = map(int, open(0).read().split()) x, y = A[0], sum(A[1:]) ans = abs(x-y) for i in range(1, n-1): x += A[i] y -= A[i] ans = min(ans, abs(x-y)) print(ans)
p02989
s320883011
Accepted
n = int(input()) d = list(map(int,input().split())) d.sort() if(d[n//2-1] == d[n//2]): print("0") else: print(d[n//2] - d[n//2-1])
p03150
s173919924
Accepted
S=str(input()) l=len(S) key='keyence' if S=='keyence': print('YES') exit() else: for i in range(1,l): for j in range(l): if S[0:j]+S[i+j:l]==key: print('YES') exit() print('NO')
p03377
s555395220
Wrong Answer
a,b,x = map(int,input().split()) print('No' if a>x else 'NO' if a+b<=x else 'Yes')
p03815
s280275575
Wrong Answer
import sys input = sys.stdin.readline def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) def main(): mod=10**9+7 x=I() ans=(x//11)*2 b=x%11 if b<=6: ans+=1 else: ans+=2 print(ans) main()
p03211
s972571034
Accepted
s = input() ans = 10 ** 10 for i in range(len(s) - 2): num = int(s[i:i+3]) ans = min(ans, abs(num - 753)) print(ans)
p02725
s854482912
Wrong Answer
K, N = map(int, input().split()) A = list(map(int, input().split())) tmp1 = A[-1] - A[0] tmp2 = A[-1] - (20 - A[0] - A[-1]) print(min(tmp1, tmp2)) # print(A[-1]-A[0])
p02935
s225652388
Accepted
N = int(input()) v_list = sorted(list(map(int,input().split()))) ans = (v_list[0]+v_list[1])/2 if N != 2: for i in range(2,N): ans = (ans + v_list[i])/2 print(ans)
p02784
s217512039
Wrong Answer
h, n = map(int, input().split()) a = map(int, input().split()) if sum(a)>=h: print("Y") else: print("N")
p02603
s753655668
Accepted
N = int(input()) A = list(map(int,input().split())) # 単純な話 money = 1000 stock = 0 for i in range(N-1): if A[i]<A[i+1]: stock += money//A[i] money %= A[i] money += stock*A[i+1] stock = 0 print(money)
p02754
s999720527
Accepted
n,a,b=map(int,input().split()) ans=n//(a+b)*a n%=(a+b) if n<=a: ans+=n else: ans+=a print(ans)
p02973
s585197053
Accepted
import sys from collections import deque from bisect import bisect_left sys.setrecursionlimit(10 ** 7) input = sys.stdin.readline f_inf = float('inf') mod = 10 ** 9 + 7 def resolve(): n = int(input()) A = list(int(input()) for _ in range(n)) que = deque([A[0]]) for i in range(1, n): idx = bisect_left(que, A[i]) if idx == 0: que.appendleft(A[i]) else: idx -= 1 que[idx] = A[i] print(len(que)) if __name__ == '__main__': resolve()
p02743
s579162288
Wrong Answer
import math def resolve(): a,b,c = map(int,input().split()) print("Yes" if math.sqrt(c) > math.sqrt(a)+math.sqrt(b) else "No") if __name__ == "__main__": resolve()
p02718
s781807486
Accepted
N,M = map(int,input().split()) A = list(map(int,input().split())) S = sum(A) t = 0 for i in A: if i >= S/(4*M): t += 1 if t >= M: print("Yes") else: print("No")
p03639
s533716903
Wrong Answer
from collections import defaultdict N = int(input()) counter = defaultdict(int) for a in map(int, input().split()): if a % 4 == 0: counter[2] += 1 elif a % 2 == 0: counter[1] += 1 else: counter[0] += 1 print('Yes') if counter[0] <= counter[2] else print('No')
p03487
s420943344
Accepted
from collections import defaultdict N = int(input()) A = list(map(int,input().split())) dic = defaultdict(int) for t in A: dic[t] += 1 #print(dic) ans = 0 for n,i in dic.items(): #key value if n > i: ans += i elif n < i: ans += (i-n) print(ans)
p02796
s525953470
Accepted
N = int(input()) X = [] X_L = [] X_L_dict = {} for i in range(N): x, l = map(int, input().split()) X_L.append([x-l, x+l]) X.append(x-l) X_L.sort(key=lambda x:x[1]) X.sort() last = None count = 0 # print(X_L) for x_l in X_L: # print(x_l, last) if last is None or last <= x_l[0]: count += 1 last = x_l[1] print(count)
p03386
s332392460
Accepted
a, b, k = map(int, input().split()) if b - a < 2 * k: for v in range(a, b+1): print(v) else: for v in range(a, a+k): print(v) for v in range(b-k+1, b+1): print(v)
p02951
s490973660
Accepted
a, b, c = map(int, input().split()) ans = c-(a-b) if ans >= 0: print(ans) else: print(0)
p03624
s636722777
Accepted
S = input() abc = "abcdefghijklmnopqrstuvwxyz" dic = {s: True for s in abc} for s in S: if dic[s]: dic[s] = False for d in dic: if dic[d]: print(d) exit() print("None")
p03261
s846337539
Accepted
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def main(): N = int(input()) W = [input() for _ in range(N)] reslut = 'Yes' if len(W) != len(set(W)): reslut = 'No' for i in range(1, N): if W[i - 1][-1] != W[i][0]: reslut = 'No' print(reslut) if __name__ == "__main__": main()
p02678
s440769736
Accepted
from collections import deque n,m = map(int,input().split()) ab = [list(map(int, input().split())) for _ in range(m)] path = [[] for _ in range(n+1)] for a,b in ab: path[a].append(b) path[b].append(a) q = deque([1]) ans = [0] * (n+1) while q: v = q.popleft() for w in path[v]: if ans[w] == 0: ans[w] = v q.append(w) print('Yes') print(*ans[2:], sep="\n")
p02744
s860288695
Wrong Answer
n = int(input()) s = "bcdefghijk" if n == 1: print("a") elif n == 2: print("aa") print("ab") elif n == 5: print("aaaab") print("aaaac") print("aaaad") print("aaaae") print("aaaaf")
p03778
s064271401
Wrong Answer
w,a,b=map(int,input().split()) if len(sorted(set(range(a,a+w+1)) | set(range(b,b+w+1)))) !=0: print("0") elif b>=a+w: print(b-a-w) elif a>=b+w: print(a-b-w)
p02833
s106930360
Wrong Answer
from collections import defaultdict from collections import deque from collections import OrderedDict import itertools from sys import stdin input = stdin.readline def main(): N = int(input()) nz = 0 i = 1 while True: if N//5**i//2 > 0: nz += N//5**i//2 i += 1 else: break print(nz) if(__name__ == '__main__'): main()
p02767
s335674133
Accepted
from operator import mul from functools import reduce from fractions import gcd import math import bisect import itertools import sys sys.setrecursionlimit(10**7) input = sys.stdin.readline INF = float("inf") def main(): N = int(input()) X = list(map(int, input().split())) ans = INF x_min = min(X) x_max = max(X) for p in range(x_min, x_max + 1): tmp = 0 for x in X: tmp += (x - p) ** 2 ans = min(ans, tmp) print(ans) if __name__ == '__main__': main()
p02677
s770374756
Accepted
from math import pi, sin, cos, sqrt A, B, H, M = map(int, input().split()) x1 = A * cos(2 * pi * (H + M / 60) / 12) y1 = A * sin(2 * pi * (H + M / 60) / 12) x2 = B * cos(2 * pi * M / 60) y2 = B * sin(2 * pi * M / 60) print(sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)))
p02712
s515307430
Accepted
ans = 0 n = int(input()) for i in range(1,n+1): if i%3 != 0 and i%5 != 0: ans += i print(ans)
p02813
s114682018
Accepted
from itertools import permutations n = int(input()) p = list(map(str,input().split())) p = ''.join(p) q = list(map(str,input().split())) q = ''.join(q) arr = list(range(1,n+1)) l = [] for v in permutations(arr,n): v = list(v) v = list(map(str,v)) l.append(''.join(v)) a = 0 b = 0 for i in range(len(l)): if l[i] == p: a = i if l[i] == q: b = i print(abs(a-b))
p02912
s790451799
Accepted
import math import heapq n,m = map(int, raw_input().split(' ')) heap = [-e for e in map(int, raw_input().split(' '))] heapq.heapify(heap) while(m and heap): u = heapq.heappop(heap) u *= -1 u /=2 if u: heapq.heappush(heap, -u) m-=1 """ q = int(math.ceil(math.log(u,2))) if 2 ** q <= u: q +=1 if q <= m: m-= q else: u /= 2 m -=1 if u: heapq.heappush(heap, -u) """ print -sum(heap or [0])
p02946
s318322905
Wrong Answer
def fa(K,X): ch="" L=[X] for i in range(0,K): L.append(X-i) L.append(X+i) Q=set(L) C=str(Q) ch=C[1:len(C)-1] return ch K,X=map(int,input().split()) print(fa(K,X).replace(",",""))
p03013
s563779284
Accepted
n,m=map(int,input().split()) a=set([int(input()) for j in range(m)]) dp=[0]*(n+1) dp[0]=1 if not 1 in a: dp[1]=1 else: dp[1]=0 for i in range(n-1): if i+2 in a: dp[i+2]=0 else: dp[i+2]=(dp[i+1]+dp[i])%(10**9+7) print(dp[n])
p03073
s380202652
Accepted
s = input() ans = 0 t = "01" * len(s) for i in range(len(s)): if s[i] != t[i]: ans = ans + 1 print(min(ans, abs(len(s)-ans)))
p02613
s564958298
Accepted
n=int(input()) ac=0 wa=0 tle=0 re=0 for i in range(n): st=input() if st=='AC': ac+=1 elif st=="WA": wa+=1 elif st=="TLE": tle+=1 elif st=="RE": re+=1 print('AC x '+ str(ac)) print("WA x "+ str(wa)) print("TLE x "+ str(tle)) print("RE x "+ str(re))
p02675
s491941955
Accepted
def main(): N = input() N = int(N[len(N) - 1]) ans = "" if N in {2, 4, 5, 7, 9}: ans = "hon" elif N in {0, 1, 6, 8}: ans = "pon" else: ans = "bon" print(ans) return main()
p03673
s735480710
Accepted
from collections import deque n = int(input()) a = list(map(str, input().split())) b = [] b = a[1::2][::-1]+a[::2] if len(a)%2==0: print(' '.join(b)) else: print(' '.join(b[::-1]))
p02787
s315524835
Wrong Answer
H, N = map(int, input().split()) A = [] B = [] h = [10 ** 18] * (H + 1) for i in range(N): a, b = map(int, input().split()) A.append(a) B.append(b) for i in range(N): hi = H M = B[i] while hi - A[i] >= 0: hi = hi - A[i] h[hi] = min(h[hi], M) M += B[i] # print(a, b, h) h[0] = min(h[0], h[hi] + B[i]) # print(i, hi, hi - a, h[hi] + b) # print(h) print(h[0])
p02801
s340447029
Accepted
C=input() print (chr(ord(C)+1))
p02602
s682543908
Wrong Answer
N, K = map(int, input().split()) A = list(map(int, input().split())) p = A[0] for i in range(1, K): p *= A[i] result = [] for i in range(K, N): t = p // A[i - K] * A[i] if t > p: result.append('Yes') else: result.append('No') print(*result, sep='\n')
p02790
s773621198
Wrong Answer
a, b = map(int, input().split()) if a>=b: ans = str(a) * b else: ans = str(b) * a print(ans)
p03543
s093262924
Wrong Answer
N=input() ans=False for n in N: if N.count(n)>=3: print("Yes") ans=True break if not ans: print("No")
p03433
s297140853
Accepted
from sys import stdin n = int(stdin.readline().rstrip()) a = int(stdin.readline().rstrip()) if n%500 - a <= 0: print("Yes") else: print("No")
p02697
s293908499
Accepted
n,m = map(int,input().split()) if n % 2 == 1: n = 2*m+1 for i in range(m): print(m-i,m+1+i) else: n = 2*m+2 for i in range(m): l = m-i r = m+1+i if r-l >= m+1: r += 1 print(l,r)
p02730
s966422350
Wrong Answer
# -*- coding: utf-8 -*- S = input() N = len(S) s2 = S[:int((N-1)/2)] s3 = S[int((N+3)/2 -1):] if s2 == s2[::-1]: if s3 == s3[::-1]: print('Yes') else: print('No') else: print('No')
p03067
s776966311
Accepted
A, B, C = map(int, input().split()) if A < C < B or B < C < A: print("Yes") else: print("No")
p02631
s140147444
Wrong Answer
def main(): n = int(input()) a = list(map(int,input().split())) s = 0 for i, aa in enumerate(a): if i == 0: s = aa else: s ^= aa ans = [] if s % 2 == 0: for i, aa in enumerate(a): ans.append(s^aa) else: for i, aa in enumerate(a): ans.append(~(s^aa)) print(' '.join(map(str,ans))) if __name__=='__main__': main()
p03254
s791202154
Wrong Answer
n,x = map(int,input().split()) a = sorted(map(int,input().split())) c=0 d=0 for i in a: if c+i<=x: c+=i d+=1 else: if c<x: d-=1 print(d)
p03455
s569836970
Accepted
a,b=map(int,input().split()) if a*b%2==0: print("Even") else: print("Odd")
p02597
s820301985
Accepted
import random def gcd(a, b): if a == 0: return b return gcd(b % a, a) def lcm(a, b): return (a * b) / gcd(a, b) #a = list(map(int, input().split())) n=int(input()) s=input() l=0 r=n-1 c=0 while(l<r): if s[l]=='R': l+=1 if s[r]=='W': r-=1 if s[l]=='W' and s[r]=='R': c+=1 l+=1 r-=1 print(c)
p02743
s087780892
Accepted
import math a,b,c=map(int,input().split()) if c<=a+b: print("No") elif 4*a*b < (c-a-b)*(c-a-b): print("Yes") else: print("No")
p03075
s496802936
Accepted
a = int(input()) b = int(input()) c = int(input()) d = int(input()) e = int(input()) k = int(input()) if e - a > k: print(":(") else: print("Yay!")
p03351
s363063254
Accepted
a,b,c,d=map(int,input().split()) ab=abs(a-b) bc=abs(b-c) ca=abs(c-a) if (ab<=d and bc<=d) or ca<=d: print("Yes") else: print("No")
p03030
s758611869
Wrong Answer
#Guide Book https://atcoder.jp/contests/abc128/tasks/abc128_b N = int(input()) Shop_List=[] for i in range(N): Temp_List=list(input().split()) Temp_List[1]=int(Temp_List[1]) Temp_List.append(i+1) Shop_List.append(Temp_List) Shop_List_Sorted = sorted(Shop_List, key=lambda x:(x[0], x[1])) for k in range(N): print(Shop_List_Sorted[k][2])
p03241
s613233584
Wrong Answer
# coding: utf-8 import math (n, m) = [int(i) for i in input().rstrip().split(" ")] for i in range(n, int(math.sqrt(m)) + 1): if m % i == 0: print(int(m / i)) break
p02631
s165613908
Accepted
n=int(input()) A=list(map(int,input().split())) ans=A[0] for i in range(n-1): ans^=A[i+1] for i in range(n): if n%2: use=A[i] else: use=A[i]^ans print(use)
p02811
s315595587
Accepted
#A - 500 Yen Coins K,X = list(map(int, input().split())) sum = 500*K if sum >= X: print('Yes') else: print('No')
p02598
s718861359
Wrong Answer
from math import floor, ceil def main(): n, k = map(int, input().split()) a = list(map(int, input().split())) a.sort() lower = 1 upper = a[-1] while lower + 1 < upper: target = (lower + upper) // 2 now = 0 for i in range(n): now += ceil(a[i] // target) if now > k: lower = target else: upper = target print(upper if k > 0 else a[-1]) if __name__ == '__main__': main()
p03073
s243449710
Accepted
S = input() n = len(S) pattern1 = [i % 2 for i in range(n)] pattern2 = [i % 2 for i in range(1, n+1)] ans1 = 0 ans2 = 0 for i in range(n): s = S[i] if s == str(pattern1[i]): ans1 += 1 if s == str(pattern2[i]): ans2 += 1 else: ans = min(ans1, ans2) print(ans)
p02700
s433222372
Accepted
a,b,c,d = map(int,input().split()) tk = 0 ao = 0 if c % b != 0: tk = c//b + 1 else: tk = c//b if a % d != 0: ao = a//d + 1 else: ao = a//d if tk <= ao: print("Yes") else: print("No")
p03385
s280401393
Wrong Answer
print("Yes" if "abc" == sorted(input()) else "No")
p02687
s561485892
Wrong Answer
print("ARC")
p03285
s543733604
Accepted
def main(): limit = int(input()) result = False for i in range(26): for j in range(15): if 4 * i + 7 * j == limit: result = True break if result: print("Yes") else: print("No") if __name__ == '__main__': main()
p04045
s977053884
Accepted
n, k = map(int, input().split()) array = list(map(int, input().split())) def jadgesuruo(): for i in range(k): if str(n).find(str(array[i])) >= 0: return False break return True for i in range(10**5): if jadgesuruo(): print(n) break else: n = n + 1
p02661
s209292253
Accepted
N = int(input()) A, B = [], [] for _ in range(N): a, b = map(int, input().split()) A.append(a) B.append(b) A.sort() B.sort() if N % 2: l = A[N // 2] r = B[N // 2] print(r - l + 1) else: l2 = A[N // 2 - 1] + A[N // 2] r2 = B[N // 2 - 1] + B[N // 2] print(r2 - l2 + 1)
p03994
s912085376
Accepted
s = str(input()) n = int(input()) k = ord("z") a = [0]*len(s) for i in range(len(s)): a[i] = ord(s[i]) for i in range(len(s)): if a[i] == ord("a"): continue if n>=k+1-a[i]: n = n-k-1+a[i] a[i] = ord("a") if n<=0: break if n>0: a[-1] += n%26 ans = "" for i in range(len(s)): ans += chr(a[i]) print(ans)
p03043
s976347105
Accepted
import sys input = sys.stdin.readline def main(): N, K = map(int, input().split()) P = 0 for i in range(1,N+1): value = i cnt = 0 while K > value: cnt += 1 value *= 2 P += 1/N * (1/2)**cnt print(P) if __name__ == '__main__': main()
p02778
s641345158
Accepted
S = input() l = len(S) print('x' * l)
p03252
s280573840
Wrong Answer
import sys import collections s = list(map(str,input())) t = list(map(str,input())) cnts = collections.Counter(s) cntt = collections.Counter(t) cs = sorted(cnts.values()) ct = sorted(cntt.values()) print(cs) print(ct) if len(s) != len(t): print("No") sys.exit() for i,j in zip(cs,ct): if i != j: print("No") sys.exit() print("Yes")
p03971
s860475300
Accepted
n,a,b=map(int,input().split()) s=input() cnt_a=0 cnt_b=0 for i in range(n): if s[i]=="a": if cnt_a+cnt_b<a+b: cnt_a+=1 print("Yes") else: print("No") elif s[i]=="b": if cnt_a+cnt_b<a+b and cnt_b<b: cnt_b+=1 print("Yes") else: print("No") else: print("No")
p02598
s921905976
Accepted
N, K = map(int,input().split()) A = [int(x) for x in input().split()] l = 0 r = max(A) + 1 while(l+1<r): m = (l+r)//2 count = 0 for a in A: count += (a-1) // m if count > K: l = m else: r = m print(r)
p03471
s658918846
Wrong Answer
l = list(map(int,input().split())) N = l[0] Y = l[1] S = 0 man = 0 gosen = 0 sen = 0 for i in range(1): while S <= Y-10000: S = S + 10000 man += 1 while S <= Y-5000: S = S + 5000 gosen += 1 while S <= Y-1000: S = S + 1000 sen += 1 if man + gosen +sen > N: print("-1,-1,-1") break else: print(man,gosen,sen)
p04029
s113796750
Wrong Answer
n = int(input()) candy = n*(n+1)/2 print(candy)
p02630
s232830108
Accepted
from collections import Counter n = int(input()) a_array = [int(x) for x in input().split()] d = Counter(a_array) res = 0 for key, value in d.items(): res += key * value q = int(input()) bc_array = [[int(x) for x in input().split()] for y in range(q)] for b, c in bc_array: d.setdefault(b, 0) res -= b * d[b] res += c * d[b] print(res) d[c] += d[b] d[b] = 0
p03838
s537174447
Accepted
x,y=map(int,input().split()) ans=10**10 if x<y:print(min(ans,y-x,abs(x+y)+1)) else:print(min(ans,abs(x+y)+1,abs(x-y)+2))
p03043
s654860676
Accepted
import math N, K = map(int,input().split()) ans = 0 for i in range(1, N+1): if i < K: n = math.ceil(math.log(K/i, 2)) ans += (1/N) * (1/2)**n else: ans += 1/N print(ans)
p03861
s558664772
Wrong Answer
a,b,c=map(int,input().split()) s=0 for i in range(a,b): if i%c==0: s+=1 print(s)
p03379
s016940313
Accepted
n = int(input()) x = list(map(int, input().split())) arr = sorted(x) for i in range(n): if x[i] <= arr[(n+1) // 2 - 1]: print(arr[(n+1) // 2]) else: print(arr[(n+1) // 2 - 1])
p03150
s231460888
Wrong Answer
S = input() K = "keyence" for i in range(len(K)): print(S[:i], S[(i-(len(K))):]) if (K[:i] == S[:i]) and (K[(i-(len(K))):] == S[(i-(len(K))):]): print("Yes") exit() if K == S[:len(K)] or K == S[(-len(K)):]: print("Yes") exit() print("No")
p02678
s636327171
Wrong Answer
import sys input = sys.stdin.readline import copy n, m = map(int, input().split()) INF = 1000000 kamban = [[-1, INF] for _ in range(n+1)] kamban[1] = [1, 0] for i in range(m): a, b = map(int, input().split()) if kamban[a][1] <= kamban[b][1]: kamban[b] = [a, kamban[a][1]+1] else: kamban[a] = [b, kamban[b][1]+1] if [-1, INF] in kamban[1:]: print("No") else: print("Yes") for k in kamban[2:]: print(k[0])
p02629
s564730096
Wrong Answer
n = int(input()) final = [] while 1: q = n//26 r = n%26 final.append(chr(ord('a')+(r-1))) n = q if q == 0: break ans='' for i in final: ans+=i print(ans[::-1])
p03485
s184160322
Accepted
a,b=map(int,input().split()) ans=(a+b+1)//2 print(ans)
p02730
s608979917
Accepted
S = list(input()) k = (len(S) -1) // 2 T = S[0:k] #print(T[::-1]) print("Yes" if S == S[::-1] and T == T[::-1] else "No")
p03637
s257745828
Accepted
n = int(input()) a = list(map(int,input().split())) cnt_2 = [] cnt_4 = [] for i in a: if i%4 == 0: cnt_4.append(i) elif (i%4 != 0) and (i%2 == 0): cnt_2.append(i) if len(cnt_2) == 0: if len(cnt_4)*2+1 >= n: print('Yes') else: print('No') else: if len(cnt_2)+len(cnt_4)*2 >= n: print('Yes') else: print('No')
p03475
s071664529
Accepted
import sys input = sys.stdin.readline def f(): n=int(input()) l=tuple(tuple(map(int,input().split())) for i in range(n-1)) for i in range(n): now=0 for a,s,d in l[i:]: now=a+s-(-max(0,now-s)//d)*d print(now) if __name__=="__main__": f()
p02602
s650970719
Accepted
N, K = map(int, input().split()) A = [int(i) for i in input().split()] for i in range(N-K): if A[i] < A[i + K]: print("Yes") else: print("No")
p02899
s069291806
Accepted
N = int(input()) A = list(map(int, input().split())) res = [0]*N for i in range(N): res[A[i]-1] = i+1 print(' '.join(map(str, res)))
p02606
s889342322
Wrong Answer
l, r, d = map(int, input().split()) cnt = 0 for i in range(1, r - l + 2): if i % d == 0: cnt += 1 print(cnt)
p03041
s305002244
Accepted
n, k = input().split() a = int(n) b = int(k) s = input() result = '' for i in range(a): if i == b-1: result += chr(ord(s[i]) + 32) else: result += s[i] print(result)
p03827
s272703305
Accepted
n = int(input()) s = input() x = 0 ans = [0] for c in s: if c == 'I': x += 1 else: x -= 1 ans.append(x) print(max(ans))
p02608
s712314701
Accepted
n = int(input()) f = [] for _ in range(10000): f.append(0) for x in range(1, 101): for y in range(1, 101): for z in range(1, 101): id = x*x + y*y + z*z + x*y + y*z + z*x if id <= 10000: f[id-1] += 1 for i in range(n): print(f[i])
p02767
s425424988
Accepted
import sys readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines read = sys.stdin.buffer.read sys.setrecursionlimit(10 ** 7) N = int(readline().rstrip()) X = list(map(int, readline().split())) lower = min(X) upper = max(X) ans = float("inf") for P in range(lower, upper+1): dis = 0 for x in X: dis += abs(P - x) ** 2 ans = min(ans, dis) print(ans)
p03319
s214258957
Accepted
n,k=map(int, input().split()) a=list(map(int,input().split())) ans=0 if n==k: print(1) exit() if (n-1)%(k-1) == 0: print((n-1)//(k-1)) else: print((n-1)//(k-1)+1)
p03971
s822291911
Accepted
N, A, B = map(int, input().split()) S = input() total = 0 abroad = 0 for s in S: if s == 'a' and total < (A+B): print('Yes') total += 1 elif s == 'b' and total < (A+B) and abroad < B: print('Yes') total += 1 abroad += 1 else: print('No')
p03206
s236822941
Accepted
d = int(input()) if(d == 22): print('Christmas Eve Eve Eve') elif(d == 23): print('Christmas Eve Eve') elif(d == 24): print('Christmas Eve') else: print('Christmas')