problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p02778
s580813796
Wrong Answer
S = input() N = (len(S)) for i in range(N+1): S = S[:i-1] + 'x' + S[i:]#i番目の文字をxに変える S = S[:N-1] + '' + S[N:]#i番目の文字をxに変える print(S)
p03659
s371295189
Wrong Answer
N = int(input()) a = list(map(int, input().split())) s = sum(a) data = [a[0]] m = abs(a[0] - a[-1]) for i in range(1, N - 1): data.append(a[i] + data[i - 1]) for i in range(0, N - 1): if abs(s - 2 * data[i]) < m: m = abs(s - 2 * data[i]) print(m)
p02701
s585089796
Accepted
s = set() for _ in range(int(input())): s.add(input()) print(len(s))
p03457
s626472937
Wrong Answer
N = int(input()) tprev = 0 xprev = 0 yprev = 0 result = 'YES' for i in range(N): t, x, y = map(int, input().split()) xlen = abs(x - xprev) ylen = abs(y - yprev) time = t - tprev length = xlen + ylen if time%2 == length%2 and time >= length: tprev = t xprev = x yprev = y else: result = 'NO' break print(result)
p04030
s243199705
Wrong Answer
a=input() b='' for i in a: if i=='0': b+='0' elif i=='1': b+='0' else: b=b[:-1] print(b)
p03673
s874618856
Wrong Answer
N = int(input()) a = list(map(int, input().split())) from collections import deque b = deque([]) for i in range(1, N + 1): if i % 2 == 0: b.appendleft(a[i - 1]) else: b.append(a[i - 1]) print(' '.join([str(i) for i in b]))
p03069
s094607394
Accepted
import sys input = sys.stdin.readline def main(): N = int(input()) S = input().strip() ans = 0 x = 0 for c in S: if c == "#": x += 1 else: if x > 0: ans += 1 x = max(x-1, 0) print(ans) if __name__ == '__main__': main()
p02555
s891351184
Accepted
def main(): total = int(input()) mod = 1000000007 dp = [0] * (total + 1) dp[0] = 1 for i in range(1, total + 1): right = max(0, i - 3 + 1) dp[i] = sum(dp[0: right]) % mod return dp[total] if __name__ == '__main__': print(main())
p02866
s807493481
Accepted
from collections import Counter n = int(input()) d = list(map(int, input().split())) dist = Counter(d) mod = 998244353 if d[0] != 0 or dist[0] != 1: print(0) exit() ans = 1 for i in range(n-1): ans = (ans * pow(dist[i], dist[i + 1], mod)) % mod print(ans)
p03821
s488829936
Accepted
def main(): n = int(input()) ab = [list(map(int,input().split())) for _ in range(n)] res = 0 for a,b in ab[::-1]: a += res if a%b != 0: res += b-a%b print(res) if __name__ == '__main__': main()
p03274
s677298338
Wrong Answer
N, K = map(int, input().split()) Xn = list(map(int, input().split())) dist = [abs(b-a) for a, b in zip(Xn[:-1], Xn[1:])] ans = float("inf") for i in range(N-K+1): res = abs(Xn[i]) + sum(dist[i:i+K-1]) ans = min(res, ans) print(ans)
p03625
s307905005
Wrong Answer
from collections import Counter N = int(input()) A = list(map(int, input().split())) l = sorted(Counter(A).items(), key=lambda x:x[0],reverse=True) #print(l) if l[1][1] < 2: print(0) else: print(l[0][0]*l[1][0])
p03696
s469942019
Wrong Answer
from collections import Counter n = int(input()) s = input().split(")(") l = "" r = "" for i in range(len(s)): if len(s) != 1: if i % 2 == 0: s[i] += ")" else: s[i] = "(" + s[i] a = Counter(s[i]) if "(" not in a: l += "(" * a[")"] elif a[")"] > a["("]: l += "(" * (a[")"] - a["("]) elif a["("] > a[")"]: r += ")" * (a["("] - a[")"]) print(l + "".join(s) + r)
p02789
s508772337
Wrong Answer
a , b = map(int, input().split()) if(a <= b): a = str(a) print(a*b) else: b = str(b) print(b*a)
p02900
s409702161
Wrong Answer
A, B = map(int, input().split()) ans = 1 i = 2 while i <= pow(min(A, B), 1/2)+1: if A%i == B%i == 0: ans += 1 while A%i == B%i == 0: A //= i B //= i i += 1 print(ans)
p03821
s880024712
Accepted
N=int(input()) AB=[list(map(int,input().split())) for i in range(N)] count=0 for a,b in AB[::-1]: a+=count if a%b!=0: count+=b-(a%b) print(count)
p03345
s885197888
Accepted
# 0:a, b, c, a-b # 1:b+c, a+c, a+b, b-a # 2:2a+b+c, a+2b+c, a+b+2c, a-b # 3:2a+3b+3c, 3a+2b+3c, 3a+3b+2c, b-a # 4:6a+5b+5c, 5a+6b+5c, 5a+5b+6c, a-b A, B, C, K = [int(x) for x in input().strip().split()] ans = (A-B)*(-1)**(K%2) if ans > 10 ** 18: print('Unfair') else: print(ans)
p03243
s639451557
Accepted
n=int(input()) for i in range(1,10): if n <= 100*i+10*i+i: print(100*i+10*i+i) break
p03836
s371299678
Wrong Answer
SX,SY,TX,TY=map(int,input().split()) vx=TX-SX vy=TY-SY print('U'*vy+'R'*vx+'L'*vx+'D'*vy+'L'+'U'*(vy+1)+'R'*(vx+1)+'D'+ 'R'+'D'*(vy+1)+'L'*(vx+1)+'U')
p02779
s720712160
Wrong Answer
n=int(input()) a=list(map(int,input().split())) ans='Yes' for i in range(len(a)): for j in range(i+1,len(a)): if a[i]==a[j]: print(a[i],a[j]) ans="No" break print(ans)
p02603
s048175437
Accepted
LI = lambda: list(map(int, input().split())) N = int(input()) A = LI() def main(): ans = 1000 k = 0 for i in range(N - 1): if A[i] == A[i + 1]: continue if A[i] > A[i + 1]: ans += k * A[i] k = 0 else: x = ans // A[i] ans -= x * A[i] k += x ans += k * A[-1] print(ans) if __name__ == "__main__": main()
p03852
s688373318
Wrong Answer
c = input() if c in "abcde": print("vowel") else: print("consonat")
p02995
s260493077
Accepted
from fractions import gcd A, B, C, D = map(int, input().split(' ')) # 最小公倍数 lcm = (C * D) // gcd(C, D) count = B count -= B // C count -= B // D count += B // lcm count -= (A - 1) count += (A - 1) // C count += (A - 1) // D count -= (A - 1) // lcm print(count)
p02641
s253336375
Wrong Answer
nums=[int(s) for s in input().split()] x=nums[0] n=nums[1] if n==0: print(x) else: row=[int(s) for s in input().split()] ls=[] for i in range(101): if i not in row: ls.append(abs(i-x)) ls.sort() if x-ls[0] not in row and x-ls[0]>=0: print(x-ls[0]) else: print(x+ls[0])
p02817
s162727680
Accepted
s,t = input().split() print(t+s)
p02584
s409650533
Wrong Answer
x,k,d=map(int,input().split()) x=abs(x) if x>=k*d: print(x-k*d) else: print(min(x%d,abs(d-x%d)))
p02861
s085896195
Accepted
n=int(input()) x,y=[],[] for i in range(n): x1,y1=map(int,input().split()) x.append(x1) y.append(y1) s=0 for i in range(n): for j in range(n): if i!=j: s+=((x[i]-x[j])**2+(y[i]-y[j])**2)**(1/2) print(s/n)
p02699
s451567223
Wrong Answer
sheep, wolf = map(int, input().split()) if sheep < wolf: print("unsafe") else: print("safe")
p02602
s398892139
Accepted
N, K = map(int, input().split()) A = list(map(int, input().split())) result = [] for i in range(K, N): if A[i] > A[i - K]: result.append('Yes') else: result.append('No') print(*result, sep='\n')
p02576
s972654954
Accepted
V = input() N,X,T = V.split() N = int(N) X = int(X) T = int(T) if(N%X==0): c = N/X else: c = N//X + 1 A = int(c*T) print(A)
p02675
s677088108
Accepted
N=str(input()) if N[-1]=="3": print("bon") elif N[-1]=="0" or N[-1]=="1" or N[-1]=="6" or N[-1]=="8": print("pon") else: print("hon")
p03997
s954686627
Accepted
#上底の長さ a = input() #下底の長さ b = input() #高さ h = input() #答え ans = 0 #文字列を数値化しつつ #(上底+下低)*高さ/2で台形の面積を求める ans = (int(a) + int(b)) * int(h) / 2 #答えを出力 #小数点以下が表示されるのでround()で非表示にしている print(round(ans))
p03836
s394038872
Wrong Answer
sx,sy,tx,ty=map(int,input().split()) dx,dy=tx-sx,ty-sy print('L'+dx*'U'+'U'+dy*'R'+'R'+'D'+dy*'L'+dx*'D'+'D'+dy*'R'+'R'+dy*'U'+'U'+'L'+'D'+dy*'D'+dx*'L')
p02784
s403254202
Wrong Answer
import numpy as np N, M = map(int, input().split()) A = [] A = map(int, input().split()) dif = N - sum(A) if dif >= 0: print(dif) else: print('-1')
p02691
s329512281
Accepted
from collections import* def solve(): n = int(input()) a = list(map(int, input().split())) l = [] r = [] for i, j in enumerate(a): l += [i + j] r += [i - j] cnt = 0 l = Counter(l) for r in r: cnt += l.get(r, 0) return cnt print(solve())
p03474
s988488422
Wrong Answer
def main(): a, b = map(int, input().split()) s = input() if s[a] != '-': print('No') else: print(s[:a], s[a+1:]) if s[:a].isdigit() and s[a+1:].isdigit(): print('Yes') else: print('No') if __name__ == "__main__": main()
p02711
s107388227
Wrong Answer
s = list(input()) if int(s[0])%7==0 or int(s[1])%7==0 or int(s[2])%7==0: print('Yes') else: print('No')
p02813
s527341859
Accepted
import itertools import math N=int(input()) A=list(itertools.permutations(range(1,N+1))) P=tuple(map(int,input().split())) Q=tuple(map(int,input().split())) count_P=0 count_Q=0 p=math.factorial(N) for i in range(p): if P==A[i]: count_P=i if Q==A[i]: count_Q=i print(abs(count_P-count_Q))
p02714
s550731858
Wrong Answer
from collections import Counter n = int(input()) s = input() c = Counter(s) total = 1 for v in c.values(): total *= v for i in range(1, n - 1): l = i - 1 r = i + 1 for j in range(min(l + 1, n - r)): if s[i] != s[l - j] and s[l - j] != s[r + j] and s[i] != s[r + j]: total -= 1 print(total)
p02817
s519072180
Accepted
s, t = input().split() print(t + s)
p03163
s531263852
Wrong Answer
(N, W), *D = [list(map(int, o.split())) for o in open(0)] w, v = 0, 1 dp = [[0]*-~W for _ in [0]*-~N] for i in range(N): for j in range(W + 1): dp[i + 1][j] = dp[i][j] if j < D[i][w] else dp[i][j - D[i][w]] + D[i][v] print(dp[N][W])
p03073
s370561518
Accepted
n = input() a,b = "","" for i in range(len(n)//2): a += "01" b += "10" if len(n) != len(a): a += "0" b += "1" acount,bcount = 0,0 for i in range(len(n)): if n[i] != a[i]: acount += 1 if n[i] != b[i]: bcount += 1 print(min(acount,bcount))
p03672
s488272807
Wrong Answer
s=input() n=len(s) trial=(n-1)//2 for i in range(trial): half=trial-i if s[:half]==s[half:2*half]: print(half*2)
p03359
s667129569
Accepted
a,b=map(int,input().split()) if a<=b: print(a) else: print(a-1)
p02594
s665789637
Accepted
N = int(input()) if N >= 30: print("Yes") else: print("No")
p03077
s907386318
Accepted
n = int(input()) x = float('inf') for _ in range(5): a = int(input()) x = min(x,a) print((n-1)//x + 5)
p02583
s124932081
Wrong Answer
n = int(input()) l = [int(i) for i in input().split()] count = 0 for i in range(n): for j in range(n): for k in range(n): if(i != j and i != k and j != k): if(l[i] + l[j] > l[k] and l[i] + l[k] > l[j] and l[k] + l[j] > l[i]): count += 1 print(count)
p02811
s922588920
Accepted
n,x=map(int,input().split());print('No' if n*500<x else 'Yes')
p02613
s274669861
Accepted
n=int(input()) count1=0 count2=0 count3=0 count4=0 for i in range(n): s=input() if s=='AC': count1+=1 elif s=='WA': count2+=1 elif s=='TLE': count3+=1 else: count4+=1 print('AC x '+str(count1)) print('WA x '+str(count2)) print('TLE x '+str(count3)) print('RE x '+str(count4))
p03059
s598542487
Wrong Answer
a,b,t = map(int,input().split()) if t < a: print(0) elif a<=t<2*a: print(b) elif 2*a<=t<3*a: print(2*b) else: print(3*b)
p02639
s478120146
Accepted
import numpy as np X = np.array(list(map(int, input().split()))) print(np.where(X==0)[0][0]+1)
p03095
s942004478
Accepted
n = int(input()) s = input() mod = 10**9 + 7 car = [0] * 26 for i in range(n): car[ord(s[i])-97] += 1 ans = 1 for i in range(26): if car[i] == 0: continue else: ans *= (car[i]+1) ans %= mod print(ans - 1)
p03997
s818806524
Accepted
a=int(input());b=int(input());h=int(input()) print((a+b)*h//2)
p03107
s642704770
Wrong Answer
ans=0 def br(s): global ans ns=[] fl=True i=0 while i <len(s)-1: if s[i:i+2]==["0","1"] or s[i:i+2]==["1","0"]: ans+=2 i+=1 fl=False else: ns.append(s[i]) i+=1 if fl or len(ns)==0: return 0 else: br(ns) br(list(input())) print(ans)
p03455
s046835716
Wrong Answer
a, b = map(int, input().split()) c = a * b if c % 2 == 0: print('Odds') else: print('Even')
p02952
s831245040
Accepted
n = int(input()) ans = 0 for i in range(1,n+1): if len(str(i)) % 2 == 1: ans += 1 print(ans)
p03328
s523732316
Accepted
a,b = list(map(int,input().split())) D = b-a print(D*(D+1)//2-b)
p02661
s683793132
Accepted
n = int(input()) a=[] b=[] for i in range(n): h,m=list(map(int,input().split())) a.append(h) b.append(m) a.sort() b.sort() if n%2: k=(n-1)//2 print(b[k]-a[k]+1) else: k=n//2 print(b[k]+b[k-1]-(a[k]+a[k-1])+1)
p03487
s652463285
Wrong Answer
import collections n = int(input()) a = list(map(int,input().split())) b = collections.Counter(a) ans = 0 for key,value in b.items(): ans += abs(key-value) ans = min(ans,n) print(ans)
p02747
s728736728
Wrong Answer
S=str(input()) if ('hii' in S): print('No') elif ('hi' in S): print('Yes') else: print('No')
p02570
s348029398
Wrong Answer
import sys def main(): # n = int(input()) [D, T, S] = [int(x) for x in input().split()] if D/S <= T: print('YES') else: print('NO') main()
p04034
s338891553
Wrong Answer
n,m=map(int,input().split()) xy=[] for _ in range(m): x,y=map(int,input().split()) xy.append([x,y]) ball=[1]*n red=[0]*n red[0]+=1 for i in range(m): if red[xy[i][0]-1]==1: if ball[xy[i][0]-1]==1: red[xy[i][0]-1]-=1 red[xy[i][1]-1]+=1 ball[xy[i][0]-1]-=1 ball[xy[i][1]-1]+=1 ans=len(red)-red.count(0) print(ans)
p03103
s370158023
Accepted
def solve(): N, M = map(int, input().split()) A = [list(map(int, input().split())) for _ in range(N)] A.sort() ans = 0 cnt = 0 for a in A: if cnt + a[1] <= M: ans += a[1]*a[0] cnt += a[1] else: ans += a[0]*(M-cnt) break return ans print(solve())
p03827
s200195747
Wrong Answer
N=int(input()) s=input() i_count=0 max_count=0 for i in range(N): if s[i]=="I": i_count+=1 if i_count>max_count: max_count=i_count print(max_count)
p02823
s128674309
Wrong Answer
#!/usr/bin/env python3 n, a, b = map(int, input().split()) ans = 0 if (b-a)%2 == 0: ans = int((b-a)/2) else: if a-1 >= n-b: ans = int(n+(1-a-b)/2) else: ans = int(a + (b-a)/2) print(ans)
p02688
s778349391
Wrong Answer
N,K =map(int , input().split()) A = [] for i in range(K): d = int(input()) A += map(int , input().split()) print(set(A)) print(N-len(set(A)))
p03162
s305459871
Accepted
n=int(input()) act=[0]*n for i in range(n): act[i]=list(map(int,input().split())) dp=[[0]*3 for _ in range(n)] dp[0]=[act[0][0],act[0][1],act[0][2]] for i in range(1,n): dp[i][0]=max(dp[i-1][1],dp[i-1][2])+act[i][0] dp[i][1]=max(dp[i-1][2],dp[i-1][0])+act[i][1] dp[i][2]=max(dp[i-1][0],dp[i-1][1])+act[i][2] print(max(dp[n-1][0],dp[n-1][1],dp[n-1][2]))
p02753
s195428632
Accepted
S=input() if S=='AAA' or S=='BBB': print('No') else: print('Yes')
p03438
s237631734
Accepted
# やっていることは単純だが、何故これで正しい答えが出るのかよくわからない N = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) la = 0 lb = 0 for i in range(N): if a[i] > b[i]: la += a[i] - b[i] elif b[i] > a[i]: lb += (b[i] - a[i]) // 2 if lb >= la: print("Yes") else: print("No")
p02790
s581817528
Accepted
import sys input = sys.stdin.readline n, m = map(int, input().split()) print("{}".format(min(n, m)) * max(n, m))
p02730
s324516937
Accepted
S = input() N = len(S) Srev = "".join(list(reversed(S))) if S != Srev: print('No') exit() S1 = S[:(N-1)//2] S1rev = "".join(list(reversed(S1))) if S1 != S1rev: print('No') exit() S2 = S[(N+3)//2 - 1:N] S2rev = "".join(list(reversed(S2))) if S2 != S2rev: print('No') exit() print('Yes')
p02754
s982991084
Wrong Answer
N,A,B = map(int, input().split()) if A==0: print(0) elif (A+B)>N: if N<=A: print(A) else: print(N) else: x=N//(A+B) y=N%(A+B) print(A*x+y)
p03062
s222345530
Accepted
n = int(input()) dat = list(map(int, input().split())) maxval = -9999999999999999999 maxind = -1 numminus = 0 dat2 = [] for i in range(n): if dat[i] < 0: numminus += 1 dat2.append(abs(dat[i])) dat2.sort() #print(numminus) #print(dat2) if numminus %2 == 0: print(sum(dat2)) else: dat2[0] *= -1 print(sum(dat2))
p02705
s620911004
Accepted
import math r = int(input()) al = math.pi * r *2 print(al)
p03285
s460897555
Accepted
n = int(input()) a = int(n / 7) for i in range(a, -1, -1): if (n - 7 * i) % 4 == 0: print('Yes') exit() print('No')
p02888
s281931409
Accepted
from bisect import bisect_left N = int(input()) L_list = list(map(int, input().split())) L_list.sort() ans = 0 for i in range(N): for j in range(i + 1, N): a, b = L_list[i], L_list[j] r = bisect_left(L_list, a+b) ans += max(0,r-j-1) print(ans)
p03797
s632856445
Wrong Answer
n, m = map(int,input().split()) ans = 0 if n*2 > m: if m%2 == 0: ans = m//2 else: ans = (m-1)//2 else: print("n = {}, m = {}".format(n, m)) ans += n m -= n*2 print("n = {}, m = {}".format(n, m)) ans += m//4 print(ans)
p03013
s439091617
Accepted
N, M = map(int, input().split()) A = [int(input()) for _ in range(M)] MOD = 10**9 + 7 safe = [True] * (N+1) for i in range(len(A)): safe[A[i]] = False dp = [0] * (N+1) dp[0] = 1 if safe[1]: dp[1] = 1 for i in range(2, N+1): if(safe[i]): dp[i] = dp[i-1] + dp[(i-2)] dp[i] = dp[i] % MOD else: dp[i] = 0 print(dp[N])
p02952
s281524953
Accepted
n = int(input()) count = 0 for i in range(1,n+1): if len(str(i)) % 2 == 1: count += 1 print(count)
p03803
s473275756
Accepted
Score_Alice, Score_Bob = map(int, input().split()) if Score_Alice == 1 and Score_Bob == 1: print('Draw') elif Score_Alice == 1 and Score_Bob != 1: print('Alice') elif Score_Alice != 1 and Score_Bob == 1: print('Bob') else: if Score_Alice > Score_Bob: print('Alice') elif Score_Alice < Score_Bob: print('Bob') else: print('Draw')
p02819
s488808902
Wrong Answer
import math numX = int(input()) result = -1 if numX <= 2: result = 2 elif numX % 2 == 0: numX += 1 while True: upper = math.ceil(math.sqrt(numX)) isPrime = True for i in range(3, upper, 2): if numX % i == 0: isPrime = False break if isPrime == True: result = numX break numX += 2 print(numX)
p02607
s372901917
Accepted
n=int(input()) s=list(map(int,input().split())) count=0 for i in range(0,len(s)): index_1=i+1 if(int(s[i])%2 != 0): if(int((index_1))% 2 != 0 ): count+=1 else: count+=0 else: count+=0 print(count)
p02665
s898460315
Wrong Answer
n = int(input()) A = list(map(int, input().split())) B = [1] for i in range(n): B.append((B[i]-A[i])*2) C = [A[n]] for s in B: if s <= 0: print(-1) exit() for i in range(n): C.append(C[i]+A[n-1-i]) C = C[::-1] num = 0 frag = 0 for i in range(n): if B[i] >= C[i]: frag = 1 if frag == 0: num += B[i] else: num += C[i] num += C[n] print(num)
p03479
s157837692
Wrong Answer
x, y = map(int, input().split()) cnt = 1 while x < y: x *= 2 cnt += 1 print(cnt-1)
p03286
s141340636
Accepted
import sys def input(): return sys.stdin.readline().strip() def mapint(): return map(int, input().split()) sys.setrecursionlimit(10**9) N = int(input()) ans = [] for i in range(50): if N%2==1: ans.append('1') if i%2==0: N -= 1 else: N += 1 else: ans.append('0') N //= 2 if N==0: break print(''.join(ans[::-1]))
p03944
s105297231
Accepted
W, H, N = map(int, input().split()) X = [0, W] Y = [0, H] for _ in range(N): x, y, a = map(int, input().split()) if a == 1 and X[0] < x: X[0] = x elif a == 2 and X[1] > x: X[1] = x elif a == 3 and Y[0] < y: Y[0] = y elif a == 4 and Y[1] > y: Y[1] = y h = Y[1] - Y[0] w = X[1] - X[0] print(0 if h < 0 or w < 0 else h * w)
p02779
s720306692
Accepted
n = int(input()) l = list(map(int, input().split())) l.sort() same = False for i in range(0, n-1): if l[i] == l[i+1]: same = True break print('NO' if same else 'YES')
p02775
s361323960
Accepted
n = list(map(int, reversed(list(input())))) a = 0 b = 9999 for x in n: temp_a = min(a + x, b + x) b = min(a + 10 - x + 1, b + 10 - x - 1) a = temp_a print(min(a, b))
p02731
s779179524
Accepted
import numpy l=int(input()) v=l/3 print(v*v*v)
p03998
s171493931
Wrong Answer
import sys sa=input() sb=input() sc=input() ss={'a':sa,'b':sb,'c':sc} t='a' while True: if len(ss[t])==0: print(t.upper()) sys.exit() else: t=ss[t][0] if len(ss[t])==1: ss[t]='' else: ss[t]=ss[t][1:]
p02596
s933636473
Wrong Answer
k = int(input()) answer = -1 cou = 7 for i in range(k): if cou%k == 0: answer = cou else: cou*10 + 7 print(answer)
p02756
s426515521
Wrong Answer
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines S = readline().decode().rstrip() Q = int(readline()) cnt = 0 start = '' end = '' for i in range(Q): A = list(map(str,readline().decode().split())) if A[0] == '1': cnt +=1 else: if (cnt + int(A[1])) % 2: end += A[2] else: start += A[2] ans = start + S + end if cnt % 2: print(ans) else: print(ans[::-1])
p02607
s904512293
Accepted
import sys n, *aaa = map(int, sys.stdin.buffer.read().split()) ans = 0 for i, a in enumerate(aaa, start=1): if i % 2 == 1 and a % 2 == 1: ans += 1 print(ans)
p03324
s369980088
Accepted
D,N = map(int,input().split()) print(N*100**D if N<100 else 101*100**D)
p02712
s638462422
Wrong Answer
def resolve(): n=int(input()) ans=0 for i in range(n): if i%3!=0 and i%5!=0: ans+=i print(ans) if __name__ == "__main__": resolve()
p03481
s530482635
Wrong Answer
import math x,y = map(int,input().split(" ")) n = int(math.log2(y)-math.log2(x)) print(n+1)
p03971
s402095179
Accepted
n, a, b = map(int, input().split()) s = input() overseas = 0 student = 0 for i in range(n): if s[i] == "a": if a + b > student: print("Yes") student += 1 else: print("No") if s[i] == "b": if a + b > student and overseas < b: print("Yes") overseas += 1 student += 1 else: print("No") if s[i] == "c": print("No")
p02701
s356895056
Accepted
a=int(input()) b=[input() for i in range(a)] def func(b): return len(set(b)) print(func(b))
p02606
s516571893
Accepted
L,R,d = map(int,input().split()) count = 0 for i in range(L,R+1): if i % d == 0: count += 1 print(count)
p03524
s869643752
Accepted
import collections S = input() C = collections.Counter(S) for _ in 'abc': if _ not in C: C[_] = 0 M, m = max(C.values()), min(C.values()) print('YES' if M-m < 2 else 'NO')