problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p02873
s707218904
Accepted
S=input() l=len(S) A=[0]*(l+1) B=[0]*(l+1) for i in range(l): if S[i]=='<': A[i+1]=A[i]+1 if S[l-i-1]=='>': B[l-i-1]=B[l-i]+1 print(sum([max(a,b) for a,b in zip(A,B)]))
p03815
s457194004
Accepted
x=int(input()) c=2*((x-1)//11) #print(c) y=x-11*c//2 #print(y) if y<=6: ans=c+1 else: ans=c+2 print(ans)
p02600
s164541782
Wrong Answer
print(9 - int(input())//200)
p02768
s043535825
Wrong Answer
n, a, b = map(int, input().split()) mod = 10**9 + 7 res = (2**n - 1) % mod def cmb(n, r, mod): r = min(n-r, r) if r == 0: return 1 over, under = 1, 1 for i in range(1, r+1): over = over * (n-i+1) % mod under = under * i % mod inv = pow(under, mod-2, mod) return over * inv % mod A = cmb(n, a, mod) B = cmb(n, b, mod) print((res - A - B - 1) % mod)
p03555
s152137823
Accepted
print("YES" if input()==input()[::-1] else "NO")
p02939
s469788045
Accepted
#その前のstrと違って、けど一番短いのを足していけばいいだけ。 S = input() L = [alphabet for alphabet in S] i = 0 k = 1 before = '' res = 0 while i+k <= len(L): if L[i:i+k] != before: res += 1 before = L[i:i+k] # "before" updated i = i+k #next a of L[a:b] k = 1 #initialised else: k += 1 print(res)
p02820
s624071259
Accepted
n, k = map(int, input().split()) r, s, p = map(int, input().split()) t_list = list(input()) towin = {"r": p, "s": r, "p": s} ans = 0 for i in range(n): if i < k: ans += towin[t_list[i]] else: if t_list[i - k] == t_list[i]: t_list[i] = "-1" else: ans += towin[t_list[i]] print(ans)
p02994
s510491955
Accepted
n,l=map(int, input().split()) aji = (l-1)*n + (n+1)*n/2 if l>=0: aji -= l else: if abs(l)<n: pass else: aji-= l-1+n print(int(aji))
p03434
s978396205
Wrong Answer
n=int(input()) a=list(map(int,input().split())) a.sort(reverse=True) Ali,Bob=0,0 for i in range(0,n-1,1): Ali +=a[i] Bob +=a[i+1] print(Ali-Bob)
p02571
s428080324
Wrong Answer
s = input() t = input() ls = len(s) lt = len(t) flag = False for i in range(lt): for j in range(i+1): a = i-j ss = s[j:ls-a] tt = t[j:lt-a] if tt in ss: flag = True break if flag: break if flag: print(i) else: print(lt)
p02947
s293016807
Accepted
import collections import math def combinations_count(n, r): return math.factorial(n)//(math.factorial(n-r)*math.factorial(r)) N = int(input()) s = [""]*N for i in range(N): s[i] = ','.join(sorted(input())) c = collections.Counter(s) ans = 0 for value in c.values(): if(value == 1): continue ans += combinations_count(value, 2) print(ans)
p03607
s376526453
Wrong Answer
ans = 0 n = int(input()) l = [int(input()) for _ in range(n)] l.sort() c = 1 for i in range(n-1): if l[i] == l[i+1]: c += 1 else: if c%2 != 0: ans += 1 c = 1 if l[-2] != l[-1]: ans += 1 print(ans)
p03639
s066584076
Accepted
N = int(input()) c1, c2, c4 = 0, 0, 0 a = list(map(int, input().split())) for i in a: if i % 4 == 0: c4 += 1 elif i % 2 == 0: c2 += 1 else: c1 += 1 if c2: print("Yes" if c4 >= c1 else "No") else: print("Yes" if c4 and c4 + 1 >= c1 else "No")
p03427
s886148771
Wrong Answer
n = list(input()) m = [int(n[i]) for i in range(1,len(n))] if set(m) == ["9"]: print(sum(m) + int(n[0])) elif m == []: print(n[0]) else: print(9*len(m) + int(n[0]) -1)
p02706
s112165391
Wrong Answer
a, b = list(map(int, input().split())) c = list(map(int, input().split())) print(a - sum(c))
p02640
s217801803
Wrong Answer
x,y = map(int,input().split()) for a in range(0,101): if 4*x-2*a==y: print('Yes') break else: print('No')
p02819
s607848367
Wrong Answer
import sys import math import itertools rl = sys.stdin.readline x = int(rl()) while True: if x == 2: print(2) break if x % 2: for i in range(3, 7//2, 2): if x % i == 0: break else: print(x) break x += 1
p02918
s529271213
Wrong Answer
n, k = map(int, input().split()) s = input() if n == 1: print(0) exit() two = 0 pre = s[0] cont = 1 ans = 0 for c in s[1:]: if c != pre: if c == s[0]: two += 1 ans += cont - 1 cont = 1 pre = c else: cont += 1 ans += cont - 1 if s[0] != s[-1]: ans += 1 print(ans + 2 * min(k, two))
p02952
s660707570
Wrong Answer
n=input() lenlen=len(n) if lenlen%2==0: res=0 for i in range(0,lenlen//2): res+=10**(2*i+1)-10**(2*i) else: res=0 for i in range(0,lenlen//2): res+=10*(2*i+1) res=res+int(n)-10**(lenlen-1) print(res)
p03407
s896427078
Accepted
a,b,c = map(int, input().split()) if a+b >= c: print('Yes') else: print('No')
p03433
s402665865
Accepted
n = int(input()) a = int(input()) if (n%500)<=a: print("Yes") else: print("No")
p02802
s229724833
Accepted
N, M = map(int, input().split()) Counted = [0 for _ in range(N)] num1 = 0 num2 = 0 subnum2 = [0 for l in range(N)] for j in range(M): p, S = input().split() p_ = int(p) if S == "AC" and Counted[p_ -1] == 0: num1 += 1 num2 += subnum2[p_ - 1] Counted[p_ -1] = 1 elif S == "WA" and Counted[p_-1] == 0: subnum2[p_ - 1] += 1 print("{} {}".format(num1, num2))
p03293
s602227726
Accepted
s = input() t = input() s += s if t in s: ans = 'Yes' else: ans = 'No' print(ans)
p03475
s673601110
Accepted
N = int(input()) CSF = [list(map(int, input().split())) for _ in range(N-1)] def F(n): time = 0 for i in range(n, N-1): c, s, f = CSF[i] if time <= s: time = s + c else: remainder = time % f time += (f-remainder)%f+c print(time) for i in range(N-1): F(i) print(0)
p02584
s805957901
Wrong Answer
X, K, D = map(int, input().split(" ")) X = abs(X) a = X // D b = X % D remain_count = K - a if remain_count < 0: ans = X - K * D else: if remain_count % 2 == 0: ans = min(b, abs(b - D)) else: ans = abs(b - D) print(ans)
p02646
s559058651
Accepted
a, v = map(int, input().split()) b, w = map(int, input().split()) t = int(input()) if v <= w: print("NO") elif a <= b: if a+v*t >= b+w*t: print("YES") else: print("NO") else: if a-v*t <= b-w*t: print("YES") else: print("NO")
p02743
s655034823
Accepted
a,b,c=input().split() a=int(a) b=int(b) c=int(c) d=c-(a+b) # print(d) if(d>0): l=4*a*b if(d*d>l): print("Yes") else: print("No") else: print("No")
p02665
s373810557
Accepted
n = int(input()) a = list(map(int, input().split())) sita_maxi = [0 for i in range(n+1)] sita_maxi[n] = a[n] for i in range(n-1, -1, -1): sita_maxi[i] = sita_maxi[i+1] + a[i] if a[0] > 1: print(-1) exit() lst = [1] for i in range(1, n+1): lst.append(min((lst[i-1]-a[i-1])*2, sita_maxi[i])) if lst[-1] < a[i]: print(-1) exit() print(sum(lst))
p02848
s798955245
Wrong Answer
n = int(input()) s = input() q = [chr(i) for i in range(65,65+26)] ans = [] for i in s: al = q.index(i) if al + n >= 26: al -= 26 print(q[al],end='')
p02641
s799182985
Accepted
x, n = map(int, input().split()) if n == 0: print(x) exit() P = set(map(int, input().split())) d_min = 1000 ans = 1000 for num in range(-1, 102): if num in P: continue d = abs(x-num) if d < d_min: d_min = d ans = num print(ans)
p03360
s257850588
Wrong Answer
a,b,c=list(map(int,input().split())) k=int(input()) m=max(a,b,c) s=sum([a,b,c])-m print(s,m) print(s+(m*2)*k)
p03481
s297938418
Wrong Answer
import sys input = sys.stdin.readline import math X,Y=map(int,input().strip().split()) print(1 + math.floor(math.log2(Y/X)))
p02546
s632320896
Wrong Answer
s = input() if s[-1] == "s": print(s[:-1]+"es") else: print(s+"s")
p03455
s097845098
Wrong Answer
a, b = map(int, input().split()) product = a * b print('even' if product % 2 == 0 else 'odd')
p04011
s275928683
Accepted
N=int(input()) K=int(input()) X=int(input()) Y=int(input()) if N>=K: print(X * K + (N - K) * Y) else: print(N*X)
p02972
s742473250
Accepted
n = int(input()) a= list(map(int, input().split())) s = [0]*n ans2 = [] for i in range(1, n+1): temp = sum(s[n-i::n+1-i]) if (temp % 2 == 0 and a[-i] == 1) or (temp % 2 == 1 and a[-i] == 0) : s[-i] = 1 ans2.append(str(n+1-i)) ans2.reverse() print(sum(s)) print(" ".join(ans2))
p02861
s468931017
Accepted
N = int(input()) x,y = [],[] for i in range(N): X,Y = [float(e) for e in input().split()] x.append(X) y.append(Y) import itertools ans = [] for order in itertools.permutations([i for i in range(N)]): r = 0.0 for i in range(1,N): r += ((x[order[i]]-x[order[i-1]])**2 + (y[order[i]]-y[order[i-1]])**2) ** 0.5 ans.append(r) import numpy as np print(np.mean(ans))
p02731
s928455611
Accepted
def fl(x): digits = 30 form = '%.'+str(digits-1)+'e' return float((form % x)) L=int(input()) print(fl((L*L*L/27)))
p03254
s108399508
Accepted
N, x = map(int, input().split()) a = list(map(int, input().split())) p = x a.sort() count = 0 for i in a: if x - i >= 0: x -= i count += 1 if x > 0 and count != 0 and p > sum(a): count -= 1 print(count)
p02600
s412387624
Accepted
x = int(input()) ans = 8 - (x - 400) // 200 if ans < 1: ans = 1 print(ans)
p03723
s902398463
Accepted
A, B, C = map(int, input().split()) def func(x): cnt = 0 while x % 2 == 0: x //= 2 cnt += 1 return cnt if A % 2 or B % 2 or C % 2: print(0) elif A == B == C: print(-1) else: m = min(func(A + B), func(B + C), func(C + A)) print(m)
p02881
s112743990
Accepted
N = int(input()) n = int((N ** (1/2))) + 1 ans = N for i in range(1, n): if N % i == 0: ans = min(i + N//i - 2, ans) print(ans)
p02689
s442031355
Accepted
N,M=map(int,input().split()) H=list(map(int,input().split())) good=[1 for _ in range(N)] for i in range(M): A,B=map(int,input().split()) if H[A-1]==H[B-1]: good[A-1]=0 good[B-1]=0 elif H[A-1]>H[B-1]: good[B-1]=0 else: good[A-1]=0 print(sum(good))
p02706
s011282007
Accepted
N,M=map(int,input().split()) A=list(map(int,input().split())) if sum(A)>N: print(-1) else: print(N-sum(A))
p03137
s149962055
Wrong Answer
n, m = map(int, input().split()) x = sorted(list(map(int, input().split()))) d = [] if m==1: print(0) elif n>=m: print(1) elif n<m: for i in range(m-1): d.append(x[i+1] - x[i]) print(sum(sorted(d)[:m-n]))
p02801
s336031591
Accepted
C = input() ans = (chr(ord(C)+1)) print(ans)
p02802
s258227151
Wrong Answer
N, M = map(int, input().split()) ac = [0]*N wa = [0]*N for m in range(M): p, s = input().split() p = int(p) - 1 if s == 'AC' and ac[p] == 0: ac[p] += 1 elif s == 'WA' and wa[p] == 0: wa[p] += 1 print(ac.count(1), wa.count(1))
p03000
s859033782
Accepted
arr1 = input().split() n,x = int(arr1[0]),int(arr1[1]) arr2 = input().split() d = 0 count = 1 for i in range(1, n + 1): d += int(arr2[i-1]) if d <= x: count +=1 print(count)
p03779
s249923016
Accepted
x=int(input()) for i in range(1,10**5): if x<=(i*(i+1))//2: print(i) break
p02772
s272004177
Wrong Answer
N=int(input()) c=list(map(int,input().split())) flag=0 for i in range(N): if c[i]%2==0: if c[i]%3==0 or c[i]%5==0: flag=1 else: flag=0 print("DENIED") exit(0) if flag==1: print("APPROVED") else: print("DENIED")
p03042
s706509786
Accepted
s = input() y = int(s[:2]) m = int(s[2:]) if 1 <= y <= 12 and 1 <= m <= 12: print("AMBIGUOUS") elif 1 <= y <= 12: print("MMYY") elif 1 <= m <= 12: print("YYMM") else: print("NA")
p02727
s616396120
Accepted
import heapq X, Y, A, B, C = map(int, input().split()) P = list(map(int, input().split())) Q = list(map(int, input().split())) R = list(map(int, input().split())) P.sort(reverse=True) Q.sort(reverse=True) P = sorted(P[:X]) Q = sorted(Q[:Y]) R.sort() while R and (P[0] < R[-1] or Q[0] < R[-1]): if P[0] < Q[0]: heapq.heappush(P, R.pop()) heapq.heappop(P) else: heapq.heappush(Q, R.pop()) heapq.heappop(Q) print(sum(P) + sum(Q))
p03359
s631266504
Accepted
a,b=map(int,input().split()) if a>b: print(a-1) else: print(a)
p03854
s157369480
Wrong Answer
s = input() while s!="": if s[-5:]=="dream" or s[-5:]=="erase": s = s[:-5] elif s[-6:]=="dreamer" or s[-6:]=="eraser": s = s[:-6] else: print("NO") exit() print("YES")
p03478
s110939660
Accepted
n, a, b = map(int, input().split()) cnt = 0 for i in range(1, n+1): if a <= sum(list(map(int, list(str(i))))) <= b: cnt += i print(cnt)
p02753
s096429135
Accepted
def main(): S = input() if "A" in S and "B" in S: print("Yes") else: print("No") if __name__ == "__main__": main()
p02743
s277662934
Accepted
import math a,b,c=map(int,input().split()) eps = 0.00000000000001 if 4*a*b<(c-a-b)**2 and (c-a-b)>0: print('Yes') else: print('No')
p03796
s028527421
Accepted
import math print(math.factorial(int(input())) % (10**9 + 7))
p02646
s874116775
Accepted
a, v = map(int, input().split()) b, w = map(int, input().split()) t = int(input()) if v <= w: print('NO') else: diff_start = abs(b - a) diff_speed = v - w if diff_start <= diff_speed*t: print("YES") else: print("NO")
p03281
s637266146
Wrong Answer
n = int(input()) if n < 105: print(0) elif 105 <= n < 195: print(1) else: print(2)
p02818
s083956239
Accepted
inputted = list(map(int, input().split())) A = inputted[0] B = inputted[1] K = inputted[2] A2 = max([0, A - K]) B2 = max([0, B - max([0, K - A])]) answer = '{} {}'.format(A2, B2) print(answer)
p02854
s603712836
Wrong Answer
from sys import stdin n = int(stdin.readline().strip()) a_lst = [int(x) for x in stdin.readline().strip().split()] pos = len(a_lst) // 2 min_diff = 20202020201 while(True): left = sum(a_lst[:pos]) right = sum(a_lst[pos:]) diff = right - left if min_diff > abs(diff): min_diff = abs(diff) else: break if diff > 0: pos += 1 elif diff < 0: pos -= 1 print(min_diff)
p03773
s809884281
Wrong Answer
a, b = map(int, input().split()) print((a+b)//24)
p03524
s669327381
Accepted
from collections import Counter S = input() N = len(S) c = Counter(S) def checkf(c1,c2,c3): return (c[c1] == c[c2] and c[c2] == c[c3]) or (c[c1] == c[c2] and c[c2] == c[c3]+1) or (c[c1] == c[c2]+1 and c[c2] == c[c3]) flg = checkf('a','b','c') or checkf('a','c','b') or checkf('b','a','c') or checkf('b','c','a') or checkf('c','a','b') or checkf('c','b','a') print("YES" if flg else "NO")
p02694
s297507432
Accepted
X=input() n=100 for i in range(1,4000): n=int(n*1.01) if X<=n: print i quit()
p03657
s852895897
Wrong Answer
a,b = map(int,input().split()) if (a%3 == 0 and b%3==0) or ((a+b)%3 == 0): print('Possible') else: print('Impossible')
p02641
s529558715
Accepted
x,n=map(int,input().split()) a=list(map(int,input().split())) if n==0: ans=x else: ans=0 for i in range(101): y=x-i if y not in a: ans=y break z=x+i if z not in a: ans=z break print(ans)
p03043
s086588262
Wrong Answer
N, K = map(int, input().split()) ans = 0 for i in range(1, N+1): now = i mul = 0 while now <= K: now *= 2 mul += 1 ans += (1/N)*(1+0.5**mul) print(ans-1)
p03035
s092573815
Wrong Answer
a,b=map(int,input().split()) if a>12:print(b) elif 4<a<13:print(b/2) else:print(0)
p02577
s164175342
Wrong Answer
N =int(input()) lst = [] while N > 0: lst.append(N%10) N //= 10 lst.reverse() ans = sum(lst) if ans % 9 == 0: print("yes") else: print("No")
p03472
s357401744
Wrong Answer
import math N,M=(int(x) for x in input().split()) a=[0]*(N+1) b=[0]*(N+1) c=0 v=0 i=0 for i in range(N): A,B=(int(x) for x in input().split()) a[i]=A b[i]=B v = max(a) #ソート開始 b.sort(reverse=True) #ソート終了 #print(i,b[i],v,M,N) i=0 for i in b: if i>=v: c+=1 M-=i else:break if M>0: c+=math.ceil(M/v) print(c)
p02697
s694297517
Accepted
N,M=[int(s) for s in input().split()] if N%2==1: a=1 b=N-1 for i in range(M): print(*[a,b]) a+=1 b-=1 else: x=(N+2)//4 a=1 b=N-1 for i in range(min([M,x-1])): print(*[a,b]) a+=1 b-=1 a+=1 for i in range(min([M-x+1,N//2-x])): print(*[a,b]) a+=1 b-=1
p03838
s645945993
Accepted
x, y = map(int, input().split()) ans = 0 x2 = -x y2 = -y L = [y - x, y - x2, y2 - x, y2 - x2] Labs = [abs(y - x), abs(y - x2), abs(y2 - x), abs(y2 - x2)] ans += min(Labs) i = L.index(min(Labs)) if i == 1 or i == 2: ans += 1 elif i == 3: ans += 2 print(ans)
p02866
s966231652
Accepted
def resolve(): ''' code here ''' import collections N = int(input()) D = [int(item) for item in input().split()] d_dict = collections.Counter(D) cnt = 0 if D[0] != 0: pass else: cnt = 1 for i in D[1:]: cnt *= d_dict[i-1] cnt %= 998244353 print(cnt % 998244353) if __name__ == "__main__": resolve()
p03860
s197637786
Accepted
a,b,c=map(str,input().split()) print(a[0]+b[0]+c[0])
p03331
s211707911
Accepted
import math N = int(input()) n = N amari = 0 for i in range (len(str(N))): amari += n % 10 n = math.floor(n / 10) if amari == 1: print(10) else: print(amari)
p02783
s700635435
Accepted
import math h,a = map(int,input().split()) print(math.ceil(h/a))
p03838
s865375612
Accepted
x, y = map(int, input().split()) ans = 10**9 + 10 if x == y: ans = 0 else: #1 ans1 = y-x ans2 = (-y)-(-x) + 2 ans3 = y-(-x) + 1 ans4 = (-y)-x + 1 if ans1 > 0: ans = min(ans, ans1) if ans2 > 0: ans = min(ans, ans2) if ans3 > 0: ans = min(ans, ans3) if ans4 > 0: ans = min(ans, ans4) print(ans)
p02989
s217080383
Wrong Answer
N = int(input()) d = list(map(int, input().split())) d = sorted(d) cnt = 0 for i in range(d[0], d[N-1]): if d[N//2-1] < i <= d[N//2]: cnt += 1 print(cnt)
p02982
s689397712
Accepted
n, d = map(int, input().split()) x = [] for i in range(n): x.append(list(map(int, input().split()))) ans = 0 for i in range(n - 1): for j in range(i + 1, n): s = 0 for k in range(d): s += (x[i][k] - x[j][k]) ** 2 s **= 0.5 if s.is_integer() == True: ans += 1 print(ans)
p02657
s367910346
Wrong Answer
import time time.sleep(1)
p02661
s022537171
Wrong Answer
# Count median N=int(input()) m=[] M=[] for i in range(N): x,y=map(int,input().split()) m.append(x) M.append(y) m.sort() M.sort(reverse=True) if N%2!=0: mini=m[N//2] maxi=M[-N//2] print(maxi-mini+1) else: mini=m[N//2-1] maxi=M[-N//2] print((maxi-mini)*2+1)
p02959
s006278933
Accepted
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # 問題:https://atcoder.jp/contests/abc135/tasks/abc135_c n = int(input()) a = list(map(int, input().strip().split())) b = list(map(int, input().strip().split())) f1 = min(a[0], b[0]) f2 = min(a[1], b[0] - f1) res = f1 + f2 for i in range(1, n): f1 = min(a[i] - f2, b[i]) f2 = min(a[i+1], b[i] - f1) res += f1 + f2 print(res)
p03351
s289808114
Accepted
a, b, c, d = (int (i) for i in input().split()) if abs(a - c) <= d: print("Yes") elif (abs(a - b) <= d) and (abs(b - c) <= d): print("Yes") else: print("No")
p03345
s432014822
Accepted
a,b,c,k=map(int,input().split()) if k%2==0: ans=a-b else: ans=b-a print(ans)
p03252
s717838590
Wrong Answer
s = input() T = input() dc = {} for i, t in enumerate(T): if t in dc and dc[t] != s[i]: print("No") exit() else: dc[t] = s[i] else: print("Yes")
p02793
s219278853
Accepted
import fractions from functools import reduce def lcm(a, b): return (a * b) // fractions.gcd(a, b) def lcm_list(n): return reduce(lcm, n) n = int(input()) a = list(map(int, input().split())) mod = 10 ** 9 + 7 L = lcm_list(a) ans = 0 for i in a: ans += L // i print(ans % mod)
p02630
s634804107
Wrong Answer
from sys import stdin N = int(stdin.readline().rstrip()) list = [int(x) for x in stdin.readline().rstrip().split()] Q = int(stdin.readline().rstrip()) #print(1 in list) for i in range(Q): s, t = [int(x) for x in stdin.readline().rstrip().split()] if s in list: sum = 0 for j in range(len(list)): if list[j] == s: list[j] = t sum += list[j] print(sum)
p03478
s834478821
Accepted
X,A,B=input().split() numbers=[] N=int(X) def digitsum(n): s=str(n) array=list(map(int,s)) return sum(array) for num in range(1,N+1): if int(A)<=int(digitsum(num)) and int(digitsum(num))<=int(B): numbers.append(num) else: continue print(sum(numbers))
p03206
s082366992
Accepted
d=int(input()) if d==25: print('Christmas') elif d==24: print('Christmas Eve') elif d==23: print('Christmas Eve Eve') else: print('Christmas Eve Eve Eve')
p03633
s717108711
Wrong Answer
import math N = int(input()) T = [int(input()) for i in range(N)] num = 1 for i in range(N - 1): cnt = (T[i] * T[i+1]) // math.gcd(T[i], T[i+1]) num = (num * cnt) // math.gcd(num, cnt) print(num)
p03323
s823980461
Wrong Answer
d, n = map(int, input().split()) print(n * 100 ** d) if n < 100 else print((n + 1) * 100 **d)
p03377
s199784020
Accepted
A, B, X = map(int, input().split()) print("YES" if 0 <= X-A <= B else "NO")
p03998
s985310947
Wrong Answer
input = open(0).readline s = {} s['A'] = list(input().strip()) s['B'] = list(input().strip()) s['C'] = list(input().strip()) play_order = {'A':'B', 'B':'C', 'C':'A'} def play(player): if len(s[player]) == []: play(play_order[player]) next_play = s[player].pop() if len(s[player]) == 0: print(player) return player #print(next_play) play(next_play.upper()) play('A')
p03605
s713586270
Wrong Answer
if input() in '9': print('Yes') else:print('No')
p03456
s212227714
Accepted
a,b = input().split() ab = int(a+b) for i in range(int(ab//(1/2))+1): if i * i == ab: print("Yes") exit() print("No")
p03251
s818094400
Wrong Answer
N, M, X, Y = map(int, input().split()) x = sorted(list(map(int, input().split()))) y = sorted(list(map(int, input().split()))) flag = True if y[0] < x[-1]: flag = False if flag: print("No War") else: print("War")
p02842
s618601992
Accepted
n=int(input()) x=int(n/1.08) if int(x*1.08)==n: print(x) elif int((x+1)*1.08)==n: print(x+1) else: print(':(')
p02628
s734145601
Accepted
n,k=map(int,input().split()) p=list(map(int,input().split())) P=sorted(p) l=[] cnt=0 for i in P: cnt+=1 l.append(i) if cnt==k: break print(sum(l))
p02983
s742790395
Accepted
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines L, R = map(int, readline().split()) t1 = L - (L // 2019) * 2019 t2 = R - (L // 2019) * 2019 temp = 0 min_temp = 2019 if R - L >= 2019: print("0") else: for i in range(t1, t2): for j in range(i + 1, t2 + 1): temp = (i * j) % 2019 if temp < min_temp: min_temp = temp print(min_temp)