problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03711
s866743177
Accepted
import sys input = sys.stdin.readline x, y = [int(x) for x in input().split()] A = [1, 3, 5, 7, 8, 10, 12] B = [4, 6, 9, 11] C = [2] for i in [A, B, C]: if x in i and y in i: print("Yes") sys.exit() print("No")
p02553
s533320560
Wrong Answer
a,b,c,d=map(int,input().split()) list1=[a,b] list2=[c,d] ans=-1*10**10 tmp=0 for i in list1: for j in list2: tmp=i*j if ans<tmp: ans=tmp print(ans)
p02612
s908342432
Wrong Answer
n=int(input()) print(1000-(n%1000))
p02690
s579596513
Wrong Answer
X = int(input()) limit = int(X**0.2) + 1 for a in range(limit): b = -(X - a**5)**0.2 if b.is_integer(): print(a,int(b)) break
p03827
s041706043
Wrong Answer
n = int(input()) s = input() ans = 0 for i in range(n): if s[i] == 'I': ans += 1 else: ans -= 1 print(ans)
p03371
s787828853
Accepted
a,b,c,x,y=map(int,input().split()) ans=x*a+y*b if x>=y: ans=min(ans,c*min(x,y)*2+a*(x-y)) else: ans=min(c*min(x,y)*2+b*(y-x),ans) ans=min(c*max(x,y)*2,ans) print(ans)
p03543
s717562200
Accepted
N = input() if N[0] == N[1] == N[2] or N[1] == N[2] == N[3]: print('Yes') else: print('No')
p03862
s251526099
Wrong Answer
def solve(): n, x = map(int, input().split()) s = list(map(int, input().split())) cnt, tmp, prv = 0, 0, 0 if s[0] > x: cnt += s[0] - x s[0] = x for y in s: if prv + y > x: tmp = prv + y - x cnt += tmp prv = y - tmp print(cnt) solve()
p02572
s875960106
Accepted
import sys input = sys.stdin.readline N = int(input()) A = list(map(int, input().split())) mod = 10 ** 9 + 7 sum_A = sum(A) % mod ans = 0 for a in A[:-1]: sum_A -= a sum_A %= mod ans += a * sum_A ans %= mod ans %= mod print(ans)
p02780
s210219068
Wrong Answer
n,k=map(int, input().split()) p=list(map(int, input().split())) def E(a): return a*(a+1)/2/a new_p = [E(i) for i in p] box=[] for i in range(k): s = sum(new_p[i:i+k]) box.append(s) if i+k == len(new_p)+1: break print(max(box))
p03408
s538298482
Wrong Answer
lst_blue = [] lst_red = [] dic = {} N = int(input()) for i in range(0,N): lst_blue.append(input()) M = int(input()) for i in range(0,M): lst_red.append(input()) for i in list(set(lst_blue)): dic[i] = int(lst_blue.count(i)) for i in list(set(lst_red)): if i in dic: dic[i] -= 1 print(max(dic.values()))
p02712
s104192490
Accepted
import sys N=int(sys.stdin.readline()[:-1]) ans=0 for i in range(1,N+1): if i%3==0 or i%5==0: pass else: ans+=i print(ans)
p02935
s720414253
Accepted
n = int(input()) v = list(map(int,input().split())) v.sort(reverse=False) ans = (v[0]+v[1])/2 if n >= 3: for i in range(2,n): ans = (ans+v[i])/2 print(ans)
p03799
s487200282
Wrong Answer
N, M = map(int, input().split()) if 2*N >= M: print(N) else: print((2*N+M)//4)
p02747
s697091995
Wrong Answer
s = input() for i in range(len(s)): if not (i%2==1 and s[i] == "i" or i%2==0 and s[i] == "h"): print("No") exit() print("Yes")
p03494
s455050714
Accepted
N = int(input()) A = input().split() A = list(map(int, A)) def even_judgement(A): count = 0 for a in A: if a%2 == 0: count += 1 if count == N: return True else: return False S_COUNT = 0 while even_judgement(A): A = list(map(lambda x: x/2, A)) S_COUNT += 1 print(S_COUNT)
p02922
s056312284
Accepted
A, B = (int(x) for x in input().split()) S = A num = 1 i = 1 if (B == 1): print("0") elif (A >= B): print("1") else: while(S < B): S = (A * (i + 1)) - i num += 1 i += 1 print(num)
p02801
s433174494
Accepted
s = input() a = 'abcdefghijklmnopqrstuvwxyz' ans = 0 for i in range(len(a)-1): if a[i]==s: ans=i+1 break print(a[ans])
p02602
s093462412
Accepted
import numpy as np n,k= map(int,input().split()) a = list(map(int,input().split())) target = a[0:k] p = sum(target) for i in range(n-k): ans = p - a[i] + a[i+k] # print(ans) if ans > p: print("Yes") else: print("No") p = ans
p03556
s925329908
Wrong Answer
n = int(input()) print(int((n**.5)**2))
p03319
s852802092
Wrong Answer
from math import ceil N,K=map(int, input().split()) A=list(map(int, input().split())) left=0 right=0 for i in range(N): if A[i]==1: left=i right=N-(i+1) ans=ceil(left/(K-1))+ceil(right/(K-1)) print(int(ans))
p03994
s809252085
Accepted
s = input() s = list(s) k = int(input()) for i in range(len(s)): if s[i] != "a" and ord("z") + 1 - ord(s[i]) <= k : k -= ord("z") + 1 - ord(s[i]) s[i] = "a" if k > 0: k = k % 26 if ord(s[-1]) + k <= ord("z"): s[-1] = chr(ord(s[-1]) + k) else: s_num = ord("a") + ord(s[-1]) + k - ord("z") s[-1] = chr(s_num) print("".join(s))
p02784
s338978348
Wrong Answer
H, A = map(int, input().split()) sa = list(map(int, input().split())) print(sa) counter = 0 while H > 0: for i in sa: H = H - i counter += 1 if counter >= len(sa): print("YES") else: print("NO")
p02725
s821199128
Accepted
K,N = list(map(int, input().split())) A_list = list(map(int, input().split())) sub_A_list = A_list.copy()[1:] sub_A_list.append(K + A_list[0]) for i in range(N): sub_A_list[i] -= A_list[i] maxi = max(sub_A_list) print(K - maxi)
p02988
s307687338
Accepted
import sys import math import bisect def main(): n = int(input()) A = list(map(int, input().split())) ans = 0 for i in range(1, n - 1): if A[i] == sorted([A[i-1], A[i], A[i+1]])[1]: ans += 1 print(ans) if __name__ == "__main__": main()
p03043
s136497123
Wrong Answer
n,K = map(int,input().split()) p = min(n,K-1) ans = 0 chk = [1]*(K-1) k = K for i in range(14): k /= 2 for i in range(int(k*2-k)): chk[i] += 1 if k <= 1: break #chk = sorted(chk,reverse=True) #print(chk) for i in range(p): #print(i) ans += float(1/(2**chk[i])) #print(ans) ans += max(0,n-K+1) print(ans/n)
p02595
s517771123
Wrong Answer
a = input().rstrip().split(" ") times = int(a[0]) distance = int(a[1]) b = 0 for i in range(times): point = input().rstrip().split(" ") x = int(point[0]) y = int(point[1]) c = x**2 + y ** 2 if c >= distance ** 2: b = b+1 print(b)
p02786
s977234742
Wrong Answer
print(int(input()).bit_length()+1)
p03557
s209355142
Wrong Answer
N=int(input()) A = sorted(list(map(int,input().split()))) B = sorted(list(map(int,input().split()))) C = sorted(list(map(int,input().split()))) count=0 for a in A: for b in B: if b>=a: count += len([i for i in C if i>=b]) print(count)
p02773
s941405390
Accepted
n= int(input()) s = {} for _ in range(n): t = input() s.setdefault(t, 1) s[t] += 1 ans = [] m = max(s.values()) for k, v in s.items(): if v == m: ans.append(k) for m in sorted(ans): print(m)
p03998
s450108149
Accepted
A = input () B = input () C = input () X,Y,Z = 0,0,0 P = A Q = X while True: if len(P)==Q: if P==A: print ('A') elif P==B: print ('B') else: print ('C') break if P==A: X += 1 elif P==B: Y += 1 else: Z += 1 if P[Q]=='a': P = A Q = X elif P[Q]=='b': P = B Q = Y else: P = C Q = Z
p03699
s127460702
Wrong Answer
N = int(input()) S = [int(input()) for _ in range(N)] S.sort() dp = [0]*N ans = sum(S) if ans%10 != 0: print(ans) else: for i in range(N): if (ans - S[i])%10 != 0: ans -= S[i] break else: ans -= S[i] print(ans)
p04029
s946293806
Accepted
a = int(input()) print((a+1)*a//2)
p02624
s987323079
Accepted
import math def main(): N = int(input()) d = [2 for _ in range(N+1)] d[1] = 1 v = int(math.sqrt(N)) for i in range(2, v+1): u = i for j in range(2, N//i+1): u += i d[u] += 1 + (j > v) ans = 0 for i in range(1, N+1): ans += i * d[i] return ans if __name__ == '__main__': print(main())
p02899
s064879428
Accepted
def resolve(): N = int(input()) A = [int(i) for i in input().split()] ans = [0] * N for i in range(N): ans[A[i] - 1] = i + 1 print(*ans) resolve()
p03103
s260000529
Accepted
n,m=map(int,input().split()) a=[0]*n b=[0]*n for i in range(n): a[i],b[i]=map(int,input().split()) c=zip(a,b) c=sorted(c) a,b=zip(*c) #print(a) #print(b) ans=0 for i in range(n): if (b[i]<m): ans+=a[i]*b[i] m-=b[i] else: ans+=a[i]*m break print(ans)
p02577
s067062595
Accepted
N=input() l = [int(x) for x in list(N)] s=sum(l) if s%9==0: print("Yes") else: print("No")
p02836
s815702726
Accepted
from sys import stdin s = stdin.readline().rstrip() s_reverse = s[::-1] hug = 0 if s != s_reverse: count = 0 for i in range(len(s)): if s[i] != s_reverse[i]: count += 1 hug += count//2 print(hug)
p03962
s404494190
Accepted
print(len(set(map(int, input().split()))))
p02761
s470483109
Wrong Answer
N,M = map(int, input().split()) sets = [] for i in range(M): s,c = input().split() sets.append((s,c)) for n in range(10**(N-1), 10**N-1): for s,c in sets: if not str(n)[int(s)-1] == c: break else: print(n) break else: print(-1)
p02548
s562531686
Wrong Answer
def readInt(): return int(input()) def readList(): return list(map(int,input().split())) def readMap(): return map(int,input().split()) def readStr(): return input() inf=float('inf') mod = 10**9+7 import math from itertools import permutations def solve(N): return sum(find_factors(i) for i in range(1,N)) def find_factors(num): count=1 i=2 while i<=num//2: print(i) if num%i==0: count+=1 i+=1 return count N=readInt() print(solve(N))
p03486
s851616209
Accepted
s = sorted(x for x in input()) t = sorted([x for x in input()], reverse=True) print('Yes' if s < t else 'No')
p03126
s927561497
Accepted
n,m = map(int,input().split()) ka = [list(map(int,input().split())) for i in range(n)] ls = ka[0][1::] for i in range(1,n): ls = set(ka[i][1::])&set(ls) print(len(ls))
p02622
s897415820
Accepted
S = input() T = input() print(sum(s != t for s, t in zip(S, T)))
p03624
s377780464
Accepted
import sys input = sys.stdin.readline S = input().rstrip() al = [chr(i) for i in range(97, 97+26)] for i in al: if i not in S: print(i) sys.exit() print("None")
p03695
s510432764
Accepted
n=int(input()) a=list(map(int,input().split())) b=[0]*8 c=0 for x in a: if x<400: b[0]=1 elif x<800: b[1]=1 elif x<1200: b[2]=1 elif x<1600: b[3]=1 elif x<2000: b[4]=1 elif x<2400: b[5]=1 elif x<2800: b[6]=1 elif x<3200: b[7]=1 else: c+=1 x=b.count(1) print(max(x,1),x+c)
p02897
s220391657
Wrong Answer
import sys a = int(sys.stdin.readline().rstrip()) b = -int(-a / 2) print(b / a)
p03331
s792425068
Wrong Answer
from math import floor N = int(input()) result = 10 ** 5 for i in range(floor(N / 2)): a = str(i) b = str(N - i) result = min(result, sum(map(int, a)) + sum(map(int, b))) print(result)
p03971
s349081833
Wrong Answer
from sys import stdin n, a, b = [int(x) for x in stdin.readline().strip().split()] s = stdin.readline() a = a + b all_num = 0 oversea_num = 0 for t in s: if t == 'a': if all_num < a: print('Yes') all_num += 1 else: print('No') elif t == 'b': if oversea_num < b and all_num < a: print('Yes') all_num += 1 oversea_num += 1 else: print('No') else: print('No')
p02935
s560307240
Accepted
n = int(input()) v = [float(i) for i in input().split()] v.sort() def f(v): if len(v) == 1: print("".join(map(str,v))) else: v.sort() a = v.pop(0) b = v.pop(0) v.append(((a+b)/2)) f(v) f(v)
p03146
s148457320
Accepted
s = int(input()) a = [s, ] for i in range(2, 1000001): if s % 2 == 0: b = s // 2 else: b = 3 * s + 1 if b in a: print(i) break a.append(b) s = b
p03013
s231625959
Wrong Answer
def main(): N, M = map(int, input().split()) broken = [int(input()) for _ in range(M)] div = 1000000007 comb_list = [0] * (N + 1) comb_list[0] = 1 if 1 not in broken: comb_list[1] = 1 for i in range(2, N + 1): if i in broken: continue comb_list[i] = (comb_list[i - 1] + comb_list[i - 2]) % div print(comb_list[-1]) if __name__ == "___main__": main()
p03486
s553954475
Accepted
s = input() t = input() sorted_s = sorted(s) sorted_t = sorted(t, reverse=True) #print(sorted_s) #print(sorted_t) if sorted_s < sorted_t: print("Yes") else: print("No")
p03785
s964134063
Wrong Answer
n,c,k = map(int, input().split()) t = [int(input()) for _ in range(n)] t.sort() T = 0 cnt = 0 ans = 0 for i in range(n): if cnt == 0: #θͺ°γ‚‚待っていγͺい T = t[i] + k cnt += 1 elif t[i] <= T: cnt += 1 elif t[i] > T: ans += 1 T = t[i] + k if cnt == c: ans += 1 T = 0 cnt = 0 if cnt != 0: ans += 1 print(ans)
p02553
s670028404
Accepted
a, b, c, d = map(int, input().split()) print(max(a*c, a*d, b*c, b*d))
p03612
s230763489
Accepted
n = int(input()) p = list(map(int,input().split())) c = 0 for i in range(n-1): if(p[i] == i+1 and p[i+1] == i+2): p[i],p[i+1] = p[i+1],p[i] c += 1 for i in range(n): if(p[i] == i+1):c += 1 print(c)
p03998
s564317327
Wrong Answer
S = [input() for _ in range(3)] i = [0, 0, 0] t = 0 while len(S[t]) > i[t]: if S[t][i[t]] == "a": t = 0 elif S[t][i[t]] == "b": t = 1 elif S[t][i[t]] == "c": t = 2 i[t] += 1 print("A" if t == 0 else "B" if t == 1 else "C")
p02696
s218220236
Wrong Answer
a, b, n = input().split() a = int( a ) b = int( b ) n = int( n ) f_max = 0 x = 0 x_per_b = 0 d = 1 / b for x in range( min( b, n ) + 1 ): f_x = int( a * x_per_b ) - a * int( x_per_b ) if x == 0 or f_max < f_x: f_max = f_x x_per_b = x_per_b + d print( f_max )
p02767
s390783530
Accepted
# input N = int(input()) X = list(map(int, input().split())) # check ans = 0 for i in range(1, 101, 1): sub_life = sum([(j - i) ** 2 for j in X]) if i == 1 or ans > sub_life: ans = sub_life print(ans)
p02552
s581408894
Wrong Answer
print(int(~int(input())))
p03639
s832376534
Accepted
n = int(input()) a = list(map(int,input().split())) cnt2 = 0 cnt4 = 0 cnt = 0 for i in a: if i%4==0: cnt4 += 1 elif i%2==0: cnt2 += 1 else: cnt += 1 ans = 0 if (cnt - cnt4 == 1 and cnt2 == 0) or (cnt4>=cnt): ans = 1 print("Yes" if ans==1 else "No")
p02577
s816661422
Wrong Answer
li = list(input()) sum_ = 0 for val in li: sum_ += int(val) if sum_%9 == 0: print('YES') else: print('NO')
p02570
s272650508
Accepted
d,t,s =map(int,input().split()) if d/s <=t : print('Yes') else : print('No')
p02600
s122988471
Accepted
x = int(input()) print(int(9 - (x-399)/200))
p04034
s565117449
Wrong Answer
n, m = list(map(int, input().split())) moves = [list(map(int, input().split())) for i in range(m)] possibilities = [False] * n possibilities[0] = True nums = [1] * n for i in range(m): x = moves[i][0] - 1 y = moves[i][1] - 1 if possibilities[x]: possibilities[y] = True nums[x] -= 1 nums[y] += 1 # if nums[x] == 0: # possibilities[x] = False ans = 0 for j in range(n): if possibilities[j] and (nums[j] > 0): ans += 1 print(ans)
p02923
s242790688
Wrong Answer
import numpy as np n = int(input()) h = list(map(int, input().split())) D = [0] * (n + 1) D[1:] = np.diff(h) max_cnt = cnt = 0 for i in range(n - 1, -1, -1): if D[i] <= 0: cnt += 1 else: max_cnt = max(max_cnt, cnt) cnt = 0 print(max_cnt)
p03293
s461225903
Accepted
from collections import deque s = input() t = input() u = deque(s) ok = False for i in range(len(s)): u.rotate(1) if ''.join(u) == t: ok = True print('Yes' if ok else 'No')
p04045
s131949013
Wrong Answer
n,k=map(int,input().split()) d=list(map(int,input().split())) for i in range(n,10000): s=str(i) ok=True t_str="" for ss in s: if int(ss) in d: ok=False break t_str+=ss if ok: print(int(t_str)) exit(0)
p02717
s289973604
Accepted
a,b,c=map(str,input().split()) print(c,a,b)
p02646
s508560338
Accepted
a,v=map(int,input().split()) b,w=map(int,input().split()) t=int(input()) if v-w<=0: print("NO") else: if abs(a-b)/(v-w)<=t: print("YES") else: print("NO")
p03126
s177426635
Accepted
n, m = [int(x) for x in input().split()] count_set = set(range(1, m + 1)) for _ in range(n): temp_list = [int(x) for x in input().split()] temp_list[0] = 0 count_set &= set(temp_list) print(len(count_set))
p03243
s381806213
Wrong Answer
N = int(input()) for i in range(N, 999): a = str(i) if a[0] == a[1] and a[1] == a[2]: print(a) exit()
p02971
s379513364
Accepted
# n, m, l = map(int, input().split()) # list_n = list(map(int, input().split())) # n = input() # list = [input() for i in range(N) # list = [[i for i in range(N)] for _ in range(M)] import sys input = sys.stdin.readline N = int(input()) An = [int(input()) for i in range(N)] Asort = sorted(An, reverse=True) for A in An: if A != Asort[0]: print(Asort[0]) else: print(Asort[1])
p02987
s258867436
Wrong Answer
s=input() ans=0 for i in range(1,4): if s[0]==s[i]: ans+=1 if ans==1: print('Yes') else: print('No')
p02665
s078346313
Wrong Answer
N = int(input()) A = list(map(int, input().split())) def solve(N, A): prev = 1 - A[0] rt = 1 for a in A[1:]: if a > prev * 2: print(-1) return prev = prev * 2 - a rt += prev + a print(rt) solve(N, A)
p03493
s364330264
Wrong Answer
from sys import stdin n = stdin.readline().rstrip() a = [int(x) for x in stdin.readline().rstrip().split()] minc = 10**9 for b in a: count = 0 while True: if b % 2 == 1: break b = b//2 count = count + 1 minc = min([minc, count]) print(minc)
p02775
s132638330
Wrong Answer
S=input()[::-1] ans=0 #ζ”―ζ‰•γ†ζžšζ•° array = list(map(int, S)) L=len(array) for i,n in enumerate(array): if n<= 5 : ans+=n elif n > 5: ans+= 10-n if i <L-1: array[i+1] +=1 else: ans +=1 print( ans)
p03804
s695199795
Accepted
n,m = [int(x) for x in input().split()] a = [] b = [] for _ in range(n): a.append(input()) for _ in range(m): b.append(input()) ans = False for i in range(n-m+1): for j in range(n-m+1): tmp = True for y in range(m): for z in range(m): tmp &= a[i+y][j+z] == b[y][z] if tmp: ans = True if ans: print("Yes") else: print("No")
p02995
s459994579
Wrong Answer
a,b,c,d = map(int, input().split()) count = 0 #ζœ€ε€§ε…¬η΄„ζ•° def gcd(a,b): while b!=0: a,b = b,a%b return a #ζœ€ε°ε…¬ε€ζ•° def lcm(a,b): return a*b // gcd(a,b) gcd_num = lcm(c,d) #a a_count = a // c a_count = a_count + (a//d) a_count = a_count - (a//gcd_num) #b b_count = b // c b_count = b_count + (b//d) b_count = b_count - (b//gcd_num) print((b-a)- b_count + a_count)
p02995
s008547906
Accepted
from fractions import gcd a,b,c,d = map(int, input().split()) def f(p): if a % p ==0: return(b//p - a//p + 1) else: return(b//p - a//p) print(b-a+1 - (f(c)+f(d) - f(int(c*d/gcd(c,d)))))
p02688
s726278860
Accepted
n,k = map(int,input().split()) has = [False] * n for i in range(k): d = int(input()) a = list(map(int,input().split())) for j in a: has[j - 1] = True print(has.count(False))
p03455
s198995160
Wrong Answer
a, b = map(int, input().split()) if a*b/2 ==1: print("Odd") else : print("Even")
p03150
s390474607
Accepted
S = input() id = 0 keyence = "keyence" for i in range(len(S)): if S[i] == keyence[id]: id += 1 else: break id2 = 1 for i in reversed(range(id, len(S))): if S[i] == keyence[-id2]: id2 += 1 else: break if id + id2 - 1 >= 7: print("YES") else: print("NO")
p03211
s535580965
Accepted
s = list(input()) n = len(s) list = [] #print(s) for i in range(n-2): A = int(s[i]+s[i+1]+s[i+2]) #print(A) B = abs(A-753) #print(B) list.append(B) print(min(list))
p03524
s056458116
Wrong Answer
S = input() a = S.count("a") b = S.count("b") c = S.count("c") if a == b == c: print("YES") elif a == b == c+1: print("YES") elif a == b+1 == c+1: print("YES") else: print("No")
p02718
s288403109
Accepted
import numpy as np n, m = map(int, input().split()) a = list(map(int, input().split())) a = np.array(a) if (np.count_nonzero(a >= np.sum(a)/(4*m)) >= m): print('Yes') else: print('No')
p03719
s709708444
Accepted
import sys from collections import Counter from collections import deque def input(): return sys.stdin.readline().strip() def mp(): return map(int,input().split()) def lmp(): return list(map(int,input().split())) a,b,c=mp() if a<=c<=b: print("Yes") else: print("No")
p02598
s163695073
Wrong Answer
n,k = map(int,input().split()) a = list(map(int,input().split())) def check(t): ans = 0 for aa in a: if aa > t: ans += aa//t max = 10**9 min = 0 while max-min>1: mid = (max+min)/2 if check(mid): max = mid else: min = mid print(max)
p03761
s973263534
Accepted
#75 C - ζ€ͺζ–‡ζ›Έ import collections n = int(input()) S = [input() for _ in range(n)] cnt = collections.Counter(S[0]) for s in S[1:]:#O (50) for a in cnt.keys():# O(26) if a in s:# O(50) cnt[a] = min(cnt[a],s.count(a))# O(50) else: cnt[a] = 0 ans = [key*value for key,value in cnt.items() if value > 0] ans = sorted(ans,reverse = False) print(''.join(ans))
p04043
s048725894
Accepted
i=input() if i=="5 7 5" or i=="7 5 5" or i=="5 5 7": print("YES") else: print("NO")
p03543
s795679405
Accepted
a=input() if len(set(a[1:]))==1 or len(set(a[:3]))==1: print("Yes") else: print("No")
p02973
s496386389
Accepted
import bisect N=int(input()) A=[] ans=0 for i in range(N): a=int(input()) A.append(a) cl=[A[-1]] ans=1 for i in range(N-1)[::-1]: a=A[i] if a>=cl[-1]: cl.append(a) ans+=1 else: b=bisect.bisect_right(cl,a) cl[b]=a print(ans)
p03457
s638152006
Accepted
# C - Traveling # https://atcoder.jp/contests/abc086/tasks/arc089_a # dt = ti+1 βˆ’ti # dist = abs(xi+1 βˆ’ xi)+abs(yi+1 βˆ’ yi) # γ‚­γƒΌγƒγ‚€γƒ³γƒˆ: パγƒͺティ # x + y γ―ζ―Žη§’γ”γ¨γ«εΏ…γšεΆε₯‡γŒε…₯γ‚Œζ›Ώγ‚γ‚‹γ€‚ n = int(input()) T = 0 X = 0 Y = 0 cnt = 0 for i in range(n): t,x,y= map(int,input().split()) if abs(x-X) + abs(y-Y) <= (t-T) and (x+y)%2 == t%2: cnt += 1 T,X,Y = t,x,y print("Yes" if cnt == n else "No")
p02595
s248876868
Wrong Answer
n, d = map(int, input().split()) cnt = 0 for _ in range(n): x, y = map(int, input().split()) if (x * x + y * y <= d): cnt = cnt + 1 print(cnt)
p03910
s987187642
Accepted
from itertools import accumulate, count n = int(input()) cumsum_ = accumulate(count(1)) cumsum = [] for x in cumsum_: if x >= n: cumsum.append(x) break else: cumsum.append(x) x = cumsum[-1] - n for i in range(1, len(cumsum)+1): if i != x: print(i)
p02572
s796817812
Accepted
N = int(input()) A = list(map(int,input().split())) K = sum(A) S = 0 for i in range(N-1): K = K - A[i] S = S + A[i]*K ans = S%(10**9+7) print(ans)
p03103
s143427048
Accepted
n,m = map(int,input().split()) cnt = 0 L = [] for i in range(n): a,b = map(int,input().split()) L.append([a,b]) L.sort() cnt = 0 sum1 = 0 for i in range(n): price = L[i][0]*L[i][1] num = L[i][1] if cnt + num <= m: cnt +=num sum1 +=price elif cnt + num > m: num = m - cnt sum1 += num*L[i][0] break print(sum1)
p02705
s644339684
Accepted
import math r = int(input()) print(2*r*math.pi)
p02621
s309050016
Wrong Answer
a = int(input()) print(a+a^2+a^3)
p03221
s723467900
Accepted
n, m = map(int,input().split()) li = [] ans = [] #εΈ‚, εΉ΄, ε‡ΊεŠ›ι †γ§ζ Όη΄ for i in range(m): x = list(map(int,input().split())) x.append(i) li.append(x) li.sort() for i in range(len(li)): if i == 0: y = 1 elif li[i][0] == li[i-1][0]: y += 1 else: y = 1 li[i].append(str(li[i][0]).rjust(6,'0') + str(y).rjust(6,'0')) li.sort(key=lambda x: x[2]) for i in li: print(i[3])