problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p02873
s829530561
Accepted
s = str(input()) + '0' ans = [0] * (len(s)) cnt = 0 for i in range(len(s)): ans[i] = cnt if s[i] == '<': cnt += 1 else: cnt = 0 cnt = 0 for i in range(len(s))[::-1]: ans[i] = max(cnt,ans[i]) if s[i-1] == '>': cnt += 1 else: cnt = 0 print(sum(ans))
p02861
s582564177
Accepted
N=int(input()) lis=[tuple(map(int,input().split())) for _ in range(N)] import itertools,math p = itertools.permutations(list(range(N))) sm=0 for v in p: #print(v) for k in range(N-1): xi,yi=lis[v[k]] xj,yj=lis[v[k+1]] #print(xi,yi,xj,yj) sm+=((xi-xj)**2+(yi-yj)**2)**(1/2) print(sm/math.factorial(N))
p02723
s908700320
Accepted
string = list(input()) if string[2] == string[3] and string[4] == string[5]: print("Yes") else: print("No")
p02829
s686496671
Accepted
a=int(input()) b=int(input()) for i in range(1,4): if i!=a and i!=b: print(i)
p03469
s305928270
Accepted
a = input() b = a[:3] + "8" + a[4:] print(b)
p03711
s776000240
Wrong Answer
x,y=map(int,input().split()) if x==2 or y==2: print("No") elif (x==4 and y==6,9,11) or (x==6 and y==9,11) or (x==9 and y==11): print("Yes") elif (x==1 and y==3,5,7,8,10,12) or (x==3 and y==5,7,8,10,12) or (x==5 and y==7,8,10,12) or (x==7 and y==8,10,12) or (x==8 and y==10,12) or (x==10 and y==12): print("Yes") else: print("No")
p03035
s203517455
Wrong Answer
a,b=map(int,input().split()) if a >= 13: print(b) elif a <= 5: print(0) else: print(b/2)
p03617
s355013703
Wrong Answer
Q, H, S, D = map(int, input().split()) N = int(input()) l_1 = min((Q * 4), (H * 2), (S * 1)) l_2 = min((Q * 8), (H * 4), (S * 2), (D * 1)) ans = 0 if N == 1: ans = int(l_1) elif N % 2 == 0: ans = int(l_2 * N / 2) else: ans = int((N - 1) / 2 * l_2 + l_1) print(ans)
p03243
s377406329
Accepted
n = int(input()) ok = [111,222,333,444,555,666,777,888,999] while n not in ok: n += 1 print(n)
p02873
s625993242
Wrong Answer
# A S = input() ans = [0] * (len(S)+1) for i in range(len(S)): if S[i] == ">": ans[i+1] = max(ans[i+1],ans[i]) for i in range(len(S)-1,-1,-1): if S[i] == '>': ans[i] = max(ans[i],ans[i+1]+1) print(sum(ans))
p03071
s035326393
Accepted
a, b= map(int, raw_input().split()) if a == b: print a + b else: print max(a, b) + max(a, b) - 1
p02552
s113253505
Accepted
x = int(input()) if x == 0: print(1) elif x == 1: print(0)
p02779
s589840205
Wrong Answer
n=int(input()) a=list(map(int,input().split())) if n==len(set(a)): print('Yes') else:print('No')
p02778
s060533871
Wrong Answer
print(["x" for c in range(len(input()))])
p02657
s126888852
Wrong Answer
# 169A # A × B を整数として出力せよ # 1.入力をプログラムで扱えるように受け取ること a, b = map(int, input().split()) print(a,b) # 2.受け取った入力値を使って、適切に処理(計算)すること answer = a * b # 3.計算した結果を出力すること print(answer)
p02982
s763429759
Accepted
import math n, d = map(int, input().split()) x = [list(map(int, input().split())) for _ in range(n)] ans = 0 cal = 0 for i in range(n): for j in range(i+1, n): for k in range(d): de = abs(x[i][k] - x[j][k]) cal += de**2 if math.sqrt(cal)%1==0: ans += 1 cal = 0 print(ans)
p02759
s742426581
Accepted
a = int(input()) if a % 2 == 0: print(a // 2) else: print(a // 2 + 1)
p03380
s212369623
Accepted
n = int(input()) a = [int(i) for i in input().split()] a.sort() b = a[:] bs = set(b) f = a[-1] for i in range(n): a[i] = min(a[i],f-a[i]) a.sort() s = a[-1] if s in bs: print(f,s) exit() s = f - s print(f,s)
p03136
s541506091
Accepted
#ABC-118-B N = int(input()) L = list(map(int, input().split())) max_L = max(L) sum_L = sum(L) if max_L < sum_L-max_L: print("Yes") else: print("No")
p02948
s116541686
Accepted
import sys from heapq import * readline = sys.stdin.readline N, M = map(int, readline().split()) days = [[] for _ in range(M)] for _ in range(N): a, b = map(int, readline().split()) if a <= M: days[a-1].append(b) ans = 0 hq = [] heapify(hq) for day in days: for pay in day: heappush(hq, -pay) if hq: ans += -heappop(hq) print(ans)
p02628
s775292222
Wrong Answer
N, K = map(int,input().split()) p = list(map(int,input().split())) p.sort() ls = [] for i in range(K): ls.append(p[i])
p03417
s206771015
Wrong Answer
n, m = map(int, input().split()) ans = 0 if n > m: n, m = m, n if n == 1 or m == 1: ans = max(0, m - 2) elif n == 2 or m == 2: ans = 0 else: ans = (n - 2) * (m - 2) print(ans)
p02899
s298272741
Accepted
n = int(input()) a = [int(x) for x in input().split()] x = [0]*n for i in range(n): x[a[i]-1] = i+1 ans = "" for i in x: ans += str(i) + " " print(ans)
p03838
s634894081
Accepted
x,y=map(int,input().split()) a=abs(abs(x)-abs(y)) if x==0: if y<0: print(a+1) else: print(a) elif y==0: if x<0: print(a) else: print(a+1) elif y*x>0 and y>x: print(a) elif y*x>0 and x>y: print(a+2) elif y*x<0: print(a+1)
p02583
s733392854
Accepted
N=int(input()) L=list(map(int,input().split(' '))) N_tri=0 for i in range(N): for j in range(i+1,N): for k in range(j+1,N): if L[i] != L[j] and L[j]!=L[k] and L[k]!=L[i]: L_sorted=sorted([L[i],L[j],L[k]]) if L_sorted[0]+L_sorted[1]>L_sorted[2]: N_tri+=1 print(N_tri)
p02684
s229106806
Accepted
N, K = map(int, input().split()) A = list(map(int, input().split())) x=1 while K: if K&1: x=A[x-1] K>>=1 A2 = [None]*N for i,a in enumerate(A): A2[i]=A[A[i]-1] A=A2 print(x)
p03457
s941441520
Accepted
N=int(input()) T= [list(map(int,input().split())) for _ in range(N)] is_able=True pre_t = 0 pre_x = 0 pre_y = 0 for i in range(len(T)): if (T[i][0] % 2) != (T[i][1]+T[i][2])%2: is_able=False break if T[i][0]-pre_t < (T[i][1]-pre_x + T[i][2]-pre_y): is_able=False break pre_t=T[i][0] pre_x=T[i][1] pre_y=T[i][2] if is_able: print('Yes') else: print('No')
p03785
s376137493
Accepted
N, C, K = list(map(int, input().split())) passengers = sorted([int(input()) for i in range(N)]) res = 0 bus_time = passengers[0] bus_count = C for p in passengers: if bus_count == 0 or p - bus_time > K: res += 1 bus_time = p bus_count = C - 1 else: bus_count -= 1 if bus_count != C: res += 1 print(res)
p03419
s437400608
Accepted
#!/usr/bin/env python3 import sys import math from bisect import bisect_right as br from bisect import bisect_left as bl sys.setrecursionlimit(2147483647) from heapq import heappush, heappop,heappushpop from collections import defaultdict from itertools import accumulate from collections import Counter from collections import deque from operator import itemgetter from itertools import permutations mod = 10**9 + 7 inf = float('inf') def I(): return int(sys.stdin.readline()) def LI(): return list(map(int,sys.stdin.readline().split())) n, m = LI() if n == 1 and m == 1: print(1) elif n == 1: print(max(0, m-2)) elif m == 1: print(max(0, n-2)) else: print((n-2)*(m-2))
p03037
s369535745
Accepted
N, M = map(int, input().split()) L = [None] * M R = [None] * M for i in range(M): l, r = map(int, input().split()) L[i] = l R[i] = r L_max = max(L) R_min = min(R) if L_max > R_min: print(0) else: print(R_min - L_max + 1)
p03062
s248955453
Accepted
n = int(input()) a = list(map(int,input().split())) c = 0 for i in range(n): if a[i] < 0: c += 1 a[i] = abs(a[i]) if c % 2 == 0: print(sum(a)) else: print(sum(a)-(min(a)*2))
p02584
s738582466
Accepted
X, K, D = [int(x) for x in input().split()] X = abs(X) straight = min(K, X // D) K -= straight; X -= straight * D; if K % 2 == 0: print(X) else: print(D - X)
p02642
s041248269
Accepted
N = int(input()) ans = 0 A = list(map(int,input().rstrip().split(" "))) A.sort() A2 = [True for i in range(A[-1] + 1)] for i in range(len(A)): k = A[i] * 2 if A2[A[i]]: if i != 0 and A[i-1] == A[i]: A2[A[i]] = False while(k < len(A2)): A2[k] = False k += A[i] for i in A: if A2[i]: ans += 1 print(ans)
p03760
s944799024
Accepted
import queue o = input() e = input() odd = list(o) even = list(e) answer = [] o_q = queue.Queue() e_q = queue.Queue() for i in range(len(odd)): o_q.put(odd[i]) for i in range(len(even)): e_q.put(even[i]) while not o_q.empty(): answer.append(o_q.get()) if e_q.empty(): continue answer.append(e_q.get()) for i in range(len(answer)): print(answer[i],end='')
p02701
s713629827
Accepted
n=int(input()) s=list(input() for _ in range(n)) import collections ans=collections.Counter(s) print(len(ans))
p03862
s217634327
Accepted
N,x=map(int,input().split()) a=list(map(int,input().split())) ans=0 for i in range(N-1): if a[i]+a[i+1]>x: if a[i]+a[i+1]-x<=a[i+1]: ans+=(a[i]+a[i+1]-x) a[i+1]-=(a[i]+a[i+1]-x) else: ans+=(a[i]+a[i+1]-x) a[i+1]=0 print(ans)
p03281
s658644353
Wrong Answer
def make_divisors(n): divisors = [] for i in range(1, int(n**0.5)+1): if n % i == 0: divisors.append(i) if i != n // i: divisors.append(n//i) # divisors.sort() return divisors ans=0 N=int(input()) if N<105: print(0) exit(0) for i in range(104,N): if i%2==1 and len(make_divisors(i))==8: ans+=1 print(ans)
p02676
s301175677
Accepted
K = int(input()) S = str(input()) if len(S) <= K: print(S) else: print('{}...'.format(S[0:K]))
p03705
s216088557
Accepted
n,a,b=map(int,input().split()) print(max(0,(b-a)*(n-2)+1))
p03061
s164012516
Accepted
N=int(input()) A=list(map(int,input().split())) A=[0]+A import math L=[0 for i in range(N+2)] R=[0 for i in range(N+2)] for i in range(0,N+1): L[i+1]=math.gcd(L[i],A[i]) for i in range(N,-1,-1): R[i]=math.gcd(R[i+1],A[i]) M=[0 for i in range(N+1)] for i in range(1,N+1): M[i]=math.gcd(L[i],R[i+1]) print(max(M))
p03457
s931481554
Wrong Answer
N = int(input()) pos_x=0 pos_y=0 t_now=0 flg = True for i in range(N): t,x,y = map(int,input().split()) t_del = t-t_now res = (t_del-abs(pos_x-x)-abs(pos_y-y)) if (res>=0) & (res%2==0): t_now = t x_pos = x y_pos=y pass else: flg = False break if flg == True: print('Yes') else: print('No')
p03250
s048291889
Accepted
l=list(map(str,input().split())) l.sort() a=l[0] b=l[2]+l[1] print(int(b)+int(a))
p03319
s198472616
Accepted
import math N,K=map(int,input().split()) L=list(map(int,input().split())) ans=math.ceil((N-K)/(K-1))+1 print(ans)
p02973
s218843360
Wrong Answer
import sys input = sys.stdin.readline from collections import deque n = int(input()) a = [int(input()) for _ in range(n)] s = deque([a[0]]) from bisect import bisect_right for i in a[1:]: if i <= a[0]: s.appendleft(i) else: s[bisect_right(s, i) - 1] = i # print(s) print(len(s))
p03486
s774231347
Wrong Answer
s = str(input()) t = str(input()) #print(s,t) if min(s) < max(t): print('Yes') else: print('No')
p03061
s462744082
Wrong Answer
import sys import fractions import math import itertools n=int(input()) a=list(map(int,input().split())) list=[] ans=0 for i in itertools.combinations(a,2): value=fractions.gcd(i[0],i[1]) if ans<=value: ans=value print(ans)
p02802
s313616520
Accepted
import numpy as np n,m = map(int, input().split()) ac_ques = np.array([0]*n) count = np.array([0]*n) for _ in range(m): p,s = map(str, input().split()) if ac_ques[int(p)-1] == 0: if s == "WA": count[int(p)-1] += 1 else: ac_ques[int(p)-1] = 1 print(sum(ac_ques),sum(ac_ques * count))
p03681
s980221725
Wrong Answer
import sys def permutation(n, x, mod=10**9+7): # nPx # 順列 # ex) permutaion(5, 2) = 20 tmp = 1 for i in range(n, n-x, -1): tmp = (tmp * i) % mod return tmp N, M = map(int, sys.stdin.readline().strip().split()) if abs(N - M) > 1: print(0) elif N - M == 1: print(permutation(N, N) * permutation(M, M) % (10**9+7)) else: print(2 * permutation(N, N) * permutation(M, M) % (10**9+7))
p03679
s981033974
Accepted
import sys input = sys.stdin.readline X, A, B = map(int, input().split()) if A - B >= 0: print("delicious") elif B - A <= X: print("safe") else: print("dangerous")
p03632
s985193932
Accepted
A, B, C, D = map(int, input().split()) ans = max(min(B, D) - max(A, C), 0) print(ans)
p03329
s678586677
Accepted
n = int(input()) l = [1] c = 1 while(6**c <= 100000): l.append(6**c) c += 1 c = 1 while(9**c <= 100000): l.append(9**c) c += 1 l.sort() dp = [100001 for _ in range(n+1)] dp[0] = 0 for i in range(len(l)): for j in range(l[i],n+1): dp[j] = min(dp[j],dp[j - l[i]]+1) print(dp[n])
p02633
s900751075
Accepted
X = int(input()) K = 1 while True: if X*K %360 ==0: print(K) break K += 1
p04043
s292554077
Accepted
A = list(input()) print("YES" if A.count("5")==2 and A.count("7")==1 else "NO")
p03524
s553215438
Wrong Answer
from collections import Counter S = str(input()) CS = Counter(S) V = list(CS.values()) ans = 'YES' if len(V) == 1: ans = 'NO' elif len(V) == 2: if V[0] >= V[1]+1: ans = 'NO' else: if V[0]-V[2] > 1: ans = 'NO' print(ans)
p03548
s183158935
Accepted
X,Y,Z = map (int, input ().split ()) X = X-Z A = (X/(Y+Z))//1 print (round (A))
p03624
s769689354
Accepted
strings = str(input()) string_list = list(strings) string_set = set(string_list) import string alpha = list(string.ascii_lowercase) alpha_set = set(alpha) ans = (alpha_set - string_set) ans = list(ans) ans.sort() if len(ans) > 0: print(ans[0]) else: print("None")
p03327
s540594457
Accepted
N=int(input()) if N>=1000: print('ABD') else: print('ABC')
p03804
s819578742
Accepted
N, M = map(int, input().split()) A = [list(input()) for _ in range(N)] B = [list(input()) for _ in range(M)] flag = False for i in range(N-M+1): for j in range(N-M+1): tmp = True for k in range(i,i+M): if A[k][j:j+M] != B[k-i]: tmp = False if tmp: flag = True break if flag: break if flag: print('Yes') else: print('No')
p03720
s618267874
Accepted
N, M = map(int, input().split()) c = [0]*(N+1) for i in range(M): a, b = map(int, input().split()) c[a] += 1 c[b] += 1 for i in range(N): print(c[i+1])
p02909
s839586429
Accepted
s = input() lis = ['Sunny', 'Cloudy', 'Rainy'] if s == lis[0]: print(lis[1]) if s == lis[1]: print(lis[2]) if s == lis[2]: print(lis[0])
p02797
s319848906
Wrong Answer
n,k,s=map(int,input().split()) li=[] for i in range(k): li.append(s) for i in range(n-k): li.append(s+1) print(li)
p03612
s969416058
Accepted
N = int(input()) A = list(map(int, input().split())) res = 0 tmp = 0 for i, a in enumerate(A): if a == i + 1: tmp += 1 else: res += (tmp - 1) // 2 + 1 tmp = 0 res += (tmp - 1) // 2 + 1 print(res)
p03035
s539011753
Accepted
a,b=map(int,input().split()) if a>=13: print(b) elif 6<=a<=12: print(b//2) elif a<=5: print(0)
p02676
s276295562
Wrong Answer
import sys N = input() s = N[-1] if s in ['2','4','5','7','9']: print('hon') sys.exit(0) if s in ['0','1','6','8']: print('pon') sys.exit(0) if s == '3': print('bon')
p02699
s845572605
Accepted
s,w=map(int,input().split()) if s <= w:print("unsafe") else:print("safe")
p03637
s780674195
Accepted
import sys def I(): return int(sys.stdin.readline().rstrip()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) #空白あり N = I() a = LI() s,t = 0,0 # 4の倍数の個数、4の倍数でない偶数の個数 for i in range(N): if a[i] % 4 == 0: s += 1 elif a[i] % 2 == 0: t += 1 if s >= N//2 or t >= N-2*s: print('Yes') else: print('No')
p02971
s045953864
Accepted
n = int(input()) max_1 = 0 max_2 = 0 max_index = 0 for i in range(n): item = int(input()) if item >= max_1: max_1, max_2 = item, max_1 max_index = i elif item > max_2: max_2 = item for i in range(n): ans = max_2 if i == max_index else max_1 print(ans)
p03472
s679208180
Accepted
import bisect import math N, H = map(int, input().split()) A = [] B = [] for i in range(N): a, b = map(int, input().split()) A.append(a) B.append(b) am = max(A) B.sort() idx = bisect.bisect_right(B, am) ans = 0 for i in range(1, N-idx+1): H -= B[-i] ans += 1 if H <= 0: print(ans) exit() print(ans + math.ceil(H/am))
p02848
s545196868
Accepted
ordA = ord('A') N = int(input()) Ss = input().rstrip() anss = '' for S in Ss: S = ord(S) - ordA anss += chr(ordA + (S+N)%26) print(anss)
p02755
s315111250
Wrong Answer
a, b =map(int, input().split()) for x in range(0,10001): print('---') print(x) ax = (8*x)//100 bx = (10*x)//100 print(ax,bx) if ax == a and bx == b: print(x) break else: print(-1)
p02988
s828805869
Accepted
n=int(input()) p=list(map(int,input().split())) count=0 for i in range(1,n-1): if (p[i-1]<p[i] and p[i]<p[i+1]) or (p[i-1]>p[i] and p[i]>p[i+1]): count+=1 else: continue print(count)
p03681
s692648570
Accepted
n,m = map(int,input().split()) import math mod = 10**9+7 if abs(m-n) >= 2: print(0) elif abs(m-n) == 1: print((math.factorial(m)*math.factorial(n))%mod) else: print((2*math.factorial(m)*math.factorial(n))%mod)
p02791
s002360422
Accepted
n=int(input()) c=list(map(int,input().split())) minimum=100000000 count=0 for i in range(len(c)): if c[i]<minimum: minimum=c[i] if c[i]<=minimum: count+=1 print(count)
p02607
s271612287
Wrong Answer
N = int(input()) #1行目のNを取得する A = list(map(int,input().split())) result = 0 for i in range(N): if i % 2 == 1 and A[i] % 2 == 1: result += 1 print(result)
p02835
s396286355
Accepted
A = input() A = list(A.split()) sum = 0 for i in A: sum += int(i) if sum >= 22: print('bust') else: print('win')
p03211
s515562433
Accepted
import sys def input(): return sys.stdin.readline().rstrip() def main(): S = input() ans = 1000 for i in range(len(S) - 2): ans = min(ans, abs(753 - int(S[i:i+3]))) print(ans) if __name__ == '__main__': main()
p02547
s425077640
Wrong Answer
N = int(input()) x = [0] * N y = [0] * N for i in range(N): x[i], y[i] = map(int, input().split()) n = 0 for i in range(N-1): if x[i] == y[i]: n = n+1 elif n >=3: break else: n = 0 if n >= 3: print("Yes") else: print("No")
p03107
s606855929
Wrong Answer
s=input() a=0 b=0 for i in range(len(s)): if s[i]=="1": a+=1 else: b+=1 print(min(a,b)*2) print(a,b)
p03673
s624365599
Accepted
def solve(): n = int(input()) a = list(map(int, input().split())) b = a[1::2] c = a[::2] if len(a)%2 == 0: return b[::-1] + c else: return c[::-1] + b print(*solve())
p03041
s171409943
Accepted
N, K = map(int, input().split()) S = list(input()) S[K-1] = S[K-1].lower() print(''.join(S))
p02700
s046234632
Accepted
A, B, C, D = map(int, input().split()) while True: C -= B if C <= 0: print('Yes') exit() A -= D if A <= 0: print('No') exit()
p02595
s960956066
Accepted
N, D = map(int, input().split()) D = D * D A = 0 for _ in range(N): X, Y = map(int, input().split()) if X * X + Y * Y <= D: A += 1 print(A)
p02555
s385600464
Accepted
s = int(input()) mod = 10**9+7 def inv(x): y = 1 while x != 1: y *= mod //x + 1 y %= mod x -= mod % x return y #print(inv(5)) ans = 0 for l in range(1,1000000): if s - 3*l < 0: print(ans) exit() tmp = 1 for i in range(l-1): tmp *= s-2*l-1-i tmp *= inv(i+1) tmp %= mod #print(tmp) ans += tmp ans %= mod #print(tmp)
p03803
s807743904
Accepted
A, B = map(int, input().split()) if A == 1: A = 14 if B == 1: B = 14 if A > B: print("Alice") elif A < B: print("Bob") else: print("Draw")
p03210
s680911097
Accepted
# A - 753 X = int(input()) if X == 3 or X == 5 or X == 7: print('YES') else: print('NO')
p03241
s783153224
Accepted
import sys from collections import Counter from collections import deque import math def input(): return sys.stdin.readline().strip() def mp(): return map(int,input().split()) def lmp(): return list(map(int,input().split())) n,m=mp() for i in range(m//n,0,-1): s,a=divmod(m,i) if a%s==0: print(i) exit()
p03387
s950927309
Wrong Answer
A, B, C = sorted(list(map(int, input().split()))) print(A, B, C) r = C-B B += r A += r print(A, B, C) s = C-A if s % 2 == 0: s = s//2 else: s = (s//2) + 2 print(r+s)
p02583
s823861137
Accepted
import itertools N = int(input()) L = list(map(int, input().split())) cnt = 0 for i in itertools.combinations(L, 3): if i[0] != i[1] and i[0] != i[2] and i[2] != i[1]: if i[0] + i[1] > i[2] and i[1] + i[2] > i[0] and i[2] + i[0] > i[1]: cnt += 1 print(cnt)
p03150
s713644045
Accepted
s = input() rev_s = s[::-1] key = "keyence" label = [[key[:i], key[i:][::-1]] for i in range(len(key)+1)] flag = False for i, l in enumerate(label): if s[:i] == l[0] and rev_s[:len(l[1])] == l[1]: flag = True break print("YES" if flag else "NO")
p02688
s670928828
Wrong Answer
from collections import Counter N, K = map(int, input().split()) l = [] counter = 0 for k in range(K): d = int(input()) A = map(int, input().split()) l.extend(A) for i in range(1,K+1): if Counter(l)[i]==0: counter += 1 else: continue print(counter)
p03665
s881148403
Wrong Answer
N, P = map(int, input().split()) biscuits = list(map(int, input().split())) gu = 0 ki = 0 for i in range(N): if biscuits[i] % 2 == 0: gu += 1 else: ki += 1 if (P == 1 and ki == 0) or (P == 0 and gu == 0): print(0) elif gu == N: print(pow(2,N)) else: print(pow(2,N-1))
p03493
s952531220
Wrong Answer
x = str(input()) a =x[0] b=x[1] c=x[2] print(a+b+c)
p02963
s017271418
Accepted
S = int(input()) M = 10 ** 9 X3 = -S % M print(0, 0, M, 1, X3, (S + X3) // M)
p02802
s794466591
Wrong Answer
n,m = map(int,input().split()) ls = [] for i in range(m): p,m = map(str,input().split()) ls.append([p,m]) ac = 0 wa = 0 now = "" for i in ls: if now == i[0]: continue if i[1] == "AC": now = i[0] ac += 1 elif i[1] == "WA": wa += 1 print(ac,wa)
p02578
s530921030
Accepted
N = int( input() ) A = list( map( int, input().split() )) ret = 0 bafore = A[0] for a in A: if bafore > a: ret += bafore - a bafore = max( a, bafore ) print( ret )
p03673
s638990901
Accepted
n = int(input()) a = input().split() if n & 1: print(' '.join(a[::-2]+a[1::2])) else: print(' '.join(a[-1:0:-2]+a[::2]))
p03773
s267791364
Wrong Answer
a,b = map(int,input().split()) if a+b > 24: print((a+b)%24) else: print(a+b)
p03077
s132852492
Accepted
import math N = int(input()) T = [0] * 5 for i in range(5): T[i] = int(input()) ans = math.ceil(N / min(T)) + 4 print(ans)
p03475
s343655895
Accepted
N = int(input()) ans = [0 for i in range(N)] import math for i in range(N-1): c, s, f = map(int, input().split()) for j in range(i+1): if ans[j]>=s: x = math.ceil((ans[j]-s)/f) ans[j] = s+f*x+c else: ans[j] = s+c for i in range(N): print(ans[i])
p03493
s024372728
Wrong Answer
from sys import stdin list(stdin.readline()) [int(x) for x in list(stdin.readline())]