problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03433
s751407000
Wrong Answer
n=int(input()) a=int(input()) if n*500<=a: print("Yes") else: print("No")
p02760
s346932459
Wrong Answer
a1=[int(i) for i in input().split()] a2=[int(i) for i in input().split()] a3=[int(i) for i in input().split()] n=int(input()) for i in range(n): b=int(input()) for j in range(3): if a1[j]==b: a1[j]=-1 if a2[j]==b: a2[j]=-1 if a3[j]==b: a3[j]=-1 print("Yes" if sum(a1)==-3 or sum(a2)==-3 or sum(a3)==-3 or a1[0]+a2[1]+a3[2]==-3 or a1[2]+a2[1]+a3[0]==-3 else "No" )
p03075
s021995469
Wrong Answer
aaa = [int(input()) for i in range(6)] ans = "Yay!" a = aaa[0] for i in range(1,5): if aaa[5] <= a - aaa[i]: ans = ":(" break print(ans)
p03407
s932436043
Accepted
a, b, c = map(int, input().split()) if a + b >= c: print("Yes") else: print("No")
p03329
s830363432
Accepted
#!/usr/bin/env python3 n = int(input()) a = n for i in range(n + 1): j = n - i c = 0 while i > 0: c += i % 6 i //= 6 while j > 0: c += j % 9 j //= 9 a = min(a, c) print(a)
p02778
s907227051
Accepted
S = input() nums = len(list(S)) anslist = ['x']*nums ans = '' for a in anslist: ans += a print(ans)
p03785
s068053931
Accepted
N,C,K = map(int, input().split()) T = [int(input()) for i in range(N)] T.sort() ans=s=0 while s<N: t=T[s]+K sm=1 for i in range(s+1,min(s+C,N)): if T[i]<=t: sm+=1 else: break s+=sm ans+=1 print(ans)
p02814
s444239660
Wrong Answer
import fractions n,m=map(int,input().split()) a = list(map(int, input().split())) for i in range(n): a[i]//=2 ans = a[0] for i in range(1, n): ans = ans * a[i] // fractions.gcd(ans, a[i]) cans=m//ans if cans%2==0: print(cans//2) else: cans=(cans+1)//2 print(cans)
p03037
s518215085
Accepted
#ABC127_C N,M=map(int,input().split()) L=[] R=[] for i in range(M): l,m=map(int,input().split()) L.append(l) R.append(m) if min(R)<max(L): print(0) else: print(min(R)-max(L)+1)
p03419
s231002227
Wrong Answer
_N, _M = map(int, input().split()) N = max(_N, _M) M = min(_N, _M) tate = max(0, N - 2) yoko = max(0, M - 2) if M == 1 and N > 2: print(N - 2) exit() print(tate * yoko)
p03041
s871311465
Accepted
N,K =map(int,input().split()) S=str(input()) h=S[K-1] h=str.swapcase(h) S=S[:K-1]+h+S[K:] print(S)
p03329
s348134229
Accepted
N = int(input()) # dp[i] i円引き出すのに必要な手数 dp = [101010] * 201010 money = [1] t = 6 q = 9 while t <= N: money.append(t) t*=6 while q <= N: money.append(q) q*=9 for m in money: dp[m] = 1 for i in range(1,N): for m in money: dp[i+m] = min(dp[i+m], dp[i]+1) print(dp[N])
p03076
s375218438
Wrong Answer
sum=0 for i in range(5): A=int(input()) s=((A//10)+1)*10 #print(s) sum+=s print(sum)
p02754
s652306253
Wrong Answer
N,A,B = map(int,input().split()) print(A*N//(A+B) + N%(A+B))
p03261
s897081098
Wrong Answer
n = int(input()) result = "Yes" w = list(input()) for i in range(n - 1): s = input() if s in w: result = "No" elif s[0] != w[-1][-1]: result = "No" print(result)
p03633
s650347456
Accepted
import math from functools import reduce def lcm_base(x, y): return (x * y) // math.gcd(x, y) def lcm_list(numbers): return reduce(lcm_base, numbers, 1) N = int(input()) N_List = [] for i in range(N): N_List.append(int(input())) print(lcm_list(N_List))
p03163
s693021124
Accepted
N, W = map(int, input().split()) wv = [] for _ in range(N): wv.append(tuple(map(int, input().split()))) dp = [0]*(W+1) for w, v in wv: newdp = dp[:] for ww in range(W+1): if w+ww > W: continue newdp[w+ww] = max(dp[ww+w], dp[ww]+v) dp = newdp print(dp[-1])
p03730
s612623179
Accepted
#ABC060 B:Choose Integers a,b,c = map(int, input().split()) ans = 'NO' for i in range(b): num = i * a mod = num % b if mod == c: ans = 'YES' break print(ans)
p02681
s137481657
Accepted
a = [str(input()) for i in range(2)] s = a[0] t = a[1] s_l = len(s) S = s + t[s_l] if S == t: print('Yes') else: print('No')
p02602
s341086577
Wrong Answer
[N, K] = list(map(int, input().split())) A = list(map(int, input().split())) gakki = [[i-j for j in range(K)] for i in range(K - 1, N)] hyoka = [] for G in gakki: Hyo = 1 for i in range(K): Hyo *= A[G[i]] hyoka.append(Hyo) for i in range(K - 1): if hyoka[i + 1] > hyoka[i]: print('Yes') else: print('No')
p03408
s278416012
Wrong Answer
n = int(input()) S = [input() for i in range(n)] m = int(input()) T = [input() for j in range(m)] ANS = [] for i in range(len(S)): p = 0 q = 0 for j in range(len(S)): if S[i]== S[j]: p += 1 for k in range(len(T)): if S[i] == T[k]: q += -1 ANS.append(p+q) print(ANS)
p03219
s848207662
Accepted
x,y=map(int,input().split()) print(x+y//2)
p02832
s236682101
Wrong Answer
N = int(input()) a = list(map(int, input().split())) K = 0 p = 0 bricks = [[] for i in range(N)] #iと書かれたレンガがどこにあるか for i in range(N): bricks[a[i] - 1].append(i) print(bricks) for i in range(N): if len(bricks[i]) == 0: break elif bricks[i][-1] < p: break else: for j in bricks[i]: if j >= p: p = j K += 1 break if K == 0: print(-1) else: print(N - K)
p03803
s392935614
Accepted
a,b=map(int,input().split()) x=[2,3,4,5,6,7,8,9,10,11,12,13,1] i=x.index(a) j=x.index(b) print('Draw' if i==j else ('Alice' if i>j else 'Bob'))
p02820
s101384309
Accepted
N, K = map(int, input().split()) R, S, P = map(int, input().split()) T = list(input()) d = {'r':P, 's':R, 'p':S} ans = 0 for i in range(N): if i < K: ans += d[T[i]] else: if T[i] != T[i - K]: ans += d[T[i]] else: T[i] = 'z' print(ans)
p02714
s789990548
Accepted
N = int(input()) S = input() r = S.count('R') g = S.count('G') b = S.count('B') ans = r * g * b for i in range(1, (N - 1) // 2 + 1): for j in range(N - i * 2): if S[j] != S[j+i] and S[j] != S[j+2*i] and S[j+i] != S[j+2*i]: ans -= 1 print(ans)
p03438
s182585068
Accepted
from sys import stdin from math import ceil def main(): readline=stdin.readline N=int(readline()) a=list(map(int,readline().split())) b=list(map(int,readline().split())) a_count=0 s=sum(b)-sum(a) for i in range(N): if a[i]<b[i]: a_count+=ceil((b[i]-a[i])/2) if a_count<=s: print("Yes") else: print("No") if __name__=="__main__": main()
p03486
s281719258
Accepted
s=sorted(input()) t=sorted(input(),reverse=True) print("Yes" if s<t else "No")
p03162
s822474084
Accepted
def chmax(a, b): if a < b: return b return a N = int(input()) H = [list(map(int, input().split())) for _ in range(N)] dp = [[-float('inf') for i in range(3)] for j in range(N)] dp[0] = H[0] for i in range(1, N): for j in range(3): for k in range(3): if j != k: dp[i][j] = chmax(dp[i][j], dp[i-1][k]+H[i][j]) print(max(dp[-1]))
p02994
s086525239
Wrong Answer
n,l = list(map(int,input().split())) n_l = [] for i in range(n): n_l.append(i+l) print(n_l) min_i = n_l[0] for i in n_l: print(i) if abs(i) < abs(min_i): min_i = i print(sum(n_l) - min_i)
p02854
s890570491
Wrong Answer
N = int(input()) A = list(map(int, input().split())) res = 10**9 left = 0 right = sum(A) for i in range(N): left += A[i] right -= A[i] res = min(res,abs(left-right)) print(res)
p02988
s303193936
Accepted
import io nim = int(input()) mike = list(map(int,input().split())) counter = 0 for i in range(nim): t = mike[i:i+3] if len(t) == 3: if max(t) > t[1] and min(t) < t[1]: counter += 1 print(counter)
p02675
s643236754
Accepted
n=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")
p03478
s161752833
Wrong Answer
N, A, B = map(int, input().split()) def keta_sum(x): sum = 0 while x%10 !=0: sum += x%10 x = x//10 return(sum) #cnt=0 total=0 for x in range(N+1): y = keta_sum(x) if A<=y<=B: #cnt +=1 total +=x print(total)
p03352
s349416548
Accepted
X = int(input()) cnt = 1 for b in range(1,X): for p in range(2,X): if b**p <= X: cnt = max(cnt, b**p) else: break print(cnt)
p02813
s031916599
Accepted
import numpy as np import math N = int(input()) P = np.array(list(map(int, input().split()))) Q = np.array(list(map(int, input().split()))) def _get_order(N, v, i): order=np.argsort(v[i:]) return list(order).index(0) * math.factorial(len(order)-1) def get_order(N, v): each_order=list(map(lambda i: _get_order(N, v, i), range(N))) return each_order a = sum(get_order(N, P)) b = sum(get_order(N, Q)) print(abs(a-b))
p02848
s233717201
Wrong Answer
n=int(input()) s=input() ans='' for ss in s: if ord(ss)+n<=ord('z'): ss=chr(ord(ss)+n) else: ss=chr(ord(ss)+n-26) ans+=ss print(ans)
p02598
s998357018
Wrong Answer
N, K = map(int, input().split()) A = sorted(list(map(int, input().split()))) def check(N, K, A, L): return sum(a // L for a in A) <= K answer=max(A) lo = 1 hi = answer+1 while lo < hi: m = (lo + hi)//2 ok = check(N, K, A, m) if ok: # answer=m hi=m else: lo=m+1 print(min(max(A), answer))
p02922
s055116377
Accepted
A,B = map(int, input().split()) ans = 0 while ans*(A-1)+1 < B: ans+=1 print(ans)
p03723
s108995735
Accepted
a, b, c=map(int, input().split()) if a==b and b==c: if a%2==1: print(0) else: print(-1) else: cnt=0 while(1): if a%2==1 or b%2==1 or c%2==1: print(cnt) break cnt+=1 ha=a/2 hb=b/2 hc=c/2 a=hb+hc b=ha+hc c=ha+hb
p02948
s092355632
Accepted
import heapq N, M = map(int, input().split(" ")) work_que = [] can_work = [] ans = 0 for i in range(N): a, b = map(int, input().split(" ")) heapq.heappush(work_que, (a, -b)) for i in range(M, -1, -1): while len(work_que) > 0 and work_que[0][0] + i <= M: top_work = heapq.heappop(work_que) heapq.heappush(can_work, top_work[1]) if len(can_work) > 0: ans += -heapq.heappop(can_work) print(ans)
p03696
s114906295
Wrong Answer
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] R = s[i].count(")") L = s[i].count("(") if R < L: r += ")" * (L-R) elif L < R: l += "(" * (R-L) print(l + "".join(s) + r)
p03359
s844802643
Accepted
a,b=map(int,input().split()) # 1/1,2/2,3/3,4/4,5/5,6/6,7/7,8/8,9/9,10/10,11/11,12/12 ans = a-1 if b>=a: print(ans+1) else: print(ans)
p03076
s332542002
Accepted
# Problem B - Five Dishes from itertools import permutations import math # input nums = [0]*5 for i in range(5): n = int(input()) nums[i] = n # initialization pattern_moto = [i for i in range(5)] patterns = permutations(pattern_moto) min_time = 1000 # time count for p in patterns: tmp = 0 for i in range(4): tmp += nums[p[i]] tmp = math.ceil(tmp/10)*10 tmp += nums[p[4]] min_time = min(min_time, tmp) # output print(min_time)
p03951
s589592766
Accepted
N = int(input()) s = input() t = input() for i in range(N, -1, -1): if s[-i:] == t[:i]: print(N + (N - i)) break else: print(N * 2)
p02695
s927707145
Wrong Answer
import itertools n, m, q = map(int, input().split()) array = [] for i in range(q): a = list(map(int, input().split())) array.append(a) comb = list(itertools.combinations(range(1, m+1), n)) ans = -1 for i in comb: score = 0 for a, b, c, d in array: if i[b-1] - i[a-1] == c: score += d ans = max(ans, score) print(ans)
p03471
s972344502
Accepted
n,y = map(int,input().split()) res = [-1,-1,-1] for i in range(n+1): for j in range(n-i+1): if(10000*i + 5000*j + 1000*(n-i-j) == y): res = [i,j,n-i-j] break print(*res)
p03761
s940913781
Wrong Answer
def intersect(s,t): res = '' for char in s: if char in t: res+=char return res n = int(input()) res = input() for _ in range(n-1): s = input() res = intersect(res,s) ans = list(res) ans.sort() print(*ans, sep='')
p03457
s384428740
Wrong Answer
N = int(input()) t=[0]*(N+1); x=[0]*(N+1); y=[0]*(N+1) t_diff=0; x_diff=0; y_diff=0 for i in range(1,N+1): t[i], x[i], y[i] = map(int, input().split()) # print(t, x, y) for i in range(N): t_diff += t[i+1]-t[i] x_diff += x[i+1]-x[i] y_diff += y[i+1]-y[i] if t_diff%2 != (x_diff+y_diff)%2 or t[-1] < (x[-1]+y[-1]): print("No") exit() print("Yes")
p02748
s693490967
Accepted
import sys sys.setrecursionlimit(10 ** 6) input = sys.stdin.readline A, B, M = [int(x) for x in input().strip().split()] a = [int(x) for x in input().strip().split()] b = [int(x) for x in input().strip().split()] ans = min(a) + min(b) for m in range(M): x, y, c = [int(x) for x in input().strip().split()] ans = min(ans, a[x-1]+b[y-1]-c) print(ans)
p03548
s579837646
Accepted
x, y, z = map(int, input().split()) print((x - z) // (y + z))
p02933
s140465173
Wrong Answer
a = int(input()) s = input() if a >= 3200: print('s') if a < 3200: print('red')
p03319
s021132161
Wrong Answer
N, K = map(int, input().split()) Alist = list(map(int, input().split())) if K >= N: print(1) else: from math import ceil one = Alist.index(1) left = one + 1 right = N - one print(ceil(left / K) + ceil(right / K))
p02917
s738417613
Accepted
n=int(input()) b=list(map(int,input().split())) a=[0]*n a[0]=b[0] for i in range(n-2): a[i+1]=min(b[i],b[i+1]) a[-1]=b[-1] print(sum(a))
p03469
s297590443
Accepted
date=str(input()) print(date.replace("2017","2018",1))
p02909
s040895686
Wrong Answer
print('CRSlauoinunndyyy'[id(id)%3::3])
p03854
s019913694
Wrong Answer
s = input() strset = {'dream': 5, 'dreamer': 7, 'erase': 5, 'eraser': 6} while len(s)>0: if s[0:6] == 'eraser': s = s[6:] print(s) elif s[0:7] == 'dreamer': s = s[7:] print(s) elif s[0:5] == 'dream' or s[0:5] == 'erase': s = s[5:] print(s) else: print('NO') exit() print('YES')
p02814
s464075455
Wrong Answer
def gcd(a, b): if a == 0: return b return gcd(b % a, a) n, m = map(int, input().split()) a = list(map(int, input().split())) lcm = 1 cnt = 0 for e in a: e //= 2 lcm *= e // gcd(lcm, e) if lcm > m: break cnt += e & 1 if cnt in {0, n}: res = (1 + m // lcm) // 2 else: res = 0 print(res)
p02622
s595062499
Accepted
s = input() t = input() n= len(s) diff = 0 for i in range(n): if s[i]!=t[i]: diff += 1 print(diff)
p02553
s455743530
Wrong Answer
a, b, c, d = map(int, input().split()) m = -9999 ac = a * c if ac >= m: m = ac ad = a * d if ad > m: m = ad bc = b * c if bc >= m: m = bc bd = b * d if bd >= m: m = bd print(m)
p03145
s096551780
Accepted
a,b,c=sorted(list(map(int,input().split()))) print(a*b//2)
p02760
s901832318
Accepted
A = [] a = [1]*9 for i in range(3): A += input().split() n = int(input()) for i in range(n): b = input() if b in A: a[A.index(b)] = 0 for i in range(3): if a[3*i] + a[3*i+1] + a[3*i+2] == 0 or a[i] + a[i+3] + a[i+6] == 0: print('Yes') break else: if a[0] + a[4] + a[8] == 0 or a[2] + a[4] + a[6] ==0: print('Yes') else: print('No')
p03548
s033369361
Accepted
x, y, z = map(int, input().split()) x = x-z c = y+z n = 0 while 0 < x: if c <= x: n = n+1 x = x-c else: break print(n)
p02754
s105776325
Accepted
n, a, b = map(int, input().split()) if a == 0 : print (0) elif b == 0 : print (n) else : ans = 0 ans += ( n // (a+b) ) * a ans += min( (n%(a+b)), a ) print (ans)
p03380
s060966666
Accepted
N=int(input()) A=list(map(int,input().split())) A.sort() def binary(l,i): r=N-1 while l<=r: m=(l+r)//2 if A[m]==i: return A[m] elif A[m]>i: r=m-1 else: l=m+1 x=abs(A[m]-i) for j in range(max(0,m-2),min(m+3,N-1)): if x >= abs(A[j]-i): res = A[j] x=abs(A[j]-i) return res print(A[-1],binary(1,A[-1]/2))
p02606
s770910238
Accepted
L, R, d = list(map(int, input().split(' '))) ans = 0 for i in range(L, R + 1): if i % d == 0: ans += 1 print(ans)
p03672
s953728270
Accepted
from sys import stdin, setrecursionlimit def main(): input = stdin.buffer.readline s = list(input()[:-1].decode()) n = len(s) for i in reversed(range(n - 1)): if (i + 1) % 2 == 0: l = ''.join(s[:(i + 1) // 2]) r = ''.join(s[(i + 1) // 2:i + 1]) if l == r: print(i + 1) exit() if __name__ == "__main__": setrecursionlimit(10000) main()
p02688
s496603200
Accepted
N, K = [int(_) for _ in input().split()] A = [] for i in range(K): d = int(input()) A.append([int(_) for _ in input().split()]) xs = [0] * N for rs in A: for r in rs: xs[r - 1] += 1 result = sum(x == 0 for x in xs) print(result)
p03479
s210057840
Accepted
X, Y = list(map(int,input().split())) ans = 0 tmp = X while tmp <= Y: tmp *= 2 ans += 1 print(ans)
p03087
s264522501
Accepted
N, Q = map(int, input().split()) S = input() total = [0]*(N+1) for i in range(2, N+1): if S[i-2]=='A' and S[i-1]=='C': total[i] = total[i-1]+1 else: total[i] = total[i-1] for i in range(Q): l, r = map(int, input().split()) print(total[r]-total[l])
p02778
s724144672
Wrong Answer
S = input() l = len(S) ans = "*" * l print(ans)
p03852
s238304990
Accepted
a = input() if a in "aiueo": print("vowel") else: print("consonant")
p02947
s798602004
Wrong Answer
import math n = int(input()) s = list(''.join(sorted(input())) for i in range(n)) cnt = 0 for i in set(s): n = s.count(i) if n >= 2: cnt += (math.factorial(n)//2*math.factorial(n-2)) print(cnt)
p04029
s956722580
Wrong Answer
N=int(input()) s=0 for i in range(0,N): s=s+i
p03289
s595628378
Accepted
S = str(input()) a=0 b=0 c=0 if S[0]=='A': a=1 cnt=0 for i in S[2:-1]: if i=='C': cnt+=1 if cnt==1: b=1 s=S[1:] s=s.replace('C','') if s.islower()==True: c=1 if a==1 and b==1 and c==1: print('AC') else: print('WA')
p02641
s374920517
Wrong Answer
X, N = map(int, input().split()) P = list(map(int, input().split())) if N == 0: print(100) else: min_abs = 100 min_abs = min([abs(X-i) for i in range(100) if not i in P]) min_abs ans_candi = [i+X for i in range(-min_abs, min_abs+1) if not i+X in P] ans = min(ans_candi) print(ans)
p02624
s891228217
Wrong Answer
n=int(input()) ans=0 for i in range(1,n+1): cnt = 1 for j in range(1,int(i**0.5)+5): if i==j:break if i%j ==0:cnt += 1 ans += i*cnt print(ans)
p03131
s727009799
Accepted
K,A,B = list(map(int,input().split())) if B-A <= 1: print(K+1) exit() ans = A K = K - (A-1) yen = 0 if K%2 == 0: ans += (B-A)*(K//2) else: ans += (B-A)*(K//2)+1 print(ans)
p02678
s494388465
Wrong Answer
print("No")
p02753
s910383470
Wrong Answer
s=str(input()) if s[0]==s[1] and s[1]==s[2]: print('Yes') else: print('No')
p02576
s516096918
Accepted
n,x,t = map(int, input().split()) times = 0 times = t while n - x > 0: n -= x times += t print(times)
p02647
s896342339
Accepted
from itertools import accumulate n, k = map(int,input().split()) a = list(map(int,input().split())) for j in range(k): if j > 41: break b = [0] * n for i in range(n): b[max(0, i - a[i])] += 1 if i + a[i] + 1 < n: b[i + a[i] + 1] -= 1 a = list(accumulate(b)) print(*a)
p03042
s373757874
Accepted
s = list(input()) a = int(s[0] + s[1]) b = int(s[2] + s[3]) if (a == 0 or 13 <= a <= 99) and (b != 0 and 1 <= b <= 12): print("YYMM") elif (1 <= a <= 12) and (b == 0 or 13 <= b <=99): print("MMYY") elif 1 <= a <= 12 and 1 <= b <= 12: print("AMBIGUOUS") else: print("NA")
p03327
s222117280
Wrong Answer
N = int(input()) tmp = str(N) if N < 1000: print("ABC"+tmp.zfill(3)) else: print("ABD"+tmp.zfill(4))
p02988
s423833724
Wrong Answer
import sys input = sys.stdin.readline def main(): ans = 0 n = int(input()) d = list(map(int, input().split())) d.sort() ans += d[n//2] - d[n//2-1] print(ans) if __name__ == '__main__': main()
p03103
s944484638
Wrong Answer
N, M = map(int,input().split()) X = [] Y = [] for i in range(N): X = list(map(int,input().split())) Y.append(X) Y = sorted(Y) ans = 0 for i in range(N): if M >= Y[i][1]: ans += Y[i][0] * Y[i][1] M -= Y[i][1] else: ans += M * Y[i][0] print(int(ans)) exit()
p03206
s766969206
Accepted
l = {25: "Christmas", 24: "Christmas Eve", 23: "Christmas Eve Eve", 22: "Christmas Eve Eve Eve"} print(l[int(input())])
p02767
s340582378
Accepted
N = int(input()) X = [int(x) for x in input().split()] X.sort() P = [[0 for i in range(N)] for _ in range(101)] for p in range(101): for i, x in enumerate(X): P[p][i] = (x - p) ** 2 print(min([sum(p) for p in P[1:]]))
p03632
s309481580
Accepted
def ii():return int(input()) def iim():return map(int,input().split()) def iil():return list(map(int,input().split())) def ism():return map(str,input().split()) def isl():return list(map(str,input().split())) a,b,c,d = iim() print(max(min(b,d)-max(a,c),0))
p03774
s392014232
Accepted
n, m = list(map(int, input().split())) ab = [list(map(int, input().split())) for i in range(n)] cd = [list(map(int, input().split())) for i in range(m)] for i in range(n): a, b = ab[i] dist = 1e+15 ans = 0 for j in range(m): c, d = cd[j] if dist > abs(a - c) + abs(b - d): ans = j dist = abs(a - c) + abs(b - d) print(ans+1)
p02797
s948062584
Accepted
N,K,S=map(int,input().split()) A=[S]*N for i in range(K,N): if S!=1: A[i]=S-1 else: A[i]=S+1 print(*A)
p02582
s552362052
Wrong Answer
day = input() count = day.count("R") count1 = day.count("RR") if count == 2: if count1 == 1: print(2) else: print(1) if count == 1: print(1) if count == 0: print(0)
p03146
s920173723
Accepted
from collections import defaultdict s = int(input()) D = defaultdict(int) D[s] += 1 ans = 1 def f(a): if a%2 == 0: return a//2 else: return 3*a + 1 while True: s = f(s) ans += 1 if D[s] == 1: print(ans) break D[s] += 1
p03796
s493509717
Accepted
N = int(input()) ans = 1 mod = pow(10, 9)+7 for i in range(1, N+1): ans = (ans*i) % mod print(ans)
p04030
s281616836
Wrong Answer
a=list(input()) print(a) b=[] for i in a: if i=="0": b.append(i) if i=="1": b.append(i) if i=="B": if b!=[]: b.pop(-1) for j in b: print(j,end="")
p02657
s680519152
Wrong Answer
#169A #A*Bを整数として出力せよ #1.入力をプログラムで扱えるように受け取ること a,b = map(int, input().split()) print(a,b) #2.受け取った入力値を使って適切に処理(計算)すること answer = a * b #3.計算した結果を出力すること print(answer)
p03544
s128525043
Accepted
N = int(input()) dp = [[]for i in range(87)] dp[0] = 2 dp[1] = 1 for i in range(2,87): dp[i] = dp[i-1]+dp[i-2] if i == N: print(dp[i]) break else: print(dp[N])
p02818
s509434474
Accepted
a, b, k = map(int, input().split()) if a >= k: print(a-k, b) else: if a+b > k: print(0, b-(k-a)) else: print(0,0)
p03817
s732233992
Accepted
def solve(): N = int(input()) ans = N // 11 * 2 if N % 11 >= 7: ans += 2 elif N % 11 >= 1: ans += 1 print(ans) if __name__ == '__main__': solve()
p03150
s293430334
Accepted
S = input() N = len(S) for i in range(N): for j in range(i, N + 1): if S[:i] + S[j:] == "keyence": print("YES") quit() print("NO")