problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p02785
s677196251
Accepted
n, k = list(map(int, input().split())) h = list(map(int, input().split())) h.sort() h.reverse() if k == 0: print(sum(h)) else: print(sum(h[k:]))
p03359
s078449331
Accepted
a,b = map(int,input().split()) if a <= b: print(a) else: print(a-1)
p02765
s554315732
Accepted
n, r = map(int, input().split()) if n >= 10: print(r) else: print(r + 100 * (10 - n))
p03817
s339783414
Accepted
x = int(input()) n = x//11 k = x%11 if k==0: print(2*n) elif 1<=k<=6: print(2*n+1) else: print(2*(n+1))
p02675
s545748585
Accepted
n=int(input()[-1]) if n==3: res="bon" elif n in [0,1,6,8]: res="pon" else: res="hon" print(res)
p02690
s690534433
Accepted
N=int(input()) for i in range(-200,200): for j in range(-200,200): if i**5-j**5==N: a=i b=j print(a,b)
p02912
s492695684
Wrong Answer
N, M = map(int, input().split()) A = sorted(list(map(int, input().split())), reverse = True) for _ in range(0, M, 1): A[0] >>= 1 for i in range(1, len(A), 1): if A[i] < A[i - 1]: A[i], A[i - 1] = A[i - 1], A[i] else: break print(sum(A))
p02660
s410255288
Wrong Answer
import math def search_divide_minimum_number(n, check_list): num = n for i in range(2, int(math.sqrt(n))+1): if (n%i == 0)&(not i in check_list): num = i break return num if __name__ == "__main__": N = int(input()) check_list = [] while(N != 1): factor = search_divide_minimum_number(N, check_list) if not factor in check_list: check_list.append(factor) N //= factor print(len(check_list))
p02723
s174946939
Wrong Answer
##A s = input() if s[2] == s[3] and s[4] == s[5]: print("yes") else: print("No")
p03131
s657723446
Accepted
k, toayen, fromayen = map(int, input().split()) ans1 = k + 1 k -= (toayen - 1) d, m = divmod(k, 2) ans2 = (fromayen - toayen) * d + toayen + m print(max(ans1, ans2))
p03338
s043704638
Accepted
N = int(input()) S = list(input()) ans = 0 for i in range(N): A = S[:i] B = S[i:] C = list(set(A) & set(B)) #print(C) c = len(C) if c > ans: ans += 1 print(ans)
p03478
s034128154
Wrong Answer
N, A, B = map(int,input().split()) a = 0 for i in range(1,N+1): c = i//1000 + (i%1000)//100 + (i%100)//10 +i%10 if (A<= c) and (c <= B): a +=i print(a)
p02661
s009188874
Accepted
n = int(input()) list_a = [] list_b = [] for i in range(n): a,b = (int(x) for x in input().split()) list_a.append(a) list_b.append(b) list_a.sort() list_b.sort() if n%2==0: mi = (list_a[int(n/2)]+list_a[int(n/2)-1])/2 ma = (list_b[int(n/2)]+list_b[int(n/2)-1])/2 print(int((ma-mi)*2+1)) else: mi = list_a[int((n-1)/2)] ma = list_b[int((n-1)/2)] print(int(ma-mi+1))
p03723
s405162165
Wrong Answer
A, B, C = map(int, input().split()) if A == B == C: print(-1) else: ans = 0 while A%2 == B%2 == C%2 == 0: A, B, C = (B+C)//2, (C+A)//2, (A+B)//2 ans += 1 print(ans)
p03095
s326671355
Accepted
n = int(input()) s = input() mod = 10**9 + 7 ans = 0 cnt = [1] * 26 for i,ch in enumerate(s): tmp = 1 for j in range(26): if(j==(ord(ch) - 97)): continue tmp *= cnt[j] tmp %= mod ans += tmp ans %= mod cnt[ord(ch) - 97] += 1 print(ans)
p03693
s904830174
Wrong Answer
x,y,z = map(int,input().split()) y %= 4 if y == 0: if z % 4 ==0: print("YES") exit() if y == 1: if z % 4 == 2: print("Yes") exit() if y == 2: if z % 4 == 0: print("Yes") exit() if y == 3: if z % 4 == 2: print("Yes") exit() print("No")
p03860
s654663164
Accepted
from fractions import gcd from collections import Counter, deque, defaultdict from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort from itertools import accumulate, product, permutations, combinations def main(): A, s, C = input().split() print(A[0] + s[0] + C[0]) if __name__ == '__main__': main()
p04033
s945850947
Accepted
a, b = map(int,input().split()) if a > 0: print("Positive") elif a == 0: print("Zero") else: if b >= 0: print("Zero") else: if (b - a) % 2 != 0: print("Positive") else: print("Negative")
p03163
s362795578
Accepted
N, W = map(int, input().split()) wt, vt = [], [] for _ in range(N): w, v = map(int, input().split()) wt.append(w) vt.append(v) dp = [[0] * (W + 5) for _ in range(105)] for i in range(N): for j in range(W + 1): dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]) if 0 <= j - wt[i]: dp[i + 1][j] = max(dp[i + 1][j], dp[i][j - wt[i]] + vt[i]) # print(dp) print(dp[N][W])
p03773
s326744995
Accepted
a, b = map(int, input().split()) print((a + b) % 24)
p03162
s126300380
Accepted
import sys sample = sys.stdin.read().splitlines() N = int(sample[0]) points = [list(map(int, sample[current_day].split())) for current_day in range(1, N+1)] dp = points[0] ans = max(dp) for point in points[1:]: for idx, num in enumerate(point): point[idx] = point[idx]+max(dp[(idx+1)%len(point)], dp[(idx+2)%len(point)]) dp = point ans = max(ans, max(point)) print(ans)
p02814
s589620423
Accepted
N, M = map(int, input().split()) list_a = [int(x) for x in input().split()] import fractions def insu2(a) : insu = 0 while a%2 == 0 : insu += 1 a /= 2 return insu check = True for i in list_a : if insu2(i) != insu2(list_a[0]) : print(0) exit() ans_0 = list_a[0] for i in range(1,N) : ans_0 = ans_0 * list_a[i] // fractions.gcd(ans_0, list_a[i]) ans_0 //= 2 ans = M//ans_0 - M//(ans_0*2) print(ans)
p03220
s549019253
Accepted
n = int(input()) t,a = map(int,input().split()) h = list(map(int,input().split())) dif = 10**10 ans = 0 for i in range(n): z = t-h[i]*0.006 if dif>abs(a-z): dif = abs(a-z) ans = i+1 print(ans)
p02577
s626000609
Accepted
N=input() ans=0 for i in N: ans+=int(i) if ans%9==0: print('Yes') else: print('No')
p03493
s535382029
Accepted
s = input() a = [int(c) for c in s] b = 0 for i in a: if i == 1: b += 1 print(b)
p02924
s422008216
Wrong Answer
n=int(input()) print(-n+n*(n+1)/2)
p02642
s861721675
Accepted
def func(n, a): mx = max(a) x = [0] * (mx + 1) # len(x) for i in a: x[i] += 1 for i in range(1, mx + 1): if x[i] != 0: for j in range(2 * i, mx + 1, i): x[j] = 0 if x[i] > 1: x[i] = 0 print(sum(x)) # 31401 n = int(input()) a = list(map(int, input().split())) func(n, a)
p03695
s186348787
Accepted
n=int(input()) a=list(map(int,input().split())) ans=[0]*9 for i in range(n): if a[i]<400: ans[0]=1 elif a[i]<800: ans[1]=1 elif a[i]<1200: ans[2]=1 elif a[i]<1600: ans[3]=1 elif a[i]<2000: ans[4]=1 elif a[i]<2400: ans[5]=1 elif a[i]<2800: ans[6]=1 elif a[i]<3200: ans[7]=1 else: ans[8]+=1 print(max(sum(ans[:8]),1),sum(ans))
p03407
s489235161
Accepted
A, B, C = map(int, input().split()) if A+B < C: print("No") else: print("Yes")
p03719
s993521177
Wrong Answer
a, b, c = map(int, input().split()) if a<=c: if c>=c: print('Yes') else: print('No')
p03437
s534128723
Accepted
from sys import stdin import fractions def lcm(x, y): return (x * y) // fractions.gcd(x, y) n,m = [int(x) for x in stdin.readline().rstrip().split()] if lcm(n,m) == n: print(-1) else: print(n)
p02988
s085512968
Accepted
n=int(input()) p=list(map(int,input().split())) ans=0 for i in range(1,n-1): if p[i-1]<p[i]<p[i+1] or p[i+1]<p[i]<p[i-1]: ans+=1 print(ans)
p02859
s154312983
Accepted
print(int(input()) ** 2)
p03943
s632479983
Accepted
a,b,c=map(int,input().split()) d=max(a,b,c) if d==a: if d==b+c: print('Yes') else: print('No') elif d==b: if d==a+c: print('Yes') else: print('No') elif d==c: if d==a+b: print('Yes') else : print('No')
p03761
s494179710
Wrong Answer
from sys import stdin from sys import setrecursionlimit setrecursionlimit(10 ** 7) n = int(stdin.readline().rstrip()) s = [stdin.readline().rstrip() for _ in range(n)] li = list(s[0]) for i in s: for j in li: if j not in i: li.remove(j) li.sort() print("".join(li))
p02607
s073888399
Wrong Answer
N = int(input()) a = list(map(int, input().split())) cnt = 0 for i in range(N): if i % 2 == 1 and a[i] % 2 == 1: cnt += 1 print(cnt)
p03455
s027983146
Accepted
a, b = map(int, input().split()) if (a*b)%2 ==0: print('Even') else: print('Odd')
p02873
s723787745
Accepted
S = input() N = len(S) A = [0] * (N + 1) for i in range(N): if S[i] == '<': A[i + 1] = A[i] + 1 for i in range(N - 1, -1, -1): a = A[i + 1] + 1 if S[i] == '>' and a > A[i]: A[i] = a print(sum(A))
p02952
s052094555
Accepted
N = int(input()) ans = 0 for i in range(1, N + 1): if len(str(i)) % 2 == 1: ans += 1 print(ans)
p03951
s797205992
Accepted
n = int(input()) s = list(input()) t = list(input()) cnt = 0 for i in range(min(len(s), len(t))): c = 0 for j in range(i + 1): if s[len(s) - 1 - i + j] == t[j]: c += 1 cnt = max(cnt, c) ans = len(s) + len(t) - cnt if ans < n: ans = n print(ans)
p02657
s365761532
Accepted
a, b = map(int, input().split()) print(a * b)
p02723
s710449535
Accepted
s=input() if s[2] == s[3] and s[4] == s[5]: print("Yes") else: print("No")
p03555
s125986476
Wrong Answer
#入力例は合うがWAになる S = str(input()) T = str(input()) if S[0]==T[2] and S[1]==T[1] and S[2]==T[0]: print("Yes") else: print("No")
p03319
s289000163
Accepted
# https://atcoder.jp/contests/arc099/tasks/arc099_a n, k = map(int, input().split()) nums = [int(i) for i in input().split()] ans = (len(nums) - 1) // (k - 1) if (len(nums) - 1) % (k - 1) != 0: ans += 1 print(ans)
p02681
s463349224
Wrong Answer
# coding: utf-8 s1 = input() s2 = input() s2 = s2[-1] if s1 == s2: print("Yes") else: print("No")
p03352
s058637548
Wrong Answer
x = int(input()) ans = 1 for i in range(35): for j in range(15): if i**j > x: break else: ans = max(i**j,ans) print(ans)
p03061
s576819037
Accepted
n = int(input()) a = list(map(int,input().split())) def gcd(a, b): while b!=0: a,b=b,a%b return a l = [0] * (n + 1) r = [0] * (n + 1) for i in range(n): l[i + 1] = gcd(l[i], a[i]) for i in reversed(range(n)): r[i] = gcd(r[i + 1], a[i]) ans = 0 for i in range(n): ans = max(ans, gcd(l[i], r[i + 1])) print(ans)
p03852
s370359818
Accepted
c = (input()) list =['a','i','u','e','o'] if c in list: print('vowel') else: print('consonant')
p03062
s557924574
Wrong Answer
N = int(input()) A = list(map(int, input().split())) for i in range(len(A)-1): before = A[i] + A[i+1] after = -1*A[i] + (-1)*A[i+1] if A[i] >= 0: continue if A[i] < 0 and i != len(A)-1: A[i] *= -1 A[i+1] *= -1 continue if after >= before: A[i] *= -1 A[i+1] *= -1 print(sum(A))
p03206
s062538769
Accepted
D = int(input()) print('Christmas' + ' Eve'*(25-D))
p03264
s551853345
Accepted
k = int(input()) print(int((k/2)**2))
p02911
s563497767
Accepted
n, k, q = map(int, input().split()) sc = [k - q] * n for i in range(q): sc[int(input()) - 1] += 1 for j in sc: print('Yes' if j > 0 else 'No')
p02755
s829518406
Wrong Answer
A, B = map(int, input().split()) for i in range(1, 101): if (i * 0.08) // 1 == A and (i * 0.1) // 1 == B: print(i) exit(0) print(-1)
p03206
s348639412
Accepted
D = int(input()) print("Christmas" + " Eve"*(25-D))
p03997
s187663524
Accepted
a,b,h=[int(input()) for i in range(3)] print((a+b)*h//2)
p02786
s118515802
Accepted
H = int(input()) def attackNum(H): if H == 1: return 1 else: return 2 * attackNum(H // 2) + 1 print(attackNum(H))
p02582
s235563228
Accepted
S = input() prev = True ans = 0 cnt = 0 for i in range(3): if S[i] == 'R': if prev: cnt += 1 else: prev = True cnt = 1 else: ans = max(ans, cnt) cnt = 0 prev = False print(max(ans, cnt))
p03943
s268445142
Wrong Answer
s=list(map(int,input().split())) print('Yes' if sum(s)%2==0 else 'No')
p03475
s449940353
Accepted
import math n = int(input()) a = [list(map(int, input().split())) for _ in range(n-1)] for i in range(n-1): t = 0 for j in range(i, n-1): if a[j][1] >= t: t = a[j][1] else: t = math.ceil(t / a[j][2]) * a[j][2] t += a[j][0] print(t) print(0)
p03243
s755077416
Wrong Answer
import math def main(): n=int(input()) a=int(n/100) if a*100+a*10+a>n: print(a*100+a*10+a) else: print((a+1)*100+(a+1)*10+a+1) main()
p03062
s752263129
Accepted
def resolve(): N = int(input()) A = [0]+list(map(int, input().split())) dp = [[None for _ in range(2)] for _ in range(N+1)] dp[0][0] = 0 dp[0][1] = -float("inf") for i in range(1, N+1): dp[i][0] = max(dp[i-1][0]+A[i], dp[i-1][1]-A[i]) dp[i][1] = max(dp[i-1][0]-A[i], dp[i-1][1]+A[i]) print(dp[N][0]) if '__main__' == __name__: resolve()
p02847
s854712911
Wrong Answer
print(['MON','TUE','WED','THU','FRI','SAT','SUN'].index(input())+1)
p02572
s619398398
Accepted
n = int(input()) a = list(map(int,input().split())) h = sum(a) ans = 0 for i in range(n): h -= a[i] ans = (ans+a[i]*(h))%(10**9+7) print(ans)
p02708
s191982220
Accepted
n, k = map(int, input().split()) MOD = 1000000007 ans = 0 for i in range(k, n+2): maxNum = i * (2 * n - (i - 1)) / 2 minNum = i * (i - 1) / 2 ans += (maxNum - minNum + 1) % MOD print(int(ans) % MOD)
p02730
s409503939
Accepted
def main(): s = input() if s != s[::-1]: print('No') return a = s[:(len(s)-1)//2] if a != a[::-1]: print('No') return b = s[(len(s)+1)//2:] if b != b[::-1]: print('No') return print('Yes') return main()
p03059
s246155500
Accepted
a,b,t=map(int,input().split()) time = (t+0.5)//a ans =int( time * b) print(ans)
p03624
s337180673
Accepted
s=input() l=[chr(ord('a') + i) for i in range(26)] for i in l: if i not in s: print(i) break else: print("None")
p02994
s711344085
Wrong Answer
N, L = map(int, input().split()) taste = [L + i for i in range(N)] taste_abs = [abs(i) for i in taste] eat = min(taste_abs) print(sum(taste) - eat)
p03557
s612122557
Accepted
import bisect N = int(input()) A = sorted(list(map(int, input().split()))) B = sorted(list(map(int, input().split()))) C = sorted(list(map(int, input().split()))) count = 0 # ソートして for b in B: upeer_b = N - bisect.bisect_right(C, b) downer_b = bisect.bisect_left(A, b) count += upeer_b * downer_b # for c in C: # under_c = bisect.bisect_left(B, c) # for b in B[:under_c]: # under_b = bisect.bisect_left(A, b) # count += under_b print(count)
p02918
s399866418
Accepted
b=input().split() K=int(b[1]) a=input() count=0 for i in range(len(a)) : if i!=len(a)-1 and a[i]=='R' and a[i+1]=='R': count+=1 elif i!=0 and a[i]=='L' and a[i-1]=='L' : count+=1 for i in range(K) : count+=2 if count>=len(a)-1 : print(len(a)-1) else : print(count)
p03274
s669279195
Wrong Answer
N,K=map(int,input().split()) x=list(map(int,input().split())) ans=max(x)-min(x) for i in range(N-K+1): ans=min(ans,x[i+K-1]-x[i]+min(abs(x[i]),abs(x[i+K-1]))) # print(i,i+K-1,x[i],x[i+K-1],x[i+K-1]-x[i]+min(abs(x[i]),abs(x[i+K-1]))) if N==1: ans=x[0] print(ans)
p04034
s506585656
Accepted
n, m = map(int, input().split()) red = [0]*n ball = [1]*n red[0] = 1 for i in range(m): x, y = map(int, input().split()) if red[x-1] == 1: red[y-1] = 1 if ball[x-1] == 1: red[x-1] = 0 ball[y-1] += 1 ball[x-1] -= 1 print(sum(red))
p02957
s517275315
Wrong Answer
a , b = list(map(int,input().split())) if (a-b)%2 == 1: print("IMPOSSIBLE") else: print((a-b)//2)
p03059
s879264472
Accepted
import math a, b, t = map(int, input().split()) T = t + 0.5 times = math.floor(T / a) print(times*b)
p02994
s196862813
Accepted
n, l = map(int, input().split()) apples = [l + i for i in range(n)] x = 10 ** 9 y = 0 for apple in apples: if abs(apple) < x: x = abs(apple) y = apple print(sum(apples)-y)
p03645
s642216396
Accepted
N,M = map(int,input().split()) s = [] g = [] for i in range(M): a,b = map(int,input().split()) if a == 1: s.append(b) elif b == N: g.append(a) ans = set(s) & set(g) if len(ans) >= 1: print('POSSIBLE') else: print('IMPOSSIBLE')
p02994
s791038054
Wrong Answer
#ABC131 B N,L = map(int,input().split()) aji = [] delta = [] for i in range(N): aji.append(L + i) for j in range(N): delta.append(abs(aji[i])) print(sum(aji) - min(aji))
p03612
s508623442
Wrong Answer
a=input() a=list(map(int,input().split())) count=0 for itr in range(len(a)): if itr+1==a[itr]: count+=1 if count==0: print(0) else:print(count-1)
p03994
s912637301
Accepted
s = list(input()) K = int(input()) zp1 = 1+ord('z') for i in range(len(s)): si = s[i] cost = (zp1-ord(si))%26 if cost <= K: K -= cost s[i] = 'a' s[-1] = chr(ord('a') + (K + ord(s[-1]) - ord('a')) % 26) print(''.join(s))
p03632
s120017768
Wrong Answer
l = list(map(int,input().split())) l.sort() print(l[2]-l[1])
p02754
s234100055
Wrong Answer
N,A,B=map(int,input().split()) if A==0: print(0) elif N>=A+B: print(N-B) elif N<A+B and N<A: print(N) else: print(A)
p03274
s412724610
Accepted
n,k = map(int,input().split()) x = list(map(int,input().split())) ans = 10**10 for i in range(n-k+1): ans = min(ans, min(abs(x[i]), abs(x[i+k-1])) + x[i+k-1] - x[i]) print(ans)
p04043
s732312747
Accepted
import sys def input(): return sys.stdin.readline().strip() def main(): a, b, c = map(int, input().split()) if a == 5 and b == 5 and c == 7: print("YES") return if b == 5 and c == 5 and a == 7: print("YES") return if c == 5 and a == 5 and b == 7: print("YES") return print("NO") if __name__ == "__main__": main()
p03163
s670991081
Accepted
N,W = list(map(int,input().split())) DP = [[0]*(W+1) for i in range(N+1)] for i in range(1,N+1): w,v = list(map(int,input().split())) for j in range(W+1): DP[i][j] = max(DP[i-1][j],DP[i-1][j-w]+v) if w <= j else DP[i-1][j] print(max(DP[N]))
p03565
s543748000
Wrong Answer
S = input() T = input() L = len(S) K = len(T) ans = S flag = 0 for i in range(L-1,-1,-1): for j in range(K-1,-1,-1): a = K-1-j if i-a < 0 or (S[i-a] != "?" and S[i-a] != T[j]): break else: ans = ans[:i-K+1] + T + ans[i+K:] flag = 1 break if flag == 0: ans = "UNRESTORABLE" print(ans.replace("?","a"))
p02987
s192330310
Wrong Answer
s = list(input()) s = sorted(s) if s[0] == s[1] and s[2] == s[3] and s[0] != s[1]: print('Yes') else: print('No')
p02767
s007934961
Accepted
n=int(input()) x=list(map(int,input().split())) x=sorted(x) average=sum(x)//n ans=0 for i in x: ans+=(i-average)**2 ans1=0 for i in x: ans1+=(i-average-1)**2 print(min(ans,ans1))
p03699
s498778020
Accepted
n=int(input()) l,d=[],[] for i in range(n): x=int(input()) if(x%10==0): l.append(x) else: d.append(x) if(d==[]): print(0) else: s=sum(l)+sum(d) if(s%10==0): print(s-min(d)) else: print(s)
p02639
s033617953
Accepted
X = list(map(int,input().split())) for i in range(5): if X[i] == 0: print(i+1) break
p02982
s763012143
Accepted
import numpy as np n, d = map(int, input().split()) vector = [[0 for i in range(d)] for j in range(n)] for i in range(n): vector[i] = list(map(int, input().split())) cnt = 0 for i in range(n - 1): for j in range(i + 1,n): num = 0 for k in range(d): num += (vector[i][k] - vector[j][k])**2 * 1.0 if np.sqrt(num).is_integer(): cnt += 1 print(cnt)
p02909
s341401014
Wrong Answer
s=str(input()) if s=='S': print('C') elif s=='C': print('R') else: print('S')
p02971
s146965061
Accepted
n=int(input()) a=[int(input()) for i in range(n)] b=sorted(a) m=b[-1] c=b[-2] for i in range(0, n): if m == a[i]: print(c) else: print(m)
p02727
s750810803
Accepted
X, Y, A, B, C = list(map(int, input().split(" "))) p_list = sorted(list(map(int, input().split(" "))), reverse=True) q_list = sorted(list(map(int, input().split(" "))), reverse=True) c_list = sorted(list(map(int, input().split(" "))), reverse=True) p_list = p_list[:X] q_list = q_list[:Y] all_list = p_list+q_list+c_list all_list.sort(reverse=True) print(sum(all_list[0:X+Y]))
p02554
s930891173
Accepted
import sys readline = sys.stdin.readline sys.setrecursionlimit(10**8) mod = 10**9+7 #mod = 998244353 INF = 10**18 eps = 10**-7 n = int(readline()) ans = (pow(10, n, mod) - 2*pow(9, n, mod) + pow(8, n, mod))%mod print(ans)
p02618
s993775858
Wrong Answer
import random D = int(input()) c = list(map(int, input().split())) s = [list(map(int, input().split())) for i in range(D)] for i in range(D): rand = random.randrange(0, 26)
p02838
s356042842
Accepted
import numpy as np n = int(input()) s = np.array(input().split(), np.int64) mod = 10 ** 9 + 7 res = 0 po2 = 1 for i in range(61): bit = (s >> i) & 1 x = np.count_nonzero(bit) y = n - x res += x * y % mod * po2 res %= mod po2 *= 2 % mod print(res)
p03639
s914010396
Accepted
N = int(input()) a = list(map(int, input().split())) cnt_4 = 0 cnt_2 = 0 remaining_cnt_2 = 0 cnt_other = 0 for x in a: if x % 4 == 0: cnt_4 += 1 elif x % 2 == 0: cnt_2 += 1 else: cnt_other += 1 remaining_cnt_2 = cnt_2 % 2 if cnt_2 > 0: if cnt_4 >= cnt_other: print("Yes") else: print("No") else: if cnt_4 + 1 >= cnt_other: print("Yes") else: print("No")
p03854
s316572830
Accepted
s = list(input()) a = list("dream") b = list("dreamer") c = list("erase") d = list("eraser") flag = 0 while(flag == 0): if s[-7:] == b: del s[-7:] elif s[-6:] == d: del s[-6:] elif s[-5:] == a or s[-5:] == c: del s[-5:] elif s == []: print("YES") flag = 1 else: print("NO") flag = 1
p03455
s400156921
Accepted
from sys import stdin import math a,b=map(int,input().split()) if(a&1 and b&1): print("Odd") else: print("Even")
p02778
s928208025
Accepted
#!/usr/bin/env python3 import sys def solve(S: str): ans = ['x' for s in S] print(''.join(ans)) return # Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template) def main(): def iterate_tokens(): for line in sys.stdin: for word in line.split(): yield word tokens = iterate_tokens() S = next(tokens) # type: str solve(S) if __name__ == '__main__': main()