problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p02793
s468983813
Accepted
from fractions import gcd MOD = 10 ** 9 + 7 N = int(input()) A = list(map(int, input().split())) A.sort(reverse=True) lcm = A[0] for a in A: lcm = (lcm * a) // gcd(lcm, a) ans = 0 for a in A: ans += (lcm % MOD) * pow(a, MOD - 2, MOD) ans %= MOD print(ans)
p03416
s738808088
Wrong Answer
a, b = map(int, input().split()) cnt = 0 for i in range(a, b): r = ''.join(list(reversed(str(i)))) if i == int(r): cnt += 1 print(cnt)
p02912
s378353386
Wrong Answer
import bisect import math N,M=map(int,input().split()) A=list(map(int,input().split())) A.sort() logof2=[0]*N mi=0 buf=0 #print(A) for i in range(N): logof2[i]=math.log(A[i],2) #print(logof2) for i in range(M): if logof2[N-1]<0: break else: buf=logof2.pop(N-1) buf=buf-1 bisect.insort(logof2,buf) #print(logof2) for i in range(N): mi=mi+math.floor(pow(2,logof2[i])) print(mi)
p02786
s005509097
Wrong Answer
import math print(2**(math.ceil(math.log(float(input()),2)))-1)
p03767
s696863237
Accepted
N = int(input()) A = list(map(int,input().split())) A.sort(reverse=True) print(sum(A[1:2*N:2]))
p02691
s427781480
Wrong Answer
from collections import defaultdict n = int(input()) a = list(map(int,input().split())) cnt = 0 d = defaultdict(int) for key in a: d[key] += 1 for i in range(n): cnt += d[i-a[i]] d[i + a[i]] += 1 print(cnt)
p02935
s112576493
Accepted
N = int(input()) v = list(map(int, input().split())) V = sorted(v, reverse=True) A = 0 while N > 1: v1 = V.pop() v2 = V.pop() A = (v1 + v2)/2 V.append(A) N -= 1 print(V[0])
p03417
s229740852
Accepted
n, m = map(int, input().split()) n = abs(n - 2) m = abs(m - 2) print(n * m)
p03795
s764050705
Wrong Answer
n = int(input()) print(n*800-n/15*200)
p03665
s374927318
Accepted
N, P = map(int,input().split()) A = list(map(int,input().split())) dp = [[0,0] for k in range(N+1)] dp[0][0] = 1 for k in range(N): if A[k]%2 == 0: dp[k+1][0] = dp[k][0]*2 dp[k+1][1] = dp[k][1]*2 else: dp[k+1][0] = dp[k][0] + dp[k][1] dp[k+1][1] = dp[k][1] + dp[k][0] print(dp[N][P])
p03285
s336304732
Accepted
import math N=int(input()) POS=False for i in range(math.floor(N/7)+1): if (N-7*i)%4==0: POS = True if POS: print('Yes') else: print('No')
p02641
s346254539
Wrong Answer
x, n = map(int, input().split()) p = list(map(int, input().split())) if n == 0: print(x) exit() Flag = True i = 1 while Flag: if x - i not in p: print(x - i) break elif x + i not in p: print(x + i) break i += 1
p02879
s804348536
Accepted
a,b=map(int,input().split()) if a>=10 or b>=10: print(-1) else: print(a*b)
p02958
s863016170
Accepted
input() s = list(map(int,input().split())) t = sorted(s) if s==t: print('YES') else: ans = sum(1 for i,j in zip(s,t) if i!=j) print('NO' if ans>2 else 'YES')
p02957
s438289762
Accepted
a,b=list(map(int,input().split())) if a==b: print(0) else: if (a+b)%2==0: print((a+b)//2) else: print("IMPOSSIBLE")
p03854
s135187174
Wrong Answer
s = input().replace('eraser','').replace('dreamer','').replace('erase','').replace('dream','') print('YES' if s=='' else 'NO')
p03030
s828075128
Wrong Answer
n=int(input()) A = [list(map(str,input().split())) for i in range(n)] A_s = sorted(A, key=lambda x: x[1], reverse=True) A_ss = sorted(A_s, key=lambda x: x[0], reverse=False) for i in range(n): print(A.index( A_ss[i])+1)
p02552
s294861428
Wrong Answer
X = input().split() if X == 1: print(0) else: print(1)
p03338
s593507596
Wrong Answer
N=int(input()) S=str(input()) letters = "abcdefghijklmnopqrstuvwxyz" max_num=0 for i in range(1,len(letters)): S1 = S[0:i] S2 = S[i:N] count = 0 for k in range(26): n1 = len([1 for x in S1 if x==letters[k]]) n2 = len([1 for x in S2 if x==letters[k]]) if n1>0 and n2>0: count = count + 1 if max_num < count: max_num = count print(max_num)
p03331
s825114110
Accepted
def getter(i): res=0 while True: res+=i%10 i//=10 if i==0: break return res n=int(input()) digit=0 hoge=n while True: hoge//=10 if hoge==0: break digit+=1 a=10**digit if n-a>0: res=1+getter(n-a) print(res) exit() else: print("10")
p02972
s554310103
Wrong Answer
n = int(input()) array = [int(x) for x in input().split()] ans = [0 for x in range(n)] res = [] count = 0 for i in reversed(range(n)): a = array[i] if a == 1 and sum([x for x in ans[i::i+1]]) % 2 == 0: ans[i] = 1 count += 1 res.append(str(a)) elif a == 0 and sum([x for x in ans[i::i+1]]) % 2 == 1: ans[i] = 1 count += 1 res.append(str(a)) print(count) print(" ".join(res))
p04005
s425090001
Wrong Answer
x=input().split() dim=[int(x[0]),int(x[1]),int(x[2])] print(dim) if (dim[0]*dim[1]*dim[2])%2==0: print(0) else: dim.remove(max(dim)) print(dim[0]*dim[1])
p03721
s998681322
Accepted
n, k = map(int, input().split()) ab = [0] * n cnt = [0] * 100001 for i in range(n): a, b = map(int, input().split()) cnt[a] += b ans = 0 for num in range(1, 100002): ans += cnt[num] if ans >= k: print(num) break
p03803
s478334128
Wrong Answer
a,b=map(int,raw_input().split()) if a==b: print "Draw" elif a==1 or a>b: print "Alice" else: print "Bob"
p02690
s507799425
Accepted
X = int(input()) for a in range(-1000, 1001): A = a ** 5 for b in range(-1000, 1000): B = b ** 5 if A - B == X: print(a, b) exit() print(-1, -1)
p03795
s262882358
Accepted
N = int(input()) print(800*N -200*(N//15))
p03328
s026425906
Accepted
a,b=map(int,input().split()) diff = b-a tall = sum([i for i in range(1, diff+1)]) print(tall-b)
p03281
s323556770
Accepted
n = int(input()) ans = 0 for i in range(1, n+1): if i%2 == 0: continue cnt = 0 for j in range(1, i+1): if i%j == 0: cnt += 1 if cnt == 8: ans += 1 print(ans)
p02714
s379679828
Accepted
import itertools N = int(input()) S = input() out = S.count('R') * S.count('G') * S.count('B') RGBs = list(itertools.permutations(['R', 'G', 'B'], 3)) for i in range(1, N): for j in range(N-i*2): if (S[j], S[j+i], S[j+i*2]) in RGBs: out -= 1 print(out)
p02775
s122472167
Accepted
def main(): s = input() dp = [0, 1] for c in s: x = int(c) a = dp[0] + x if a > dp[1] + 10 - x: a = dp[1] + 10 - x b = dp[0] + x + 1 if b > dp[1] + 10 - x - 1: b = dp[1] + 10 - x - 1 dp[0] = a dp[1] = b dp[1] += 1 print(min(dp)) if __name__ == "__main__": main()
p03680
s389925747
Accepted
n = int(input()) a = [int(input()) for _ in range(n)] button = 1 for i in range(n): button = a[button - 1] if button == 2: print(i + 1) exit(0) print(-1)
p03720
s584345368
Wrong Answer
N, M = input().split(' ') N = int(N) M = int(M) citys = [] for i in range(M): a, b = input().split(' ') a = int(a) b = int(b) citys.append(a) citys.append(b) print(citys) for i in range(1, N+1): print(citys.count(i))
p02665
s083684816
Wrong Answer
print(-1)
p03338
s954687872
Wrong Answer
N,S=int(input()),input() ans=0 for i in range(N): a=S[:i+1];b=S[i:] c=0;l=[] for j in range(i+1): if a[j] in b and (not a[j] in l):c+=1;l.append(a[j]) ans=max(ans,c) print(ans)
p03485
s397635391
Wrong Answer
a, b = map(int, input().split()) print((a+b)//2)
p03835
s866359556
Accepted
k, s = map(int,input().split()) ans = 0 for x in range(k+1): for y in range(k+1): z = s - x - y if z <= k and z >= 0 : ans += 1 print(ans)
p03471
s237936152
Accepted
n,y=map(int,input().split()) for i in range(n+1): for j in range(n+1-i): c=n-i-j if y==i*10000+j*5000+c*1000: print(i,j,c) exit() print(-1,-1,-1)
p02677
s592740695
Wrong Answer
import math a,b,h,m=map(int,input().split()) t=abs(h/12-m/60) print((a**2+b**2+2*a*b*math.cos(2*math.pi*t))**0.5)
p02888
s065044577
Wrong Answer
import numpy as np N = int(input()) L = sorted([int(i) for i in input().split()], reverse=True) L = np.array(L) ans = 0 for i in range(N-2): for j in range(i+1, N-1): min_c = np.count_nonzero(L[j] > L[j+1:]) max_c = np.count_nonzero(L[i] - L[j] >= L[j+1:]) ans += min_c - max_c print(ans)
p03773
s214879958
Accepted
x, y= list(map(int, input().split())) #a,b,c = list(input().split()) if x+y < 24: print(x+y) else: print(x+y-24)
p03665
s699264324
Wrong Answer
n, p = map(int, input().split()) a = list(map(int, input().split())) jug = True for i in range(n): a[i] % 2 == 1 jug = False break if jug: if p == 0: print(2 ** n) else: print(0) else: print(2 ** (n - 1))
p03723
s088401741
Accepted
A,B,C = list(map(int, input().split())) count=0 while True: if A%2 ==1or B%2 ==1 or C%2 ==1: print(count) break elif A==B and B==C and C==A: print(-1) break elif A%2==0 and B%2==0 and C%2 == 0: A2 = 0.5*A B2 = 0.5*B C2 = 0.5*C A = B2+C2 B = C2+A2 C = A2+B2 count=count+1
p02973
s456522465
Wrong Answer
def main(): N = int(input()) A = [] c = 1 m = int(input()) for _ in range(N-1): a = int(input()) if a <= m: m = a c += 1 print(c) main()
p03852
s880077161
Accepted
c=input() print("vowel" if c in "aiueo" else "consonant")
p03062
s929820117
Wrong Answer
n=int(input()) a=list(map(int,input().split())) zr = 0 for i in range(n-1): if (a[i] <= 0 and a[i+1]>=0 and abs(a[i]) >= abs(a[i+1])) or (a[i]<0 and a[i+1]<0): a[i] *=-1 a[i+1] *=-1 print(sum(a))
p03803
s168582857
Wrong Answer
x = input() # x = x.replace(1,14) # replaceは,文字列しか使えない. ls_x = x.split() # xに入力した文字列たちを整数化 for i in range(len(ls_x)): ls_x[i] = int(ls_x[i]) print(ls_x) if ls_x[0] == ls_x[1]: print("Draw") if ls_x[0] == 1: print("Alice") elif ls_x[1] == 1: print("Bob") elif ls_x[0] > ls_x[1]: print("Alice") elif ls_x[0] < ls_x[1]: print("Bob")
p03471
s797034741
Wrong Answer
n,y = map(int,input().split()) ans = '-1 -1 -1' for i in range(n+1): for j in range(n+1-i): #for k in range(n+1-i-j): d = y - (i * 10000 + j * 5000) if d >= 0 and d % 1000 == 0 and d//1000 <= n - i - j: ans = '{} {} {}'.format(i,j,d//1000) break print(ans)
p03778
s558358776
Accepted
W,a,b = map(int,input().split()) if a+W<b: print(b-a-W) elif a<=b<=a+W or a<=b+W<=a+W: print(0) else: print(a-b-W)
p02771
s924199288
Wrong Answer
A, B, C = map(int, input().split()) if((A != B != C) and (A == B == C)): print("No") else: print("Yes")
p03359
s266313610
Accepted
a,b = map(int,input().split()) if a <= b: print(a) else: print(a-1)
p02946
s747598422
Wrong Answer
K,X =map(int,input().split()) l = [] for i in range(X-K+1,X+K): l.append(str(i)) ##print(l) print(",".join(l))
p03544
s243203725
Wrong Answer
lu = [2, 1] x = int(input()) for i in range(2, x): lu.append(lu[i-1] + lu[i - 2]) print(lu[x-1])
p03852
s038014633
Accepted
c=input() if c in "aiueo": print("vowel") else: print("consonant")
p03360
s072563037
Accepted
board = list(map(int, input().split())) k = int(input()) sort_board = sorted(board, reverse=True) for _ in range(k): sort_board[0] *= 2 print(sum(sort_board))
p02583
s931659144
Accepted
n=int(input()) ar=sorted(list(map(int,input().split()))) ans=0 for i in range(n): for j in range(i+1,n): for k in range(j+1,n): if(ar[i]==ar[j]):continue if(ar[j]==ar[k]):continue if(ar[i]+ar[j]>ar[k]): ans+=1 print(ans)
p03075
s886579477
Wrong Answer
a, b, c, d, e, k = [int(input()) for _ in range(6)] print('Yay!' if e-a < k else ':(')
p02682
s653411061
Accepted
a,b,c,d=map(int,input().split()) if a+1+b>d: print(min(a,d)) else: print(a-(d-a-b))
p02784
s054398195
Accepted
from sys import stdin import math h, n = [int(x) for x in stdin.readline().rstrip().split()] a = [int(x) for x in stdin.readline().rstrip().split()] sum = 0 for i in a: sum += i if sum >= h: print("Yes") else: print("No")
p02935
s541432262
Accepted
N = int(input()) A = list(map(int,input().split())) A.sort() tmp = A[0] for i in range(1,N): tmp = (tmp+A[i])/2 print(tmp)
p02706
s603284859
Accepted
n,m = map(int,input().split()) a = list(map(int,input().split())) for i in range(m): n -= a[i] print(n if n >= 0 else -1)
p03644
s217176256
Accepted
n = int(input()) n += 1 import copy ans = 0 ans_c = 0 for i in reversed(range(n)): check = copy.copy(i) div = 0 count = 0 while div == 0: div = (i % 2) i = i // 2 if div == 0: count += 1 if i == 0: break if ans_c < count: ans = check ans_c = count if ans == 0: ans += 1 print(ans)
p03359
s654232559
Accepted
a, b = map(int, input().split()) if a <= b: print(a) else: print(a - 1)
p03282
s292101053
Wrong Answer
s=input() k=int(input()) ans=0 for i in range(len(s)): if s[i]!=1: print(s[i]) break else: ans+=1 if k<ans: print(1) break
p04031
s872108195
Accepted
N = int(input()) an = list(map(int,input().split())) ave = round((sum(an)/N),0) ans = 0 for i in an: ans += (i-ave)**2 print(int(ans))
p02607
s569354237
Accepted
a = int(input()) s = 0 b = input().split(" ") i = 1 while i <= a : if (i % 2 == 1) and (int(b[i-1]) % 2 == 1) : s = s + 1 i = i + 1 print(s)
p02829
s461173328
Wrong Answer
A = input() B = input() C = 1 if (A == 1 or B == 1): C = 2 if (A == 2 or B == 2): C = 3 print(C)
p03493
s507841590
Wrong Answer
#第2問 ABC081A s = input() a = int(s.count('o')) print(int(700+a*100))
p04019
s348231935
Wrong Answer
s=input() x,y=0,0 for i in s: if(i=='N'): y+=1 elif(i=='S'): y-=1 elif(i=='W'): x-=1 else: x+=1 if(x==0 and y>=0): print("Yes") else: print("No")
p02780
s854343798
Wrong Answer
n, m = map(int, input().split()) a = sorted(list(map(int, input().split())), reverse=True) ans = 0 for i in range(m): ans += (1/2)*(a[i]+1) print(ans)
p02963
s996646728
Wrong Answer
S = int(input()) from math import sqrt rtS = sqrt(S) u = 10 ** 9 ans = [0 for _ in range(6)] ans[2] = u ans[3] = 1 ans[4] = -S%u if S > u else S%u ans[5] = S//u # print(ans[2]*ans[5] - ans[4]) print(*ans)
p03760
s801408594
Accepted
O = input() E = input() o = len(O) e = len(E) [print(O[i], E[i], sep = "", end = "") for i in range(min(o, e))] print("" if o == e else O[-1])
p03261
s264306344
Accepted
n=int(input()) w=[str(input()) for _ in range(n)] if len(set(w))!=n: print("No") exit() for i in range(n-1): if w[i][-1]!=w[i+1][0]: print("No") break else: print("Yes")
p02641
s239738172
Accepted
import numpy as np def ForbiddenList(): NumA = list(map(int,input().split())) NumB = list(map(int,input().split())) if len(NumB) != 0: result = list(range(min(NumB)-1, max(NumB)+2, 1)) for data in NumB: result.remove(data) idx = np.abs(np.asarray(result) - NumA[0]).argmin() print(result[idx]) else: print(NumA[0]) if __name__ == '__main__': ForbiddenList()
p03998
s041469061
Wrong Answer
line = input() line2 = input() line3 = input() print(line[-1])
p03696
s303359815
Wrong Answer
_,s=open(0);t=s p,q=o="()" while o in s:s=s.replace(o,"") f=s.count print(p*f(q)+t+q*f(p))
p03944
s068070090
Accepted
w,h,n = map(int,input().split()) x0,y0 = 0,0 for i in range(n): x,y,a = map(int,input().split()) if a==1: x0=max(x0,x) elif a==2: w=min(w,x) elif a==3: y0=max(y0,y) else: h=min(h,y) print(0 if w-x0<=0 or h-y0<=0 else (w-x0)*(h-y0))
p02829
s468618320
Wrong Answer
A=int(input()) B=int(input()) c=[1,2,3] c.remove(A) c.remove(B) print(c)
p02802
s734447184
Accepted
N,M=map(int,input().split()) ans=dict() AC=0 WA=0 for i in range(M): P,S= map(str,input().split()) if((P in ans)==False): ans[P]=[S] else: ans[P].append(S) for i in ans.values(): tmp=0 for value in i: if(value=='AC'): AC+=1 WA+=tmp break else: tmp+=1 print(AC,WA)
p03723
s706157492
Accepted
a, b, c = map(int, input().split()) total = a + b + c if a % 2 == 0 and b % 2 == 0 and c % 2 == 0 and a == b == c: print(-1) elif a % 2 != 0 or b % 2 != 0 or c % 2 != 0: print(0) else: count = 1 while True: a, b = (total - a) / 2, (total - b) / 2 if a % 2 != 0 or b % 2 != 0: print(count) break else: count += 1
p03592
s906283334
Wrong Answer
N,M,K = map(int,input().split()) for i in range(1,N+1): for j in range(1,M+1): count = i*M+j*N-2*i*j if count == K: print('Yes') exit() print('No')
p03250
s678733525
Accepted
#!/usr/local/bin python # -*- coding: utf-8 -*- # # ~/PycharmProjects/atcoder/A-MaximizeTheFormula.py # a, b, c = map(int, input().split()) if a >= b and a >= c: print(10 * a + b + c) elif b >= a and b >= c: print(a + 10 * b + c) else: print(a + b + 10 * c)
p03261
s173834778
Accepted
n = int(input()) w = [input() for _ in range(n)] if len(w) != len(set(w)): print('No') exit() for i in range(n-1): if w[i][-1] != w[i+1][0]: print('No') exit() print('Yes')
p03803
s202019996
Wrong Answer
a,b=map(int,input().split()) if a<b: print("Bob") elif a>b: print("Alice") else: print("Draw")
p02676
s231520509
Accepted
K = int(input()) S = input() if len(S) <= K: print(S) else: print(S[0:K] + "...")
p02759
s133925611
Accepted
N = int(input()) print(N//2) if((N % 2) == 0) else print(N//2 + 1)
p03077
s247137158
Wrong Answer
import math N = int(input()) Cap = [int(input()) for X in range(0,5)] MIN = Cap.index(min(Cap)) if MIN==0: print(int(math.ceil(N/Cap[0])+4)) else: print(int(math.ceil(N/Cap[0])+math.ceil(Cap[MIN-1]/Cap[MIN])+3))
p03565
s051697230
Accepted
S = input() T = input() for k in range(len(S)-len(T),-1,-1): f = 1 for i in range(len(T)): if S[k+i] != "?" and S[k+i] != T[i]: f = 0 break if f == 1: print(S[:k].replace("?","a")+T+S[k+len(T):].replace("?","a")) exit(0) print("UNRESTORABLE")
p02622
s109324506
Accepted
S = input().strip() T = input().strip() count = 0 for i in range(len(S)): if S[i] != T[i]: count += 1 print(count)
p03998
s406741119
Wrong Answer
A = list(input()) B = list(input()) C = list(input()) A = A[::-1] B = B[::-1] C = C[::-1] next = A.pop() while 1: if len(A)==0: print('A') break elif len(B)==0: print('B') break elif len(C)==0: print('C') break if next=='a': next = A.pop() elif next=='b': next = B.pop() else: next = C.pop()
p03815
s497054217
Accepted
x = int(input()) count = x//11 if x%11 == 0: print(count*2) elif count*11+6 >= x: print(count*2+1) else: print(count*2+2)
p02771
s804709471
Wrong Answer
A,B,C=map(int,input().split()) if "AAB" or "ABA" or "BAA" or "AAC" or "ACA" or "CAA" or "BBA" or "BAB" or "ABB" or "CCA" or "CAC" or "ACC" or "BBC" or "BCB" or "CBB" or "CCB" or "CBC" or "BCC": print("Yes") if "AAA" or "BBB" or "CCC" or "ABC": print("No")
p03645
s702665781
Accepted
n, m = map(int, input().split()) A = 0 B = 1 cnt = [0] * (n+1) ab = [] for i in range(m): a,b = map(int, input().split()) ab.append([a, b]) if a == 1: cnt[b] += 1 elif b == n: cnt[a] += 1 for i in range(n+1): if cnt[i] == 2: print("POSSIBLE") exit() print("IMPOSSIBLE")
p02939
s495203467
Accepted
import sys, math from functools import lru_cache from collections import deque sys.setrecursionlimit(10**9) MOD = 10**9+7 def input(): return sys.stdin.readline()[:-1] def mi(): return map(int, input().split()) def ii(): return int(input()) def i2(n): tmp = [list(mi()) for i in range(n)] return [list(i) for i in zip(*tmp)] S = input() i = 1 r = len(S) while True: if i >= len(S): break if S[i] == S[i-1]: r -= 1 i += 2 i += 1 print(r)
p03146
s133240234
Accepted
s = int(input()) l = [s] x = 1 y = 0 while y == 0: if s%2 == 0: s = int(s//2) else: s = 3*s+1 if s in l: print(x+1) y = 1 else: l.append(s) x += 1
p03994
s264802303
Accepted
from string import ascii_lowercase s = input() k = int(input()) def main(s, k): alp = ascii_lowercase num = {char: i for i, char in enumerate(alp)} ns = [num[char] for char in s] for i in range(len(ns)): v = ns[i] if v != 0 and 26 - v <= k: ns[i] = 0 k -= 26 - v ns[-1] = (ns[-1] + k) % 26 return ''.join(alp[n] for n in ns) print(main(s, k))
p02957
s475810517
Accepted
a,b=map(int,input().split()) if abs(a-b)%2==0: print(min(a,b)+abs(a-b)//2) else: print('IMPOSSIBLE')
p02714
s228232611
Wrong Answer
from collections import Counter n=int(input()) s_=input() s=Counter(s_) rgb = s['R'] * s['G'] * s['B'] cnt=0 for i in range(len(s_)): for j in range(i+1,len(s_)): h=j-i+j if h<len(s_)-1: if s_[i]!=s_[j] and s_[h]!=s_[j] and s_[i]!=s_[h]: cnt+=1 print(rgb-cnt)
p03745
s882424268
Wrong Answer
n=int(input()) l=list(map(int,input().split())) if n==1: print(1) exit() cnt=0 if l[0]>l[1]: ans="low" elif l[0]<l[1]: ans="high" else: ans="even" for i in range(2,n): if l[i-1]>l[i] and (ans=="low" or ans=="even"): ans="low" elif l[i-1]<l[i] and (ans=="high" or ans=="even"): ans="high" elif l[i-1]==l[i]: ans="even" else: cnt+=1 ans="even" print(cnt+1)
p03030
s724843015
Wrong Answer
n=int(input()) s=[] for i in range(n): s.append(input().split()) spoint=sorted(s,key=lambda x:x[1], reverse=True) scity=sorted(spoint,key=lambda x:x[0]) print(scity)
p04020
s988429663
Accepted
def main(): arr =[] for i in range(int(input())): arr.append(int(input())) ans = 0 now = 0 # (arr[i]+arr[i+1])//2 >= (arr[i]/2)+(arr[i+1]/2) for i in arr: if i==0: ans = ans +(now//2) now = 0 else: now = now+i ans= ans+(now//2) print(ans) if __name__ =="__main__": main()