problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03243
s744543013
Accepted
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10 ** 9) INF = 1 << 60 MOD = 1000000007 def main(): N = int(readline()) for x in range(N, 1000): if len(set(str(x))) == 1: print(x) return return if __name__ == '__main__': main()
p02578
s322211792
Accepted
n = int(input()) a = list(map(int, input().split())) sum = 0 for i in range(n-1): if a[i] > a[i+1]: b = a[i] - a[i+1] a[i+1] += b sum += b print(sum)
p02795
s164256709
Accepted
import math H = int(input()) W = int(input()) N = int(input()) ans = math.ceil(N/max(H,W)) print(ans)
p02755
s748478235
Wrong Answer
import math a,b=map(int,input().split()) arr=[] for i in range(1,101,1): if a==math.floor(i*0.08) and b==math.floor(i*0.1) : print(i) exit() print(-1)
p03037
s460245600
Accepted
def main(): N, M = map(int, input().split()) L, R = 0, 1001001 for i in range(M): l, r = map(int, input().split()) L = max(L, l) R = min(r, R) print(max(0, R - L + 1)) if __name__ == '__main__': main()
p04005
s233533814
Wrong Answer
A, B, C = map(int, input().split()) if A%2 == 0 or B%2 == 0 or C%2 == 0: print(0) else: dice = [A, B, C] dice.sort(reverse=True) print(A*B*C-dice[1]*dice[2])
p02571
s692639591
Accepted
S = input() T = input() min_count = 1000 for idx in range(len(S) - len(T) + 1): s = S[idx:idx+len(T)] count = sum([1 if tc!=sc else 0 for tc, sc in zip(T, s)]) min_count = min(min_count, count) print(min_count)
p02607
s347809366
Accepted
n = int(input()) a = list(map(int, input().split())) count = 0 for i in range(n): if i % 2 == 1: continue elif a[i] % 2 != 0: count += 1 print(count)
p02548
s880527085
Wrong Answer
def main(): N = int(input()) ans = 0 for c in range(1, N): ans += solve(N-c) print(ans) def solve(n): res = 0 for i in range(1,n//2): if n % i == 0: res += 1 return res main()
p02924
s391363188
Wrong Answer
N = int(input()) if N == 1: print(0) elif N == 2: print(1) else: total = (N*(N-1))/2 print(int(total))
p02747
s924207364
Accepted
n=input() ans = True for i in range(0, len(n), 2): if n[i: i+2] != "hi": ans = False if ans: print("Yes") else: print("No")
p03471
s114035452
Accepted
import sys n, ans = map(int, input().split()) for x in range(n + 1): for y in range(n + 1 - x): if n - x - y >= 0: if (10000 * x + 5000 * y + 1000 * (n - x - y)) == ans: print(x, y, n - x - y) sys.exit() print('-1 -1 -1')
p03427
s750440424
Accepted
N=input() S=[-1]*len(N) for i in range(len(N)): S[i]=int(N[i]) if sum(S[1:])== 9*(len(S)-1): print(sum(S)) else: print(9*(len(S)-1) + (S[0]-1))
p02639
s645172425
Accepted
import io,sys sys.setrecursionlimit(10**6) def main(): X = list(map(int,sys.stdin.readline().rstrip().split())) g = set([0,1,2,3,4,5]) a = list(g - set(X)) print(a[0]) main()
p02646
s062207644
Accepted
A,V = map(int,input().split()) B,W = map(int,input().split()) T=int(input()) place_A=A+(T*V) place_B=B+(T*W) place_A_1=A-(T*V) place_B_1=B-(T*W) if A<B: if place_A>=place_B: print("YES") else: print("NO") else: if place_A_1<=place_B_1: print("YES") else: print("NO")
p03457
s596667515
Wrong Answer
n = int(input()) pre_t = 0 for i in range(n): t, x, y=map(int, input().split()) if (x + y) > (t - pre_t) or (x + y + (t - pre_t)) % 2: print("No") exit() pre_t = t print("Yes")
p02873
s568041298
Accepted
s = input() n = len(s) + 1 dp = [0] * n for i, c in enumerate(s): if c == '<': dp[i+1] = dp[i] + 1 for i, c in enumerate(reversed(s)): if c == '>': dp[-i-2] = max(dp[-i-2], dp[-i-1] + 1) print(sum(dp))
p03329
s023307123
Accepted
n=int(input()) def digit(n,m): a=n _list = [] while True: _list.append(a%m) a=a//m if a==0: break return sum(_list) ans=10**10 for i in range(n+1): ans=min(ans,digit(i,6)+digit(n-i,9)) print(ans)
p02659
s396293111
Wrong Answer
a,b = input().split() c = float(a)*float(b) d = str(c).split(".")[0] print(int(d))
p03380
s597674990
Accepted
n = int(input()) a = list(map(int, input().split())) a.sort(reverse=True) N = float("INF") ans = 0 for i in range(1,n): if abs(a[i]-(a[0]-a[i])) < N: N = abs(a[i]-(a[0]-a[i])) ans = a[i] print(a[0], ans)
p03695
s303676780
Accepted
n = int(input()) a = list(map(int, input().split())) cnt = [] over = 0 for i in range(n): m = a[i] // 400 if m < 8: if m not in cnt: cnt.append(m) else: over += 1 if len(cnt) > 0: print(len(cnt), len(cnt)+over) else: print(1, len(cnt)+over)
p02854
s577634191
Accepted
N = int(input()) A = list(map(int, input().split())) tmp = [0 for i in range(N+1)] length = 0 for i in range(N): tmp[i+1] = tmp[i] + A[i] length += A[i] ans = 10 ** 10 for i in range(1, N+1): ans = min(ans, abs((length - tmp[i]) - tmp[i])) print(ans)
p02661
s160673689
Accepted
N=int(input()) A=[] B=[] for i in range(N): a,b=map(int,input().split()) A.append(a) B.append(b) A.sort() B.sort() if N%2!=0: n=(N+1)//2 ans=B[n-1]-A[n-1]+1 else: n=N//2 ans1=(A[n-1]+A[n])/2 ans2=(B[n-1]+B[n])/2 ans=(ans2-ans1)*2+1 print(int(ans))
p02947
s608300670
Accepted
import os, sys, re, math N = int(input()) S = dict() for i in range(N): w = ''.join(sorted(input())) if w in S: S[w] += 1 else: S[w] = 1 count = 0 for (w, n) in S.items(): if n > 1: count += (n * (n - 1)) // 2 print(count)
p03434
s682105222
Accepted
N = int(input()) A = list(map(int, input().split())) A = sorted(A, reverse=True) print(sum(A[::2])-sum(A[1::2]))
p03998
s569166379
Wrong Answer
""" N = list(map(int,input().split())) S = [str(input()) for _ in range(N)] S = [list(map(int,list(input()))) for _ in range(h)] print(*S,sep="") """ import sys import itertools sys.setrecursionlimit(10**6) input = lambda: sys.stdin.readline().rstrip() data = {} for x in ["a","b","c"]: data[x] = input() pick = "a" while True: data[pick] = data[pick][1:] if data[pick] == "": break pick = data[pick][0] print(pick.upper())
p03262
s994829754
Accepted
import fractions def gcdlist(a): ans = a[0] for i in range(1, len(a)): ans = fractions.gcd(ans, a[i]) return ans n,y=map(int,input().split()) x=list(map(int,input().split())) x.append(y) if y==1: print(abs(x[0]-1)) exit() l=[] for i in range(n): l.append(abs(x[i+1]-x[i])) print(gcdlist(l))
p03485
s677151990
Accepted
a,b=map(int,input().split()) print((a+b+1)//2)
p02732
s790851629
Wrong Answer
N=int(input()) A=list(map(int,input().split())) S=[0 for j in range(N+1)] count=0 for i in range(N): S[A[i]]+=1 for i in range(N): count+=S[i]*(S[i]-1)//2 for i in range(N): print(count-(S[A[i]]-1))
p03796
s245336932
Accepted
def factorial(n, mod): fact = 1 for integer in range(1, n + 1): fact *= integer fact %= mod return fact N = int(input()) mod = 10 ** 9 + 7 print(factorial(N, mod))
p02918
s544895920
Wrong Answer
N, K = map(int, input().split()) S = input() d = 0 for i in range(N-1): if(S[i]!=S[i-1]): d += 1 d = max(0, d - 2 * K) print(N - 1 - d)
p03449
s697133828
Accepted
n= int(input()) a1 = list(map(int, input().split())) a2 = list(map(int, input().split())) ans = 0 cnt = 0 while cnt < n: tmp = 0 for i in range(n-cnt): tmp += a1[i] for j in range(cnt+1): tmp += a2[-1*(j+1)] ans = max(ans, tmp) cnt += 1 print(ans)
p02783
s151550917
Accepted
a,b=map(int,input().split(' ')) print((a+b-1)//b)
p02582
s740130034
Accepted
w=list(input()) n=len(w) S=0 S_max=S for i in range(n): if w[i]=='R': S+=1 j=0 while True: if i+j+1<=n-1: j+=1 if w[i+j]=='R': S+=1 else: i+=j break else: i=n-1 break S_max=max([S_max,S]) S=0 print(S_max)
p02880
s086261554
Accepted
a=int(input()) import sys for i in range(1,10): for j in range(1,10): if i*j==a: print('Yes') sys.exit() print('No')
p02600
s304627270
Accepted
X = int(input()) if 400 <= X <=599 : print("8") elif 600 <= X <=799 : print("7") elif 800 <= X <=999 : print("6") elif 1000 <= X <=1199 : print("5") elif 1200 <= X <=1399 : print("4") elif 1400 <= X <=1599 : print("3") elif 1600 <= X <=1799 : print("2") elif 1800 <= X <=1999 : print("1")
p02631
s143421301
Accepted
n=int(input()) a=list(map(int,input().split())) X=[] b=a[0] for i in range(1,n) : b^=a[i] for i in range(n) : x=b^a[i] X.append(x) for i in X : print(i,end=" ")
p03000
s403065421
Wrong Answer
n, x = map(int,input().split()) l = list(map(int,input().split())) i, d = 0, 0 while i<n and d <= x: d += l[i] i += 1 if d == x and i == n: print(min(i+1,n)) else: print(min(i,n))
p02843
s821758451
Accepted
x = int(input()) dp = [False]*101000 dp[0] = True l = [100, 101, 102, 103, 104, 105] for i in range(100001): for j in l: if dp[i]: dp[i+j] = True if dp[x]: print(1) else: print(0)
p03416
s868010447
Accepted
A,B = map(str,input().split()) cnt = 0 for i in range(int(A),int(B)+1): l = list(str(i)) flag = True n = len(l) for j in range(n//2): if l[j] != l[n-j-1]: flag = False if flag: cnt += 1 print(cnt)
p03779
s076092955
Accepted
X=int(input()) i=1 while i*(i+1)//2<X: i+=1 print(i)
p04029
s717453506
Wrong Answer
N = int(input()) if N % 2 == 0: print((N + 1) * N / 2) else: print(N * (N - 1) / 2 + N)
p02556
s199331270
Wrong Answer
n = int(input()) point_sum = [] for i in range(n): a,b = map(int, input().split()) point_sum.append(a+b) print(max(point_sum) - min(point_sum))
p02706
s313291186
Accepted
n, m = map(int, input().split()) days = list(map(int,input().split())) if sum(days) > n: print(-1) else: print(n - sum(days))
p02681
s259893495
Accepted
s = input() t = input() print("Yes" if s == t[:-1] else "No")
p03000
s758069095
Wrong Answer
n,x = map(int, input().split()) L = list(map(int, input().split())) H = 0 count = 0 for i in range(n): if H > x: print(count) exit() else: H += L[i] count += 1 print(n+1)
p02553
s309488427
Accepted
a, b, c, d = map(int, input().split()) ans = max(a * c, a * d, b * c, b * d) print(ans)
p03592
s764533567
Accepted
N, M, K = map(int, input().split()) ok = False for i in range(N + 1): for j in range(M + 1): now = M * i now -= j * i now += j * (N - i) if now == K: ok = True if ok: print("Yes") else: print("No")
p02951
s465969072
Accepted
A, B, C = map(int, input().split()) print(max(C - (A - B), 0))
p02835
s320728685
Accepted
import numpy as np import scipy as sp import math a, b, c = map(int, input().split()) d = a + b + c if(d<22): print("win") else: print("bust")
p03611
s955452239
Accepted
from collections import defaultdict def main(): n = int(input()) a = [int(an) for an in input().split()] cnt = defaultdict(int) for an in a: cnt[an - 1] += 1 cnt[an] += 1 cnt[an + 1] += 1 print(max(cnt.values())) if __name__ == "__main__": main()
p03289
s721523930
Accepted
s=input() t=0 if s[0]=="A": if(s[2:-1].count("C")==1): for i in s: if i!="A" and i!="C": if i.isupper(): t=0 break else: t=1 if t==0: print("WA") else: print("AC")
p02677
s557748401
Wrong Answer
import math a, b, h, m = map(int, input().split()) l = m * 6 s = m * 0.5 + h * 30 th = abs(l - s) if th == 0: print('{:.20f}'.format(abs(a - b))) exit() elif th == 180: print('{:.20f}'.format(a + b)) exit() if th >= 180: th -= 180 cos = math.cos(math.radians(th)) ans = a**2 + b**2 - 2 * a * b * cos print('{:.20f}'.format(math.sqrt(ans)))
p03131
s500577394
Wrong Answer
K,A,B=map(int,input().split()) if B <= A: print(1+K) exit() if K<A+1: print(1+K) exit() if B - A<=2: q,r = divmod(K-1,A) print(q*B+r) exit() r1 = A-1 K -= r1 q,r = divmod(K,2) for i in range(q): if i == 0: res = B continue q2,res = divmod(res,A) res += q2*B print(res+r)
p03617
s809107548
Accepted
Q, H, S, D = list(map(int, input().split())) Q *= 8 H *= 4 S *= 2 A = min(Q, H, S, D) B = min(Q, H, S) // 2 N = int(input()) print(int(N//2*A+N%2*B))
p03723
s294220422
Accepted
a,b,c=map(int,input().split()) num1=0 num2=0 num3=0 if a==b and b==c and a%2==0: print(-1) else: for i in range(a*b*c): if a%2==1 or b%2==1 or c%2==1: break num1=a//2 num2=b//2 num3=c//2 a=num2+num3 b=num3+num1 c=num1+num2 print(i)
p04043
s612330449
Accepted
x=list(map(int,input().split())) if x.count(5)==2 and x.count(7)==1: print("YES") else: print("NO")
p03705
s859810262
Wrong Answer
N, A, B = map(int, input().split()) if N == 1 and A != B : print(0) exit() if A < B : print(0) exit() smin = (N-1)*A + B smax = A + (N-1)*B print(smax-smin+1)
p02916
s980314138
Wrong Answer
n = int(input()) a = list(map(int,input().split())) b = list(map(int,input().split())) c = list(map(int,input().split())) fill = 0 cnt = 0 for f in range(n): fill = fill + b[a[f] - 1] if(f != 0 and a[f] == a[f-1] + 1): fill = fill + a[f-2] cnt = cnt + 1 else: cnt = cnt + 1 print(fill)
p02939
s865668577
Accepted
S = input() t = S[0] cnt = 0 bol = 0 for i in range(1,len(S)): if bol == 1: bol = 0 continue if S[i] == t: t = 0 cnt += 1 bol = 1 else: t = S[i] print(len(S)-cnt)
p03061
s747214983
Accepted
from math import * N = int(input()) A = list(map(int,input().split())) L = (N+1)*[0] R = (N+1)*[0] ans = [] for n in range(N): L[n]=gcd(L[n-1],A[n]) for n in range(N-1,0,-1): R[n]=gcd(R[n+1],A[n]) for n in range(N): ans+=[gcd(L[n-1],R[n+1])] print(max(ans))
p02924
s144712013
Accepted
N = int(input()) print((N-1)*N//2)
p02570
s634381761
Accepted
D,T,S = map(int, input().split()) if D > S * T: print("No") else: print("Yes")
p03073
s371892785
Accepted
s=list(input()) c0=0 c1=0 for i in range(1,len(s)): if s[i]==s[i-1] and s[i]=='1': s[i]='0' c0+=1 elif s[i]==s[i-1] and s[i]=='0': s[i]='1' c0+=1 print(c0)
p02811
s990996535
Wrong Answer
print((lambda x:('Yes' if (x[1]//500 <= x[0]) else 'No'))(list(map(int,input().split()))))
p03013
s806434996
Accepted
from collections import defaultdict N, M = map(int, input().split()) A = {i:0 for i in range(N+1)} for _ in range(M): A[int(input())] = 1 mod = 10**9 + 7 dp = [0]*(N+1) dp[0] = 1 for i in range(N): if A[i+1] != 1: dp[i+1] += dp[i] dp[i+1] %= mod if i+2 >= N+1: continue if A[i+2] != 1: dp[i+2] += dp[i] dp[i+2] %= mod print(dp[N])
p03069
s159006275
Wrong Answer
N = int(input()) S = input() ans = 0 for i in range(N): if S[i] == "#": if i == N-1: break else: if S[i+1] == ".": ans += 1 print(ans)
p03220
s801386117
Accepted
N = int(input()) T,A = map(int, input().split()) *H, = map(int, input().split()) ans = 100000000 index = 0 for i in range(len(H)): temp = T-H[i]*0.006 if abs(A-temp)<ans: ans = abs(A-temp) index = i print(index+1)
p02548
s809639976
Accepted
ans=0 n=int(input()) for i in range(1,n): for j in range(1,n): if i*j<n: ans+=1 else: break print(ans)
p02835
s909714769
Wrong Answer
# ABC 147 A A1, A2, A3 = map(int, input().split()) if A1 + A2 + A3 >= 22: print('burst') else: print('win')
p02731
s150156746
Accepted
L=int(input()) #D = L//3 #Amari = L%3 #if Amari == 0: # print(D**3) #elif Amari == 1: # print(D*D*(D+1)) #else: # print(D*(D+1)*(D+1)) print(L**3/27)
p03617
s005875126
Accepted
q,h,s,d=map(int,input().split()) n=int(input()) List1=[q*4,h*2,s] List2=[q*8,h*4,s*2,d] if (n%2==0): ans=n*min(List2)//2 print(ans) else: ans=(n-1)*min(List2)//2 ans+=min(List1) print(ans)
p02576
s835165447
Wrong Answer
n,x,t=map(int,input().split()) print(t * (n // x))
p02842
s615697750
Accepted
n = int(input()) for i in range(10**6): if int(i*1.08) == n: print(i) exit() print(':(')
p03997
s339525765
Accepted
icase=45 if icase==45: a=int(input()) b=int(input()) h=int(input()) print((a+b)*h//2)
p03319
s232360081
Wrong Answer
n,k=map(int, input().split()) an = list(map(int, input().split())) min_place = an.index(min(an)) left = (min_place+1)//2 right = (n-min_place)//2 Ans = left + right print(Ans)
p02862
s891699005
Accepted
fact = [1 for _ in range(1000000)] inv = [1 for _ in range(1000000)] fact_inv = [1 for _ in range(1000000)] P = 10**9+7 for i in range(2, 1000000): fact[i] = (fact[i-1]*i) % P inv[i] = P - (inv[P % i] * (P // i)) % P fact_inv[i] = (fact_inv[i-1] * inv[i]) % P X, Y = map(int, input().split()) res = 0 if (X+Y) % 3 == 0: a = (-X+2*Y) // 3 b = (2*X-Y) // 3 if a >= 0 and b >= 0: res = fact[a+b] * ((fact_inv[a] * fact_inv[b]) % P) % P print(res)
p02633
s115579508
Wrong Answer
degree = float(input()) max_num = 360 if(1 <= degree <= 179 and degree.is_integer() == True): answer = max_num / degree print(answer) elif(degree.is_integer() == False): print(False) else: print(False)
p02555
s268559575
Wrong Answer
S = int(input()) sum_now = 1 before_number = 1 before3 = [1, 1, 1] for i in range(6, S+1, 1): sum_now = sum_now + before3[i % 3] before3[i % 3] = sum_now print(sum_now)
p03075
s899946423
Accepted
Z = [int(input()) for _ in range(5)] k = int(input()) ans = 'Yay!' for i in range(4): for j in range(i, 5): if Z[j] - Z[i] > k: ans = ':(' break else: continue break print(ans)
p03835
s712662441
Wrong Answer
splited = input().split(" ") k = int(splited[0]) s = int(splited[1]) z = [i for i in range(k+1)] def check_sum(p): l, r = 0, k while(r - l >= 1): i = int((r + l) / 2) if z[i] == p: return True elif z[i] < p: l = i + 1 else: r = i return False result = 0 for x in range(k+1): for y in range(k+1): if check_sum(s-x-y): result = result + 1 print(result)
p02817
s950831733
Accepted
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians from itertools import permutations, combinations, product from operator import itemgetter, mul from copy import deepcopy from string import ascii_lowercase, ascii_uppercase, digits def input(): return sys.stdin.readline().strip() def INT(): return int(input()) def MAP(): return map(int, input().split()) def LIST(): return list(map(int, input().split())) sys.setrecursionlimit(10 ** 9) INF = float('inf') MOD = 10 ** 9 + 7 S, T = input().split() print(T+S)
p02730
s322789503
Accepted
S = input() N = len(S) K = (N-3)//2 if S == S[::-1] and S[0:K] == S[K:0:-1]: print ('Yes') else: print ('No')
p03323
s972179274
Accepted
a, b = map(int, input().split()) if a > 8 or b > 8: print(':(') elif a <= 8 and b <= 8: print('Yay!')
p03696
s620198731
Accepted
n=int(input()) s=input() ans=[] minscore=0 score=0 for i in range(n): if s[i]=='(': score+=1 else: score-=1 minscore=min(minscore,score) finalscore=score for i in range(-minscore): ans.append('(') for i in range(n): ans.append(s[i]) for i in range(-minscore+finalscore): ans.append(')') print(''.join(ans))
p02724
s624379779
Accepted
a = input() a = int(a) s = (a // 500)*1000 t = ((a % 500)//5)*5 print(s+t)
p03838
s545972038
Wrong Answer
x,y=map(int,input().split()) if 0<=x<y or x<y<=0: print(abs(x-y)) elif x<0<y or y<0<x: print(abs(abs(x)-abs(y))+1) elif y<x<0 or 0<y<x: print(abs(x-y)+2)
p03827
s589362962
Wrong Answer
S=input() max_v =0 v =0 for i in S: if i=="I": v+=0 if v>max_v: max_v=v else: v-=0
p03352
s113824370
Accepted
def actual(X): pow_nums = [1] for i in range(2, 40 + 1): for j in range(2, 40 + 1): if i ** j <= 1000: pow_nums.append(i ** j) pow_nums = sorted(set(pow_nums)) return [pow_num for pow_num in pow_nums if pow_num <= X][-1] X = int(input()) print(actual(X))
p03485
s923495797
Wrong Answer
a, b = map(int, input().split()) x = (a * b) / 2 if x % 1 == 0: print(x) else: print(x + 0.5)
p02717
s054803887
Wrong Answer
x,y,z=map(int,input().split()) print(str(y)+" "+str(z)+" "+str(x))
p02935
s515093236
Wrong Answer
N = int(input()) A = list(map(int,input().split())) A = sorted(A) Asum = sum(A) J = N%2 B = N if J == 0: B -= 1 print(Asum/2**B) elif Asum == A[0]*N: print(A[0]) else: B -= 3 print((((Asum-A[N-1])/(2**B))+A[N-1])/2)
p02627
s177617890
Accepted
j = input() if 'A'<=j and j <= 'Z': print("A") else: print("a")
p03657
s994968828
Accepted
A, B = map(int,input().split()) if A % 3 == 0 or B % 3 ==0 or (A + B) % 3 ==0: print("Possible") else: print("Impossible")
p02702
s206104234
Accepted
# https://atcoder.jp/contests/abc164/tasks/abc164_d import sys input = sys.stdin.readline S = input().rstrip() res = 0 x = 0 p = 1 L = len(S) MOD = 2019 reminder = [0]*2019 reminder[0] = 1 for s in reversed(S): """ 累積和 """ x = (int(s)*p + x)%MOD p = p*10%MOD res += reminder[x] reminder[x] += 1 print(res)
p02606
s396988411
Wrong Answer
l, r, d = map(int, input().split()) a = l // d b = r // d if l % d != 0: a = a+1 if r % d == 0: b = b+1 print(b-a+1)
p03994
s463173757
Wrong Answer
G={chr(a+ord("a")):a for a in range(26)} H={G[b]:b for b in G} T=input() S=[] for s in T: S.append(G[s]) K=int(input()) I=0 N=len(S) for i in range(N): if (i!=N-1) and (26-S[i]<=K): K-=26-S[i] S[i]=0 elif i==N-1: S[i]=(S[i]+K)%26 U="" for s in S: U+=H[s] print(U)
p03494
s119503882
Wrong Answer
n = int(input()) l = [int(i) for i in input().split()] ans = 0 b = True while b: for i in range(n): if l[i]%2==0: l[i]/=2 else: b=False break ans+=1 print(ans)
p03487
s044849913
Accepted
import math from collections import Counter from sys import exit from itertools import product ii = lambda : int(input()) mi = lambda : map(int,input().split()) li = lambda : list(map(int,input().split())) n = ii() a = li() cnt = Counter(a) ans = 0 for i,j in cnt.items(): if i > j: ans += j else: ans += j - i print(ans)
p02755
s005275692
Accepted
a,b=map(int,input().split()) ans = -1 for i in range(1001): if int(i * 0.08) == a and int(i * 0.1) == b: ans = i break; print(ans)