problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p02676
s146539409
Accepted
K = int(input()) S = input() if len(S) <= K: print(S) else: print(S[0:K] + '...')
p03038
s766959772
Accepted
import bisect n,m = map(int,input().split()) a = list(map(int,input().split())) s = [] for i in range(m): b,c = map(int,input().split()) s.append((c,b)) a.sort() s.sort(reverse=True) for i in range(m): b = s[i][1] c = s[i][0] idx = bisect.bisect_left(a,c) if idx == 0: break del a[0:min(b,idx)] for j in range(min(b,idx)): a.insert(bisect.bisect_left(a,c),c) print(sum(a))
p02768
s630038039
Wrong Answer
n, a, b = map(int, input().split()) mmod = 10**9 + 7 def comb_mod(n, r, mod=mmod): nume = 1 deno = 1 for i in range(r): nume = (nume * (n - i)) % mod deno = (deno * (i + 1)) % mod return (nume * pow(deno, mod - 2, mod)) % mod if n == 2: print(0) exit total = (pow(2, n, mmod) - comb_mod(n, a) - comb_mod(n, b) - 1) % mmod print(total)
p03720
s936405368
Accepted
n,m=map(int,input().split()) a=[] for i in range(m): b,c=map(int,input().split()) a.append(b) a.append(c) for i in range(1,n+1): print(a.count(i))
p02623
s366792583
Accepted
N,M,K=map(int,input().split()) A=list(map(int,input().split())) B=list(map(int,input().split())) a=[0] b=[0] for i in range(N): a.append(a[i] + A[i]) for i in range(M): b.append(b[i] + B[i]) ans, j = 0, M for i in range(N + 1): if a[i] > K: break while b[j] > K - a[i]: j -= 1 ans = max(ans, i + j) print(ans)
p03107
s578541407
Wrong Answer
S = list(input()) p_s = None ans = 0 for s in S: if (s == '1' and p_s == '0') or (s == '0' and p_s == '1'): ans += 2 else: p_s = s print (ans)
p02701
s474987931
Wrong Answer
n = int(input()) dic = {} cnt =0 for i in range(n): get = input() if get not in dic: dic[get] = 1 print(len(dic)) print(dic)
p03910
s271712674
Accepted
N = int(input()) if N <= 2: print(N) else: s = 0 l = [] for i in range(1, N): s += i l.append(i) if s > N: break # print(l) for i in range(len(l)): if s-l[i] == N: l.pop(i) break for i in l: print(i)
p03107
s391463606
Accepted
import sys def solve(): input = sys.stdin.readline S = input().strip("\n") zero, one = 0, 0 for i in range(len(S)): if S[i] == "0": zero += 1 else: one += 1 print(2 * min(zero, one)) return 0 if __name__ == "__main__": solve()
p02780
s772340108
Wrong Answer
N,K = map(int,input().split()) L=list(map(int,input().split())) A=[0]*N for i in range(N): t=(L[i]+1)*L[i]/2*(1/L[i]) A[i]=t s=0 t=sum(A[:K]) for i in range(N-K): t+=(A[i+K]-A[i]) s=max(s,t) print(s)
p03243
s049393922
Accepted
n=int(input()) while(1): a=str(n) if a.count(a[0])==3: break n+=1 print(n)
p02882
s236673370
Wrong Answer
import math a,b,x=map(int,input().split()) if a*b**2>=2*x: print(math.atan(a*b**2/(2*x))*180/math.pi) else: print(math.atan((2*b/a)-(2*x/(a**3)))*180/math.pi)
p03208
s191265034
Accepted
N,K = map(int,input().split()) h = [0]*N for i in range(N): h[i] = int(input()) h = sorted(h) ans = 10**10 for i in range(N-(K-1)): tmp = h[i+K-1] - h[i] ans = min(tmp,ans) print(ans)
p02641
s054716712
Accepted
x, n = map(int, input().split()) if n == 0: print(x) else: p = [int(i) for i in input().split()] q = [x] for i in range(200): q.append(x - 1 - i) q.append(x + 1 + i) for i in q: if i not in p: print(i) break
p03417
s387530501
Accepted
a,b = map(int, input().split()) a,b = (a,b) if a<=b else (b,a) if (a == 1) : if (b == 1): print(1) else: print(b -2) else : print((a-2)*(b-2))
p02623
s232903070
Accepted
from bisect import bisect_right from itertools import accumulate n,m,k=map(int,input().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) a_ac=[0]+list(accumulate(a)) b_ac=[0]+list(accumulate(b)) ans=0 for i in range(n+1): remain=k-a_ac[i] if remain<0: break t_ans=i t_ans+=bisect_right(b_ac,remain)-1 ans=max(ans,t_ans) print(ans)
p02881
s023442393
Accepted
from math import sqrt N = int(input()) # 2 <= N <= 10^12 # (1,1) (x,y) = x*y a = N-1 for x in range(2, int(sqrt(N))+1): q, r = divmod(N, x) if r == 0: a = min(x-1 + q - 1, a) print(a)
p03699
s090699201
Accepted
N = int(input()) s = [int(input()) for _ in range(N)] ans = sum(s) if ans % 10 == 0: s.sort() for i in s: if i % 10 != 0: print(ans - i) exit() print(0) else: print(ans)
p02717
s160595935
Wrong Answer
i = input().split() n = int(i[0]) m = int(i[1]) a = [int(i2) for i2 in i[2::]] m2 = sum(a) // (4 * m) c = sum([1 if i >= m2 else 0 for i in a]) if c>=m: print("Yes") else: print("No")
p03592
s178270590
Accepted
import sys input = sys.stdin.readline n, m, k = map(int, input().split()) for i in range(n + 1): for j in range(m + 1): if k == (n - i) * j + (m - j) * i: print('Yes') exit() print('No')
p03545
s993779680
Accepted
# coding:utf-8 number = input() # ABCD 隙間の数は3 n = 3 for bit in range(2 ** n): ope = ['-'] * n for i in range(n): if ((bit >> i) & 1): ope[n - 1 - i] = '+' # print(ope) ans = '' for num, op in zip(number, ope): ans += num + op ans += number[-1] if eval(ans) == 7: print(ans + '=7') exit()
p02584
s176839135
Accepted
x,k,d=map(int,input().split()) x=abs(x) if x>k*d: print(x-k*d) else: k-=x//d if k%2==0: print(x%d) else : print(d-x%d)
p02743
s636138873
Accepted
from decimal import * getcontext().prec = 20 a,b,c = map(int, input().split()) a,b,c = Decimal(a),Decimal(b),Decimal(c) if a.sqrt() + b.sqrt() < c.sqrt(): print('Yes') else: print('No')
p02957
s162506951
Wrong Answer
A,B=map(int,input().split()) if A+B % 2 !=0: print("IMPOSSIBLE") else:print((A+B)//2)
p02939
s901562541
Wrong Answer
S = input() N = len(S) ans = 1 i = 1 while i < N: if S[i] == S[i-1]: i += 2 else: i += 1 ans += 1 print(ans)
p02963
s623459948
Accepted
def main(): S = int(input()) y3 = (S+10**9-1)//10**9 x3 = 10**9 * y3 - S print(0, 0, 10**9, 1, x3, y3) if __name__ == '__main__': main()
p03860
s655646632
Accepted
a,b,c = input().split(" ") print(f"A{b[0]}C")
p03815
s623773300
Accepted
#!/usr/bin/env python3 x = int(input()) a = x // 11 b = x - 11*a if b > 6: print(2*a + 2) elif x % 11 == 0: print(2*a) else: print(2*a + 1)
p03145
s462934183
Accepted
a = list(map(int, input().split())) a.remove(max(a)) print(int(a[0] * a[1] / 2))
p03799
s972486084
Accepted
def main(): N, M = map(int, input().split()) M2 = M//2 if M2 <= N: print(M2) return m = M - N*2 ans = N + m//4 print(ans) if __name__ == "__main__": main()
p03804
s897224409
Accepted
N, M = map(int, input().split()) A = [input() for _ in range(N)] B = [input() for _ in range(M)] be_included = False for i in range(N - M + 1): for j in range(N - M + 1): tmp = [A[k][j:j+M] for k in range(i, i + M)] if tmp == B: be_included = True break if be_included: break if be_included: print('Yes') else: print('No')
p02970
s433642647
Accepted
N,D = map(int, input().split()) x=N/(2*D+1) if x.is_integer()==True: print(int(x)) else: print(int(x)+1)
p02983
s743625126
Accepted
import sys mina=10**10 L,R=map(int,input().split()) for i in range(L,R): for j in range(i+1,R+1): i=i%2019 j=j%2019 mina=min(mina,(i*j)%2019) if mina==0: print(0) sys.exit() print(mina)
p03803
s366661518
Wrong Answer
a,b=map(int, input().split()) if a==1: a=14 elif b==1: b=14 if a > b: print('Alice') elif b >a: print('Bob') else: print('Draw')
p03037
s107979563
Accepted
N, M = map(int, input().split()) maxL = 0 minR = float('inf') for _ in range(M): l, r = map(int, input().split()) maxL = max(maxL, l) minR = min(minR, r) ans = minR - maxL + 1 ans = max(ans, 0) print(ans)
p02882
s088088117
Accepted
import math a, b, x = map(int, input().split()) S = x/a if S > a*b/2: P = 2*b - 2*S/a theta = math.degrees(math.atan(P/a)) else: P = 2*S / b theta = math.degrees(math.atan(b/P)) print(theta)
p03672
s096682167
Accepted
s = input() len_s = len(s) is_ok = False while(is_ok == False): len_s -= 2 word = s[:len_s] if word[:len_s // 2] == word[len_s // 2 :]: is_ok = True else: pass print(len_s)
p02862
s697524810
Accepted
x, y = map(int, input().split()) mod = 10 ** 9 + 7 cnt1 = cnt2 = 0 for i in range(x + 1): x_left = x - i y_left = y - 2 * i if x_left == y_left * 2: cnt1 = i cnt2 = y_left if cnt1 == cnt2 == 0: ans = 0 else: ans = 1 for i in range(1, cnt1 + 1): ans *= (cnt1 + cnt2 - i + 1) ans %= mod ans *= pow(i, mod - 2, mod) ans %= mod print(ans)
p02820
s829360452
Wrong Answer
N, K = map(int, input().split()) R, S, P = map(int, input().split()) T = input() win_hand = {"r": "p", "s": "r", "p": "s"} point = {"r": R, "s": S, "p": P} ans = 0 hand_list = "" for i in range(N): if i >= K and win_hand[T[i]] == hand_list[i-K]: hand_list += T[i] else: ans += point[win_hand[T[i]]] hand_list += win_hand[T[i]] print(ans)
p03012
s686310876
Wrong Answer
N = int(input()) W = [int(weight) for weight in input().split()] sum_w = sum(W) left_sum = 0 min = 10000 min_index = 0 for i in range(len(W)): left_sum += W[i] if abs(2*left_sum - sum_w) < min: min = abs(2*left_sum - sum_w) min_index = i print(min_index+1)
p02801
s948953014
Accepted
c = input() print(chr(ord(c) + 1))
p03417
s613630276
Accepted
#!/usr/bin/env python3 n,m = map(int,input().split()) if n == 1 and m == 1: print(1) elif n == 1 or m == 1: print(max(n,m)-2) else: print((n-2)*(m-2))
p03380
s710348706
Wrong Answer
import bisect def main(): N = int(input()) a = [int(i) for i in input().split()] a.sort() n = a[-1] m = n // 2 right = bisect.bisect_right(a, m) if a[right-1] == m: r = m elif m - a[right-1] <= a[right] - m: r = a[right-1] else: r = a[right] print(n, r) if __name__ == "__main__": main()
p02948
s905868611
Wrong Answer
from collections import defaultdict import sys input=sys.stdin.readline N,M=map(int,input().split()) ablist=[] for i in range(N): A,B=map(int,input().split()) ablist.append((B,-A)) ablist.sort() answer=0 for i in reversed(range(M)): ablist_sub=[] while ablist: b,ma=ablist.pop() a=-ma if i+a<=M: answer+=b #print(i,a,b) break else: ablist_sub.append((b,ma)) for ab in ablist_sub: ablist.append(ab) print(answer)
p03284
s739299380
Accepted
import os import sys from collections import defaultdict, Counter from itertools import product, permutations,combinations, accumulate from operator import itemgetter from bisect import bisect_left,bisect from heapq import heappop,heappush,heapify from math import ceil, floor, sqrt from copy import deepcopy def main(): n,k = map(int, input().split()) if n%k == 0: print(0) else: print(1) if __name__ == "__main__": main()
p03485
s416531481
Accepted
import math a,b = map(int, input().split()) ans = math.ceil((a+b)/2) print(ans)
p03035
s566539503
Accepted
A, B = map(int, input().split()) print(B if A >= 13 else 0 if A <= 5 else B//2)
p03038
s591472126
Accepted
n, m = map(int, input().split()) A = list(map(int, input().split())) d = {} for a in A: d[a] = 1 if a not in d else d[a] + 1 for _ in range(m): b, c = map(int, input().split()) d[c] = b if c not in d else d[c] + b ans = 0 cnt = 0 L = sorted(d, reverse=True) for k in L: if d[k] + cnt < n: ans += k * d[k] cnt += d[k] else: ans += k * (n - cnt) break print(ans)
p02707
s477295923
Wrong Answer
import numpy as np def calculate_num_boss(num_person, boss): boss_count = np.zeros([num_person]) result, num = np.unique(boss, return_counts=True) for idx in range(result.shape[0]): ids = result[idx] boss_count[ids-1] = num[idx] return boss_count if __name__ == "__main__": num_person = int(input().split()[0]) bosses = np.array([int(i) for i in input().split()])
p03479
s927611189
Wrong Answer
import math X,Y=map(int,input().split()) #print(math.floor(math.log(Y/X,2))+1) if 2*X<Y: print(math.floor(math.log(Y/X,2))+1) else: print(1)
p02918
s590757390
Wrong Answer
n,k=map(int,input().split()) S=input() c=0 d=0 for i in range(n-1): if S[i]==S[i+1]: c+=1 if S[i]!=S[i+1]: d+=1 print(c+2*d-1 if (d<=k and S[0]!=S[-1]) else c+2*k)
p03041
s020846666
Wrong Answer
a, b = map(int, input().split()) t = input() print(t.replace(t[b-1], t[b-1].upper()))
p03252
s139151494
Accepted
s = input() t = input() my_d = dict() for i, ch in enumerate(s): if ch not in my_d: if t[i] in my_d.values(): print('No') exit() else: my_d[ch] = t[i] else: if my_d[ch] != t[i]: print('No') exit() print('Yes')
p02554
s034421571
Wrong Answer
from math import comb if __name__=="__main__": n=int(input()) if n==1: print(0) exit else: print(comb(n,2)*2)
p03437
s008338169
Accepted
x, y = map(int, input().split()) if x % y == 0: print(-1) exit() for i in range(1, 10 ** 5): if (x * i) % y != 0: print(x * i) exit()
p03803
s065154065
Wrong Answer
A,B = map(int,input().split()) if (A==1 and B!=1): print("Alice") exit() elif(B==1 and A!=1): print("Bob") if (A>B): print("Alice") elif(A<B): print("Bob") elif(A==B): print("Draw")
p03435
s004391429
Accepted
grid = [list(map(int, input().split())) for _ in range(3)] ans = 'Yes' b1 = 0 a1 = grid[0][0] a2 = grid[1][0] a3 = grid[2][0] b2 = grid[0][1] - a1 b3 = grid[0][2] - a1 if b2 + a2 != grid[1][1]: ans = 'No' if b2 + a3 != grid[2][1]: ans = 'No' if b3 + a2 != grid[1][2]: ans = 'No' if b3 + a3 != grid[2][2]: ans = 'No' print(ans)
p02835
s769552522
Wrong Answer
print("bwuisnt"[sum(map(int,input().split())) > 22::2])
p02595
s381434148
Accepted
N,D=[int(s) for s in input().split()] ans=0 for i in range(N): a,b=[int(s) for s in input().split()] if a*a+b*b<=D*D: ans+=1 print(ans)
p03427
s212275896
Accepted
N = int(input()) keta = len(str(N)) SN = str(N) if N <= 9: print(N) elif SN.count('9') == keta: print(9*keta) elif SN.count('9') == keta-1 and SN[0] != '9': print((keta - 1) * 9 + int(SN[0])) else: print((keta - 1) * 9 + int(SN[0])-1)
p03611
s275467031
Wrong Answer
N=int(input()) A=[0]*10**5 b=input().split() numbers=[int(a) for a in b] for a in numbers: A[a-1]+=1 list=[] for z in range(10**5-2): y=A[z]+A[z+1]+A[z+2] list.append(y) print(max(list))
p02993
s558262019
Accepted
import sys S = input() for i in range(0, len(S)-1): if S[i] == S[i+1]: print('Bad') sys.exit() print('Good')
p03804
s241944984
Accepted
n, m = list(map(int, input().split())) a = [input() for _ in range(n)] b = [input() for _ in range(m)] ans = False for y in range(n-m+1): for x in range(n-m+1): sol = True for h in range(m): if a[y+h][x:x+m] != b[h]: sol = False break if sol: ans = True break if ans: break print("Yes" if ans else "No")
p02727
s444271586
Accepted
from sys import stdin import sys import math from functools import reduce import functools import itertools from collections import deque,Counter from operator import mul from functools import reduce x,y,a,b,c = list(map(int, input().split())) p = list(map(int, input().split())) q = list(map(int, input().split())) r = list(map(int, input().split())) p = sorted(p, reverse=True)[:x] q = sorted(q, reverse=True)[:y] r = sorted(r, reverse=True) pq = sorted(p+q) ans = sum(pq) for i in range(len(r)): if pq[i] < r[i]: ans = ans + r[i] -pq[i] else: break print(ans)
p02785
s716380507
Wrong Answer
a = [] a = input().split() N = int(a[0]) K = int(a[1]) H = input().split() H = [int(i) for i in H] #print('N=', N, 'K=', K) #print('H=', H) H = sorted(H, reverse = True) #print('sort H=', H) if K == 0: H = H if K == 1: del H[0] if K > 1: del H[0 : K - 1] #print('del H=', H) T = sum(H) print(T)
p03565
s322030139
Accepted
import numpy as np S = input() T = input() m = len(S) n = len(T) for i in range(m-n, -1, -1): if np.prod([s in [t, '?'] for s, t in zip(S[i:i+m], T)]): ans = S[:i] + T + S[i+n:] ans = ans.replace('?', 'a') break else: ans = 'UNRESTORABLE' print(ans)
p03035
s297079338
Accepted
A,B = map(int,input().split()) if A >= 13: print(B) elif A <= 5: print(0) else: print(int(B/2))
p03073
s121109012
Accepted
S=input() S0=S[::2] S1=S[1::2] print(min(len(S)-S0.count("0")-S1.count("1"),len(S)-S0.count("1")-S1.count("0")))
p03351
s086706591
Accepted
a,b,c,d = map(int,input().split()) if abs(a-b) <= d and abs(b-c) <= d: print("Yes") elif abs(a-c) <= d: print("Yes") else: print("No")
p02658
s926371371
Accepted
n = int(input()) a = list(map(int, input().split())) ans = 1 t = 1e18 if 0 in a: print(0) exit(0) for i in range(n): ans *= a[i] if ans > t: print(-1) exit(0) print(ans)
p02682
s659041739
Wrong Answer
A, B, C, K = map(int, input().split()) if A + B >= K: print(A) else: print(A - (K - (A + B)))
p02899
s293529453
Wrong Answer
N=int(input()) A=list(map(int,input().split())) B={} for i,j in enumerate(A): B[j]=i+1 ansdic=sorted(B.items(), key=lambda x:x[0]) l=[] for i in ansdic: l.append(i[1]) print(l)
p03317
s171237682
Wrong Answer
#import numpy as np import sys, math from itertools import permutations, combinations from collections import defaultdict, Counter, deque from math import factorial#, gcd from bisect import bisect_left, bisect_right #bisect_left(list, value) sys.setrecursionlimit(10**7) enu = enumerate MOD = 10**9+7 def input(): return sys.stdin.readline()[:-1] pl = lambda x: print(*x, sep='\n') N, K = map(int, input().split()) A = list(map(int, input().split())) mi = A.index(1) lc = math.ceil(mi/2) rc = math.ceil((N-mi-1)/2) print(lc+rc)
p02766
s100742333
Accepted
n, k = map(int, input().split()) cur = 1 while n // (k ** cur) > 0: cur += 1 print(cur)
p03281
s281186552
Wrong Answer
N = int(input()) if N < 105: print(0) elif N < 165: print(1) elif N < 195: print(2) else: print(3)
p03017
s582104571
Accepted
n,a,b,c,d = map(int,input().split()) s = input() if c<d: if "##" not in s[a-1:d]: print("Yes") else: print("No") else: if "..." in s[b-2:d]: print("Yes") else: if s[d-2]=="#": print("No") else: print("Yes")
p02664
s129829069
Wrong Answer
t = list(input()) for i in range(len(t)-1): # ?が出たら前後の値から考える if t[i] == '?': if t[i+1] == 'D': t[i] = 'P' elif t[i+1] == '?' and t[i-1] != 'P': t[i] = 'P' else: t[i] = 'D' if t[len(t)-1] == '?': t[len(t)-1] = 'D' print("".join(t))
p02911
s513322067
Accepted
N, K, Q = map(int, input().split()) A = [] for i in range(Q): a = int(input()) A.append(a) l = list() for i in range(N): l.append(K-Q) for a in A: l[a-1] += 1 for j in l: if j > 0: print("Yes") else: print("No")
p03817
s454166947
Accepted
x = int(input()) if 1 <=x%11 <= 6: print(x//11*2+1) elif 7 <= x%11 <= 10: print(x//11*2+2) else: print(x//11*2)
p02742
s258547815
Accepted
H, W = map(int, input().split()) import math if H == 1 or W == 1: print(1) else: print(math.ceil(H * W / 2))
p02682
s612308329
Accepted
A,B,C,K=input().split() A=int(A) B=int(B) C=int(C) K=int(K) if (0<=A)and(0<=B)and(0<=C)and(1<=K<=A+B+C<=2*10**9): if K<=A: print(K) if A<K<=A+B: print(A) if A+B<K<=A+B+C: a=A-(K-A-B) print(a)
p03778
s570952093
Wrong Answer
w, a, b = list(map(int, input().split())) print(abs(b - (a + w)))
p03817
s270503966
Wrong Answer
x = int(input()) ans = x // 11 * 2 + (x % 11) // 6 + 1 print(ans)
p03331
s607438725
Wrong Answer
N = int(input()) def digit_sum(A): S = 0 while A > 0: S += A % 10 A //= 10 return S ans = N for A in range(N): cand = digit_sum(A) + digit_sum(N - A) ans = min(ans, cand) print(ans)
p02831
s133371909
Wrong Answer
a,b=sorted(map(int,input().split())) #ユークリッドの互除法 def gcd(a,b): if b==0: return a else: return (gcd(b,a%b)) #recursive function print(gcd(a,b)*a*b) #ユークリッドの互除法)
p02847
s124443615
Accepted
date = input() List = ['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN'] for i in range(len(List)): if List[i] == date: print(i+1)
p02695
s014400606
Accepted
import itertools n,m,q=list(map(int,input().split())) abcd=[[] for i in range(q)] for i in range(q): abcd[i]=list(map(int,input().split())) ans=0 l=list(itertools.combinations_with_replacement([a for a in range(1,m+1)],n)) x=(len(l)) for i in range(x): e=l[i] wa=0 for t in range(q): if e[abcd[t][1]-1]-e[abcd[t][0]-1]==abcd[t][2]: wa+=abcd[t][3] ans=max(ans,wa) print(ans)
p02973
s800010215
Wrong Answer
N = int(input()) A = [0] * N for i in range(N): A[i] = int(input()) ans = 1 cur_min = A[0] for i in range(1, N): if A[i] <= cur_min: ans += 1 cur_min = A[i] print(ans)
p03359
s124171492
Wrong Answer
import sys a, b = map(int, sys.stdin.readline().split()) def main(): print(min(a, b)) if __name__ == '__main__': main()
p02713
s220798507
Wrong Answer
import math a = input() sum = 0 for i in range(int (a)): for j in range(int(a)): for k in range(int(a)): sum += math.gcd(math.gcd(i+1,j+1),k+1) print
p03284
s721054360
Wrong Answer
N,K=map(int,input().split()) print(N%K)
p02622
s628156420
Accepted
#!/usr/bin/env python3 import sys from itertools import chain def solve(S: str, T: str): answer = sum([s != t for s, t in zip(S, T)]) return answer def main(): tokens = chain(*(line.split() for line in sys.stdin)) S = next(tokens) # type: str T = next(tokens) # type: str answer = solve(S, T) print(answer) if __name__ == "__main__": main()
p03759
s604054585
Wrong Answer
a,b,c=map(int,input().split()) print("YES" if b-a==c-a else "NO")
p03457
s112830350
Wrong Answer
N = int(input()) count = 0 t_pre, x_pre, y_pre = 0, 0, 0 for i in range(N): t, x, y = map(int, input().split()) if (abs(x - x_pre) + abs(y - y_pre) <= t - t_pre) and t%2 == (x + y)%2 : print('Yes') else: print('No')
p02645
s271456260
Accepted
import random name = input() n = random.choice(name) while name.find(n) > len(name) - 3: n = random.choice(name) num = name.find(n) for i in range(3): print(name[num + i], end = "")
p03448
s579708429
Accepted
A=int(input()) B=int(input()) C=int(input()) X=int(input()) res=0 for a in range(A+1): for b in range(B+1): for c in range(C+1): if a*500+b*100+c*50==X: res+=1 print(res)
p03408
s894337300
Accepted
from collections import Counter n = int(input()) s = list(input() for _ in range(n)) m = int(input()) t = list(input() for _ in range(m)) res = Counter(s) for i in range(m): if t[i] in res: res[t[i]] -= 1 ans = 0 for v in res.values(): ans = max(ans, v) print(ans)
p03127
s785361026
Accepted
def solve(a, b): mod = b%a if mod == 0: return a else: return solve(mod, a) N = int(input()) A = list(map(int, input().split())) minA = min(A) B = [a%minA for a in A] print(solve(minA, max(B)))
p02819
s034112061
Wrong Answer
X=int(input()) for i in range(X,10**6): for j in range(2,i): if i%j==0: break if j==i-1: print(i) exit()
p02595
s193447413
Accepted
N,D=map(int,input().split()) ans=0 for _ in range(N): X,Y=map(int,input().split()) if X*X+Y*Y<=D*D: ans+=1 print(ans)