problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p02911
s307627541
Accepted
N, K, q=map(int, input().split()) score=[0]*N for i in range(q): tmp=int(input()) score[tmp-1]+=1 for i in range(N): if K-(q-score[i])>0: print("Yes") else: print("No")
p03485
s806501986
Accepted
a, b = map(int, input().split()) ave = (a+b)/2 print(int(ave+0.5))
p03387
s574009054
Accepted
a = list(map(int,input().split())) count = 0 while max(a)-min(a) >= 2: count += (max(a)-min(a))//2 a =sorted(a) if (a[-1]-a[0])%2 == 0: a[0] = a[-1] else: a[0] = a[-1] - 1 while max(a)!=min(a): a =sorted(a) a[0] += 1 a[1] += 1 count += 1 print(count)
p02900
s992339728
Accepted
a,b=map(int,input().split()) def factorization(n): arr = [] temp = n for i in range(2, int(-(-n**0.5//1))+1): if temp%i==0: cnt=0 while temp%i==0: cnt+=1 temp //= i arr.append([i, cnt]) if temp!=1: arr.append([temp, 1]) return arr def gcd(a,b): if b==0: return a return gcd(b,a%b) g=gcd(a,b) l=factorization(g) print(len(l)+1)
p03274
s576750033
Wrong Answer
n,k=map(int,input().split()) x=list(map(int,input().split())) st=0 m=3*10**8 for i in range(n-1): if x[i]<0 and x[i+1]>=0: st=i+1 for i in range(n-k+1): mi=x[k+i-1]-x[i]+min(abs(x[k+i-1]),abs(x[i])) if k+i<st or i>st:continue if mi <m:m=mi print(m if x[0]!=0 else m-1)
p04005
s736111718
Wrong Answer
a,b,c=map(int,input().split()) for i in [a,b,c]: if i==0: print(0) break else: s=a*b*c/max(a,b,c) print(int(s))
p03644
s190742773
Wrong Answer
N = int(input()) dic = {} for i in range(1, N+1): n = i cnt = 0 while i % 2 == 0: cnt += 1 i = i // 2 dic[n] = cnt a = 0 b = 0 for k, v in dic.items(): if a < v: b = k a = v print(b)
p02958
s248044674
Wrong Answer
N = int(input()) p = list(map(lambda x: int(x), input().split(" "))) cnt = 0 for i in range(len(p)): cnt += 1 if p[i] != i + 1 else 0 print("Yes") if cnt in [0, 2] else print("No")
p03286
s031850701
Accepted
n = int(input()) ans = [] while n!=0 and n!=1: ans.append((-n)%2) n = -(n//2) ans.reverse() ans = [n]+ans ans = [str(n) for n in ans] print(''.join(ans))
p02553
s168408159
Accepted
n = input() m = n.split(" ") x_min = int(m[0]) x_max = int(m[1]) y_min = int(m[2]) y_max = int(m[3]) a = x_min * y_min b = x_min * y_max c = x_max * y_min d = x_max * y_max if a >= b and a >= c and a >= d: print(a) elif b >= a and b >= c and b >= d: print(b) elif c >= a and c >= b and c >= d: print(c) elif d >= a and d >= b and d >= c: print(d)
p02613
s785593029
Accepted
n = int(input()) ans = [0,0,0,0] for _ in range(n): s = input() if s == 'AC': ans[0] += 1 elif s == 'WA': ans[1] += 1 elif s == 'TLE': ans[2] += 1 else: ans[3] += 1 print('AC x ' + str(ans[0])) print('WA x ' + str(ans[1])) print('TLE x ' + str(ans[2])) print('RE x ' + str(ans[3]))
p02970
s007931230
Accepted
import math N, D = map(int, input().split()) print(math.ceil(N / (2 * D + 1)))
p02639
s056606750
Wrong Answer
a = list(map(int,input().split())) for i in range(len(a)): if a[i] == 0: print(i) break
p04020
s173260975
Accepted
N = int(input()) ans = 0 prev_A = -10 prev_card_num = 0 for i in range(1,N+1): A = int(input()) ans += (prev_card_num + A)//2 if prev_card_num == 1 and A == 0: prev_card_num = 0 elif (prev_card_num+A)%2 == 1: prev_card_num = 1 prev_A = i else: prev_card_num = 0 prev_A = i print(ans)
p03286
s765173662
Wrong Answer
N=int(input()) d=-2 ans=[] while N!=0: r=N%(d) if r<0: r+=2 N=(N-r)//(d) ans.append(str(r)) print("".join(ans[::-1]))
p02817
s941503582
Wrong Answer
H,W = [x for x in input().split()] print(H+W)
p02842
s125281790
Accepted
n=int(input()) for i in range(50000): if int(i*1.08)==n: print(i) exit() if i*1.08>n: break print(":(")
p02951
s163513037
Accepted
a,b,c = map(int,input().split()) if b+c > a: di = a - b print(c - di) else: print(0)
p02987
s664702087
Accepted
x=sorted(list(input())) if x[0]==x[1] and x[1]!=x[2] and x[2]==x[3]: print("Yes") else: print("No")
p03371
s919591229
Wrong Answer
a,b,c,x,y=map(int,input().split()) ans=int(5000*(10**5)) for i in range(10**5): a_cnt=max(0,x-i) b_cnt=max(0,y-i) total=i*2*c+a_cnt*a+b_cnt*b ans=min(ans,total) print(ans)
p02811
s734398058
Accepted
k,x=map(int,input().split()) print("Yes" if x<=k*500 else "No")
p02972
s717346543
Wrong Answer
N = int(input()) A = [0] + [int(s) for s in input().split(' ')] B = [0] * (N + 1) count = 0 ret = [] for i in range(N, 0, -1): ai = A[i] ii = i total = 0 while ii < N: total += B[ii] ii += i if total % 2 == ai: continue else: B[i] = 1 count += 1 ret.append(i) print(count) print(' '.join(str(i) for i in ret))
p02623
s600380507
Accepted
n,m,k = map(int,input().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) aa = [0] bb = [0] for i in range(n): aa.append(a[i]+aa[i]) for i in range(m): bb.append(b[i]+bb[i]) ans=0 j=m for i in range(n+1): if aa[i]>k: break while bb[j]>k-aa[i]: j-=1 ans=max(i+j,ans) print(ans)
p03617
s822511070
Wrong Answer
import sys def I(): return int(sys.stdin.readline().rstrip()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) Q,H,S,D = LI() N = I() min_1 = min(Q*4,H*2,S) price = [min_1,D] if 2*min_1<=D: ans = min_1*N else: ans = N//2*D+min_1 print(ans)
p03544
s273554170
Wrong Answer
n=int(input()) a=[2,1] for i in range(2,n): a.append(a[i-1]+a[i-2]) print(a[n-1])
p03779
s610183283
Wrong Answer
X=int(input()) time=0 p=0 j=1 while True: if p+j==X: time+=1 break elif X-(p+j)>=j+1: p+=j j+=1 time+=1 print(time)
p02726
s414835832
Accepted
from collections import Counter N,X,Y = map(int, input().split()) X -= 1 Y -= 1 L = [] for i in range(N-1): for j in range(i+1,N): L.append(min(abs(i-j),abs(X-i)+abs(Y-j)+1,abs(Y-i)+abs(X-j)+1)) D = Counter(L) for k in range(1,N): print (D[k])
p03723
s567312636
Accepted
a,b,c = map(int,input().split()) if a%2==1 or b%2==1 or c%2==1: print(0) elif a == b == c: print(-1) else: ans = 0 while a%2==b%2==c%2==0: a,b,c = (b+c)//2,(c+a)//2,(a+b)//2 ans += 1 print(ans)
p02796
s405273018
Wrong Answer
N = int(input()) arms = [list(map(int, input().split())) for _ in range(N)] arms.sort() ans = 1 left = arms[0][0] + arms[0][1] for i in range(1, N): if left <= arms[i][0] - arms[i][1]: ans += 1 left = arms[i][0] + arms[i][1] print(ans)
p03286
s878014148
Accepted
n=int(input()) s='' if n==0: print(0) exit() while n!=0: m=n%2 s+=str(m) n=(n-m)//-2 print(s[::-1])
p03495
s473710095
Accepted
import collections N,K = map(int,input().split()) d = collections.defaultdict(int) b = map(int,input().split()) for e in b: d[e]+=1 ret = 0 a = sorted([v for v in d.values()],reverse=True) while len(a) > K: ret += a.pop() print(ret)
p03695
s868294924
Wrong Answer
n = int(input()) a = list(map(int, input().split())) a.sort() l = [x//400 if x//400 <= 7 else 8 for x in a] p = [0]*8 for i in l: if i < 8: p[i] = 1 if p.count(0) == 8: pmin = 1 pmax = pmin + min(l.count(8)-1,p.count(0)-1) else: pmin = sum(p) if sum(p) != 0 else 1 pmax = pmin + min(l.count(8),p.count(0)) print(l) print(p) print(pmin, pmax)
p03761
s768907408
Accepted
import collections n = int(input()) S = [] for i in range(n): s = collections.Counter(input()) S.append(s) ans = '' for key in S[0].keys(): cnt = S[0][key] for i in range(1,n): cnt = min(cnt,S[i][key]) for i in range(cnt): ans += key ans = sorted(ans) print(''.join(ans))
p03627
s190474577
Accepted
N = int(input()) A = list(map(int, input().split())) from collections import Counter c = Counter(A) x = 0 y = 0 for k, v in sorted(c.items(), key=lambda x: -x[0]): if v >= 4 and x == 0 and y == 0: x = y = k elif v >= 2: if x == 0: x = k elif y == 0: y = k print(x*y)
p03838
s094479754
Accepted
x, y = map(int, input().split()) if y*x < 0: ans = abs(x + y) + 1 elif y*x == 0: if x < y: ans = y - x else: ans = x - y + 1 else: if x < y: ans = y - x else: ans = x - y + 2 print(ans)
p03126
s390478396
Wrong Answer
n,m=map(int,input().split()) ans=list(range(1,m+1)) print(ans) for i in range(n): l=list(map(int,input().split()))[1:] ans=list(set(ans)&set(l)) print(len(ans))
p02730
s461781671
Accepted
s = input() n = len(s) s1 = s[:n//2] s2 = s[n//2 + 1:] if s == s[::-1] and s1 == s1[::-1] and s2 == s2[::-1]: print("Yes") else: print("No")
p03137
s041550127
Accepted
N,M=map(int,input().split()) X=list(map(int,input().split())) X.sort() Y=[] for i in range(len(X)-1): Y.append(X[i+1]-X[i]) Y.sort() if N!=1: Y = Y[:-(N-1)] print(sum(Y)) else: print(sum(Y))
p04005
s669620434
Accepted
a, b, c = list(map(int, input().split())) if a % 2 == 1 and b % 2 == 1 and c % 2 == 1: print(min(a*b, b*c, a*c)) else: print(0)
p03705
s863980232
Wrong Answer
N, A, B = map(int, input().split()) if A > B: print(0) elif N == 1 and A != B: print(0) elif N == 1 and A == B: print(1) elif N == 2 and A != B: print(1) else: print(1000)
p02847
s889390205
Wrong Answer
day = input() week = ["SAT","FRY","THU","WED","TUE","MON","Sun"] for s in range(len(week)): if day == week[s]: print(s + 1)
p02612
s575723385
Wrong Answer
N = int(input()) while N >= 1000: N = N - 1000 else: print(N)
p04034
s451808044
Wrong Answer
n, m = map(int, input().split()) XY = list(map(int, input().split()) for _ in range(m)) Ball = [1] * n Done = [False] * n flg = True for i in range(m): x, y = XY[i] x -= 1 y -= 1 if Ball[x] >= 1: Ball[x] -= 1 Ball[y] += 1 if x == 0 and flg: Done[y] = True flg = False elif Done[x]: Done[y] = True res = 0 for i in range(n): if Ball[i] != 0 and Done[i]: res += 1 print(res)
p03329
s743124097
Accepted
n = int(input()) dp = [n+1]*(n+1) dp[0] = 0 for i in range(1, n+1): j = 1 while j <= n: dp[i] = min(dp[i], dp[i-j]+1) j *= 6 k = 1 while k <= n: dp[i] = min(dp[i], dp[i-k]+1) k *= 9 print(dp[n])
p03611
s658656432
Accepted
from collections import Counter N = int(input()) A = list(map(int, input().split())) for i in range(N): A.append(A[i]-1) A.append(A[i]+1) S = Counter(A) print(max(S.values()))
p03210
s725075106
Wrong Answer
x = int(input()) lis = [3,5,7] for i in range(3): if x == lis[i]: print("Yes") else: print("No")
p03495
s408656630
Accepted
from collections import Counter N, K = map(int, input().split()) A = Counter(input().split()) print(sum(sorted(A.values(), reverse=True)[K:]))
p04029
s121549840
Wrong Answer
n = int(input()) res = 1 for i in range(n): res *= (i+1) print(res)
p03219
s170836453
Accepted
X, Y = map(int, input().split()) print(int(X+Y/2))
p02608
s502829718
Accepted
n=int(input()) d=[0 for i in range(10**7)] def jud(l): if len(set(l))==3: return 6 if len(set(l))==2: return 3 if len(set(l))==1: return 1 for i in range(1,101): for j in range(i,101): for k in range(j,101): l=[i,j,k] p=i**2+j**2+k**2+i*j+j*k+k*i d[p-1]+=jud(l) for i in range(n): print(d[i])
p03433
s009492856
Accepted
n = int(input()) a = int(input()) print("Yes" if n%500 <=a else "No")
p03633
s113205480
Wrong Answer
def gcd(a,b): while b: a,b=b,a%b return a def lcm(a,b): return a*b//gcd(a,b) N=int(input()) T=[] total=1 for i in range(N): a=int(input()) T.append(a) T_set=sorted(list(set(T))) M=len(T_set) if M==1: ans=T_set[0] else: for i in range(M-1): ans=lcm(T_set[i],T_set[i+1]) print(ans)
p02795
s905758541
Accepted
# Problem A - Painting import math # input H = int(input()) W = int(input()) N = int(input()) # initialization max_num = max(H, W) ans = math.ceil(N / max_num) # output print(ans)
p03804
s066570830
Wrong Answer
N, M = map(int, input().split()) A = [input() for _ in range(N)] B = [input() for _ in range(M)] diff = N-M for d in range(diff): for i in range(M): for j in range(M): flag = True if B[i][j] != A[i+d][j+d]: flag = False break if flag: print('Yes') exit() print('No')
p03427
s029810236
Accepted
N = input() if N[0] == "9": if N[1:] == "9" * len(N[1:]): print(9 * len(N)) else: print(9 * len(N) - 1) else: if N[1:] == "9" * len(N[1:]): print(int(N[0]) + 9 * len(N[1:])) else: print(int(N[0]) + 9 * len(N[1:]) - 1)
p02923
s661701697
Wrong Answer
N=int(input()) H=list(map(int,input().split())) ans=0 _=0 for i in range(N-1): if H[i]>=H[i+1]: _+=1 else: if _>ans: ans=_ _=0 print(ans)
p02957
s863772204
Accepted
A, B = map(int, input().split()) print((A+B)//2 if (A+B) % 2 == 0 else "IMPOSSIBLE")
p03605
s354972974
Wrong Answer
n=input() if n in "9": print("Yes") else: print("No")
p02973
s453916506
Accepted
from collections import deque import bisect N = int(input()) A = [int(input()) for i in range(N)] q = deque([A[0]]) for a in A[1:]: idx = bisect.bisect_left(q, a) if idx == 0: q.appendleft(a) else: q[idx-1] = a print(len(q))
p03659
s376603458
Accepted
N = int(input()) a = list(map(int,input().split())) csum = [] s = 0 for i in range(N): s += a[i] csum.append(s) if N == 2: print(abs(a[0] - a[1])) exit() s = sum(a) ans = 1e10 for i in range(1,N-1): ans = min(ans,abs(2*csum[i]-s)) print(ans)
p02765
s590433832
Accepted
N,R = map(int, input().split()) if N>=10: print(R) else: print(R+100*(10-N))
p02897
s283719988
Accepted
#!/usr/bin/env python3 # Generated by https://github.com/kyuridenamida/atcoder-tools from typing import * import collections import functools as fts import itertools as its import math import sys INF = float('inf') def solve(N: int): return (N//2 + N % 2) / N def main(): sys.setrecursionlimit(10 ** 6) def iterate_tokens(): for line in sys.stdin: for word in line.split(): yield word tokens = iterate_tokens() N = int(next(tokens)) # type: int print(f'{solve(N)}') if __name__ == '__main__': main()
p03041
s622323834
Wrong Answer
N, K = map(int,input().split()) S = list(input()) S[K-1]=S[K-1].lower() ans=' '.join(S) print(ans)
p03282
s857210506
Accepted
import sys S = input() K = int(input()) for k in range(K): if S[k] != "1": print(S[k]) sys.exit() print(1)
p03160
s908363696
Accepted
N = int(input()) h = list(map(int,input().split())) cost = [0]*N cost[0] = 0 cost[1] = abs(h[1]-h[0]) for i in range(2,N): cost[i] = min((cost[i-2]+abs(h[i]-h[i-2])), (cost[i-1]+abs(h[i]-h[i-1]))) print(cost[-1])
p02873
s838450589
Accepted
S = input() A = [] A.append(0) for i in range(len(S)): if S[i] == "<": A.append(A[i] + 1) else: A.append(0) for i in range(len(S)): if S[len(S) - i - 1] == ">": A[len(S) - i - 1] = max(A[len(S) - i - 1], A[len(S) - i] + 1) else: continue # print(A) print(sum(A))
p03137
s084677532
Wrong Answer
N,M = map(int,input().split()) X = list(map(int,input().split())) li = [0]*(M-1) X.sort() for i in range(M-1): li[i] = abs(X[i+1]-X[i]) li.sort() print(sum(li[:M-N]))
p03043
s432810446
Accepted
N, K = map(int, input().split()) p = 0 for i in range(1, N + 1): j = 0 while (i << j) < K: j += 1 p += 0.5**j ans = p / N print(ans)
p02708
s359222177
Wrong Answer
N,K=map(int,input().split()) ans=0 for i in range(K-1,N+1): c=(i+1)*i/2 d=(N+N-i)*(i+1)/2 ans+=int(d-c+1) print(ans)
p02695
s857145392
Accepted
import itertools n, m, q = map(int, input().split()) abcds = [tuple(map(int, input().split())) for _ in range(q)] x = [(i + 1) for i in range(m)] ans = 0 for elem in itertools.combinations_with_replacement(x, n): rep = 0 for i in range(q): if elem[abcds[i][1] - 1] - elem[abcds[i][0] - 1] == abcds[i][2]: rep += abcds[i][3] ans = max(ans, rep) print(ans)
p02860
s604539298
Wrong Answer
N = int(input()) S = input() T = list() for i in range(int(N / 2), N): t = S[i] T.append(t) y = 0 n = 0 for i, k in zip(T, S): if i == k: y += 1 else: n += 1 if y >= int(N / 2): print('Yes') else: print('No')
p02993
s103580355
Accepted
s = list(str(input())) for i in range(3): if s[i] == s[i+1]: print("Bad") quit() print("Good")
p02682
s600698853
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)))
p03557
s366951941
Accepted
import bisect def main(): N = int(input()) AArr = list(map(int, input().split())) BArr = list(map(int, input().split())) CArr = list(map(int, input().split())) AArr.sort() CArr.sort() ans = 0 for i in range(N): a = bisect.bisect_left(AArr, BArr[i]) c = bisect.bisect_right(CArr, BArr[i]) c = N-c ans += a*c print(ans) if __name__ == '__main__': main()
p03854
s059474967
Wrong Answer
S = input()[::-1] S = S.replace('dream'[::-1], '').replace('dreamer'[::-1], '').replace( 'eraser'[::-1], '').replace('erase'[::-1], '') if len(S) == 0: print('YES') else: print('NO')
p03345
s543119441
Accepted
a,b,c,k = map(int, open(0).read().split()) fact = 1 if k%2: fact = -1 print((a-b)*fact)
p02665
s593634659
Wrong Answer
n = int(input()) a = list(map(int, input().split())) b = [sum(a)] for i in range(n): b.append(b[-1] - a[i]) flag = True if a[0] != 0: flag = False else: count = 1 temp = 1 for i in range(1, n + 1): temp2 = min(temp * 2, b[i]) count += temp2 temp = temp2 - a[i] if temp <= 0: if i != n: flag = False break if flag == True: print(count) else: print(-1)
p02881
s186610622
Accepted
N = int(input()) def make_divisors(n): divisors = [] for i in range(1, int(n**0.5)+1): if n % i == 0: divisors.append([i, n//i]) # divisors.sort() return divisors div_lst = make_divisors(N) min_num = float("inf") for d in div_lst: tmp = d[0]+d[1] if tmp < min_num: min_num = tmp print(min_num-2)
p02691
s568966809
Wrong Answer
n=int(input()) cnt=0 a=[int(e) for e in input().split()] for i in range(1,n): if n-i>=a[i]: for j in range(i+1,n+1): if a[i-1]+a[j-1]==j-i: cnt+=1 print(cnt)
p03262
s036360136
Accepted
def gcd(a, b): while b != 0: a, b = b, a % b return a n, x = map(int, input().split()) x_l = list(map(int, input().split())) dist = [] for i in range(n): dist.append(abs(x - x_l[i])) res = dist[0] for i in range(len(dist)): res = gcd(res, dist[i]) print(res)
p03657
s633313184
Accepted
A,B = map(int,input().split()) if A % 3 == 0: print("Possible") elif B % 3 == 0: print("Possible") elif (A + B) % 3 == 0: print("Possible") else: print("Impossible")
p02606
s059755203
Accepted
l,r,d=map(int,input().split()) c=0 for i in range(l,r+1): if i%d==0:c+=1 print(c)
p02613
s737423897
Accepted
N = int(input()) sc = {"AC":0, "WA":0, "TLE":0, "RE":0} for i in range(N): S = input() sc[S] += 1 # print("AC", " x ", sc["AC"]) print("WA", " x ", sc["WA"]) print("TLE", " x ", sc["TLE"]) print("RE", " x ", sc["RE"])
p02939
s240878275
Wrong Answer
ss = input()+'**' n = len(ss) arrs = [ss[0]] for i in range(1, n): if len(arrs[-1]) == 2: if arrs[-1].endswith(ss[i]): continue else: arrs.append(ss[i]) else: if ss[i-1] == ss[i]: arrs.append(ss[i: i+2]) else: arrs.append(ss[i]) while '*' in arrs: arrs.remove('*') print(len(arrs))
p02598
s319910530
Wrong Answer
from sys import stdin from sys import setrecursionlimit import numpy as np import math setrecursionlimit(10 ** 7) n,k = map(int,stdin.readline().rstrip().split()) a = list(map(int,stdin.readline().rstrip().split())) a.sort() a = np.array(a,dtype=np.int64) low = -1 hi = 10**9 point = 0 while hi-low > 0.001: ave = (hi+low)/2 if np.sum(a//ave) <= k: hi = ave else: low = ave print(math.ceil(ave))
p02833
s130139298
Accepted
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) n1 = int(readline()) if n1 % 2 == 1: print(0) else: n1 //= 2 ans = 0 while n1: n1 //= 5 ans += n1 print(ans)
p03695
s510612814
Wrong Answer
from collections import defaultdict N = int(input()) A = list(map(int, input().split())) d = defaultdict(int) strong = 0 for a in A: if a >= 3200: strong += 1 continue d[a // 400] += 1 Cmin = len(d) Cmax = len(d) + strong print(Cmin, Cmax)
p02766
s445609593
Wrong Answer
import math N,K = map(int,input().split()) print(math.ceil((math.log(N,K))))
p02684
s584998768
Accepted
n, k = map(int, input().split()) a = [0] + list(map(int, input().split())) journey = [1] for i in range(2*n + 100): nxt = a[journey[-1]] journey.append(nxt) if k < n + 1: print(journey[k]) exit() loop_end = n loop_start = n-1 while(journey[loop_start] != journey[loop_end]): loop_start -= 1 period = loop_end - loop_start k %= period while k<= n: k += period print(journey[k])
p02729
s193161118
Wrong Answer
N,M = map(int,input().split()) cnt = 0 cnt += ((N * N-1) / 2) cnt += ((M * M-1) / 2) print(cnt)
p02881
s823916250
Accepted
import sys n = int(input()) for i in range(int(n**0.5), 0, -1): if n%i==0: j=n//i print(i+j-2) sys.exit()
p02911
s780233823
Wrong Answer
# -*- coding: utf-8 -*- import numpy as np from collections import deque import collections import itertools import bisect mod = 10 ** 9 + 7 N, K, Q = list(map(int, input().split())) A = [0]*Q for q in range(Q): A[q] = int(input()) # 自分以外の人がK回答えたら敗退 seikai_num = [0]*(N+1) for a in A: seikai_num[a] += 1 print(seikai_num) for seikai in seikai_num[1:]: if (Q - seikai >= K): print('No') else: print('Yes')
p03803
s794166618
Wrong Answer
a,b=map(int,input().split()) #n=int(input()) #s=input() if a==b: print("Draw") elif a>b and a!=1: print(a) elif a>b: print(b) elif a<b and a!=1: print(b) else: print(a)
p02753
s848573492
Wrong Answer
S = input() list(S) if S in "A": if S in "B": print("Yes") else: print("No") else: print("No")
p03605
s332380219
Accepted
n=input() if '9' in n: print('Yes') else: print('No')
p02759
s758094850
Wrong Answer
N = int(input()) if N%2: print(N//2+1) else: print(N/2)
p03456
s827285071
Wrong Answer
a, b = input().split() c = '{}{}'.format(a, b) distinguish = [] for x in range(4, 101): if int(c) == x*x: distinguish.append(1) if distinguish.count(1) >= 1: print('Yes') else: print('No')
p02755
s172639379
Wrong Answer
A,B = map(int,input().split()) min_8=int(A*(100/8)) max_8=int((A+1)*(100/8)) min_10=int(B*10) max_10=int((B+1)*10) if max_8 < min_10: print("-1") elif min_8 > max_10: print("-1") elif max_8 >= min_10: if min_8 < min_10: print(min_10) elif min_8 >= min_10: print(min_8)
p02707
s202535801
Accepted
import sys import numpy as np n=int(sys.stdin.readline()) #n,k=map(int,sys.stdin.readline().split()) a=np.array(sys.stdin.readline().split(),dtype='int64') #a=np.array([sys.stdin.readline().split() for i in range(n)],dtype='int64') ans=[0]*n for i in range(n-1): ans[a[i]-1]+=1 for i in range(n): print(ans[i])
p03469
s260811409
Wrong Answer
s = input() print(s[:2]+"8"+s[4:])