problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p02796
s401046241
Accepted
import numpy as np n=int(input()) Z=np.zeros((n,4)) for i in range(n): Z[i][0],Z[i][1]=map(int, input().split()) Z[i][2]=Z[i][0]+Z[i][1] Z[i][3]=Z[i][0]-Z[i][1] Z2=Z[np.argsort(Z[:,2])] ans=1 border=Z2[0][2] for i in range(1,n): if Z2[i][3]>=border: ans+=1 border=Z2[i][2] print(ans)
p03380
s583636726
Accepted
n = int(input()) a = sorted(map(int, input().split())) from bisect import bisect_left ans_n = a[-1] p = bisect_left(a, (ans_n+1)//2) ans_r = a[p] if p != n-1 else a[p-1] if abs(a[p] - ans_n/2) > abs(a[p-1] - ans_n/2): ans_r = a[p-1] print(ans_n, ans_r)
p03962
s654397809
Accepted
a, b, c = map(int,input().split()) if a == b == c: print(1) elif a == b or b == c or c == a: print(2) else: print(3)
p03785
s541873669
Wrong Answer
import sys N, C, K = map(int ,input().split()) T = [int(input()) for _ in range(N)] if C == 1: print(N) sys.exit() cnt = 0 capacity = 0 time_limit = 0 for i in range(N): if capacity == 0: capacity += 1 time_limit = T[i] + K continue if capacity > 0: if T[i] <= time_limit: capacity += 1 if capacity == C: cnt += 1 capacity = 0 continue elif T[i] > time_limit: cnt += 1 capacity = 1 time_limit = T[i] + K print(cnt+1)
p03962
s764262390
Accepted
a, b, c = map(int, input().split()) ans = set([a, b, c]) print(len(ans))
p02642
s227111925
Accepted
from collections import Counter n = int(input()) a = list(map(int, input().split())) mx = max(a) a.sort() c = Counter(a) dp = [0] * (mx+1) for i in a: if dp[i] == 1: continue j = 2 while i * j <= mx: dp[i*j] = 1 j += 1 cnt = 0 for i in set(a): if dp[i] == 0 and c[i] == 1: cnt += 1 print(cnt)
p03821
s816950440
Wrong Answer
import sys n = int(sys.stdin.readline()) m = map(int, sys.stdin.read().split()) ab = list(zip(m, m)) res = 0 for i, j in ab[::-1]: if j != 1: res += j - (i + res) % j print(res)
p02958
s610910570
Accepted
n=int(input()) s=list(map(int,input().split())) ans=0 p=sorted(s) for i in range(n): if s[i]!=p[i]: ans+=1 print("NO" if ans>2 else "YES")
p03261
s486443125
Accepted
n = int(input()) W = [input() for i in range(n)] if len(W) != len(set(W)): print("No") exit() else: for i in range(len(W)-1): if W[i][len(W[i])-1] != W[i+1][0]: print("No") exit() print("Yes")
p03475
s979301028
Wrong Answer
N = int(input()) Plan = [list(map(int,input().split())) for _ in range(N-1)] for i in range(N-1): c1,s1,f1 = Plan[i] time = s1+c1 for j in range(i+1,N-1): c,s,f = Plan[j] if time <= s: time = s elif (time-s)%f != 0: time = f-(time-s)%f time += c print(time) print(0)
p02608
s998810051
Accepted
n=int(input()) r=range(1,100) l=[0]*n for x in r: for y in r: for z in r: t=x*x+y*y+z*z+y*z+z*x+x*y-1 if t<n: l[t]+=1 for i in l: print(i)
p03150
s903480449
Accepted
S=input() key="keyence" if S.find(key)!=-1: print("YES") exit() count=0 for i in range(7): s=S[i] if s==key[count]: count+=1 else: break for i in range(-1,-8,-1): s=S[i] if s==key[i]: count+=1 else: break if count>=7: print("YES") else: print("NO")
p03998
s576984668
Accepted
s = {} s['a'], s['b'], s['c'] = [input() for i in range(3)] player = 'a' while True: if len(s[player]) == 0: break first_c = str(s[player])[0] s[player] = str(s[player])[1:] player = first_c print(player.upper())
p02989
s378319053
Accepted
k = int(input()) seqS=input().split(" ") num=[] for q in seqS: num.append(int(q)) contador,abc,arc=0,0,0 num.sort() #ORGANIZA #num do meio print(num[int(len(num)/2)]- num[int(len(num)/2)-1])
p02922
s300436308
Accepted
A, B = map(int, input().split()) import math c = math.ceil((B - A) / (A - 1)) print(c + 1)
p02790
s688139985
Accepted
a, b = map(int, input().split()) if a == b: print(str(a)*a) else: mi, ma = min(a, b), max(a, b) print(str(mi)*ma)
p03030
s912853217
Accepted
N = int(input()) L = sorted([list(input().split()) + [i + 1] for i in range(N)], key = lambda x: x[0]) while len(L) > 0: c = sum([x[0] == L[0][0] for x in L]) M = sorted(L[0: c], key = lambda x : int(x[1]), reverse = True) for x in M: print(x[2]) L = L[c:]
p03524
s079219628
Accepted
import sys def input(): return sys.stdin.readline().strip() sys.setrecursionlimit(10 ** 9) def main(): S = input() cnt = [0, 0, 0] for s in S: if s == "a": cnt[0] += 1 elif s == "b": cnt[1] += 1 else: cnt[2] += 1 if max(cnt) - min(cnt) > 1: print("NO") else: print("YES") if __name__ == "__main__": main()
p02814
s113806209
Accepted
from fractions import gcd def lcm(p,q): return p*q//gcd(p,q) n,m = map(int, input().split()) a = list(map(int, input().split())) x = 1 for i in range(n): a[i] = a[i]//2 x = lcm(x,a[i]) if x>m: print(0) exit() for i in range(n): if (x//a[i])%2==0: print(0) exit() p = m//x if p%2==0: ans = p//2 else: ans = p//2 +1 print(ans)
p02995
s898415358
Accepted
from fractions import gcd A, B, C, D = map(int, input().split()) def f(x): return x - x//C - x//D + x//(C*D//gcd(C, D)) print(f(B)-f(A-1))
p02595
s281914564
Accepted
c = list(map(int, input().split())) n, d = c[0], c[1] xy = [map(int, input().split()) for _ in range(n)] x, y = [list(i) for i in zip(*xy)] count = 0 for l in range(n): a = x[l]*x[l] + y[l]*y[l] if a <= d*d: count += 1 print(count)
p03087
s520791170
Accepted
N, Q=map(int, input().split()) S=input() count=0 ac=[0] for i in range(N-1): if S[i]=="A" and S[i+1]=="C": count+=1 ac.append(count) for _ in range(Q): l, r=map(int, input().split()) l-=1 r-=1 print(ac[r]-ac[l])
p03998
s708877414
Accepted
i=input p=print l=len person=[i(),i(),i()] f=0 t="a" try: while True: t=person[f][0] person[f]=person[f][1:] if t=='a': f=0 elif t=='b': f=1 elif t=='c': f=2 except IndexError: p(['A','B','C'][f])
p03487
s921590470
Accepted
from collections import Counter N = int(input()) a = list(map(int, input().split())) c = dict(Counter(a)) cnt = 0 for i, j in c.items(): if i > j: cnt += j else: cnt += j - i print(cnt)
p03821
s385903692
Accepted
n = int(input()) a_ = [] b_ = [] for i in range(n): a, b = list(map(int, input().split())) a_.append(a) b_.append(b) to_added = 0 for i in reversed(range(n)): temp = a_[i] + to_added temp2 = temp % b_[i] if temp2 == 0: temp3 = 0 else: temp3 = b_[i] - temp2 to_added += temp3 print(to_added)
p03495
s250322724
Wrong Answer
n,k = [int(i) for i in input().split()] a = [int(i) for i in input().split()] a.sort() count = 1 chk = [] p = 1 if n == 1: print(0) exit() else: for i in range(n-1): if a[i] != a[i+1]: count += 1 chk.append(p) p = 1 else: p += 1 if a[-1] == a[-2]: chk.append(p) else: chk.append(1) chk.sort() print(chk) print(count) if count <= k: print(0) exit() else: print(sum(chk[:count-k])) exit()
p02675
s107423498
Wrong Answer
n = input() if n[-1] in [2,4,5,7,9]: print('hon') elif n[-1] in [0, 1, 6, 8]: print('pon') else: print('bon')
p02641
s700350108
Accepted
def main(): X, N = list(map(int, input().split(' '))) if N == 0: P = input() print(X) return P = list(map(int, input().split(' '))) min_dist, ans = abs(X), 0 for n in range(102): if n in P: continue if abs(X - n) < min_dist: min_dist = abs(X - n) ans = n print(ans) if __name__ == '__main__': main()
p02973
s578167840
Accepted
from bisect import bisect N, *A = map(int, open(0).read().split()) mins = [] length = 0 for a in A: i = bisect(mins, -a) if i >= length: mins.append(-a) length += 1 else: mins[i] = -a print(length)
p03416
s834946491
Wrong Answer
a,b=map(int,input().split()) ans=0 for i in range(a,b+1): if i%100==i//1000:ans+=1 print(ans)
p02772
s156250376
Accepted
N = int(input()) A = list(map(int, input().split())) for a in A: if a % 2 == 1: continue elif a % 3 == 0 or a % 5 == 0: continue else: print("DENIED") exit() print("APPROVED")
p02982
s309179513
Wrong Answer
def main(): n, d = map(int, input().split()) ps = [[*map(int, input().split())] for _ in range(n)] square = [i**2 for i in range(1, 20)] cnt = 0 for i in range(n-1): for j in range(i+1, n): if sum([(ps[i][k] - ps[j][k]) ** 2 for k in range(d)]) in square: cnt += 1 print(cnt) if __name__ == "__main__": main()
p03457
s940523454
Accepted
N=int(input()) count=0 T,X,Y=0,0,0 for i in range(N): t,x,y=map(int,input().split()) if abs(x-X)+abs(y-Y)<=abs(t-T) and t%2==(x+y)%2:count+=1 T,X,Y=t,x,y print('Yes' if count==N else 'No')
p02598
s113204294
Accepted
n,k=map(int,input().split()) A=list(map(int,input().split())) ng=0 ok=max(A) while abs(ok-ng)>1: mid=(ok+ng)//2 now=0 for i in A: now+= i//mid-1 if i%mid==0 else i//mid if now> k : ng=mid else: ok=mid print(ok)
p03150
s264954003
Wrong Answer
S = input() j = "keyence" now = 0 out = 0 for i in range(len(S)): if S[i] == j[now]: now += 1 if now == 7: break else: out += 1 if out == 2: break if now == 7: print("YES") else: print("NO")
p02742
s964961192
Accepted
def submit(): h, w = map(int, input().split()) if h == 1 or w == 1: print(1) return even_c = sum(divmod(w, 2)) odd_c = w // 2 even_row = sum(divmod(h, 2)) * even_c odd_row = (h // 2) * odd_c print(even_row + odd_row) if __name__ == "__main__": submit()
p02719
s969309865
Wrong Answer
N,K=map(int,input().split()) if N<=K: print(N) else: A=N%K ans=min(A,K-A) print(ans)
p03639
s437444074
Accepted
n = int(input()) As = list(map(int, input().split())) four = sum([1 for a in As if a%4 == 0]) odd = sum([1 for a in As if a%2 == 1]) two = sum([1 for a in As if a%2 == 0 and a%4 != 0]) if four < two%2 + odd - 1: print("No") else: print("Yes")
p02682
s074912159
Accepted
a, b, c, k = map(int, input().split()) if a >= k: a = k b = 0 c = 0 if a < k and a+b >= k: c = 0 if a+b < k: c = k - a - b sum_a = 1 * a sum_c = -1 * c print(sum_a + sum_c)
p04034
s620908839
Accepted
N, M = map(int, input().split()) box = [1] * N red = [1] red.extend([0] * (N - 1)) for i in range(M): x, y = map(int, input().split()) x, y = x - 1, y - 1 if red[x] == 1: if box[x] == 1: red[x] = 0 red[y] = 1 box[x] -= 1 box[y] += 1 print(sum(red))
p03351
s634528289
Accepted
a,b,c,d=map(int,input().split()) if abs(a-c)<=d: print("Yes") elif abs(a-b)<=d and abs(b-c)<=d: print("Yes") else: print("No")
p02699
s025090704
Wrong Answer
s, w = map(int, input().split()) if w >= s//2: print('unsafe') else: print('safe')
p03061
s269619406
Accepted
#125_C from fractions import gcd N=int(input()) A=list(map(int,input().split())) L=[0 for _ in range(N+1)] R=[0 for _ in range(N+1)] for i in range(N): L[i+1]=gcd(L[i],A[i]) for i in range(N-1,-1,-1): R[i]=gcd(R[i+1],A[i]) ans=0 for i in range(N): M=gcd(L[i],R[i+1]) ans=max(ans,M) print(ans)
p02817
s272672631
Accepted
def main(): s, t = input().split() print(t + s) if __name__ == "__main__": main()
p03351
s244882172
Wrong Answer
a, b, c, d = map(int,input().split()) if abs(a-c) >= d or (abs(a-b) >= d and abs(b-c) >= d): print("Yes") else: print("No")
p03219
s442494552
Wrong Answer
x,y = map(int,input().split()) print(x+y/2)
p02729
s025805736
Accepted
N,M=map(int, input().split()) print(N*(N-1)//2+M*(M-1)//2)
p02623
s078421475
Wrong Answer
n, m, k = map(int, input().split()) *A, = map(int, input().split()) *B, = map(int, input().split()) SA, SB = [0], [0] for i in range(n): SA.append(SA[i] + A[i]) for j in range(m): SB.append(SB[j] + B[j]) ans, tmp = 0, m for i in range(n + 1): if SA[i] > k: break for j in range(tmp, 0, -1): if SA[i] + SB[j] <= k: ans = max(ans, i + j) break tmp = j print(ans)
p02624
s749366154
Accepted
n = int(input()) ans = 0 for i in range(1, n + 1): t = n // i ans += t * (t + 1) // 2 * i print(ans)
p02720
s095627621
Accepted
k = int(input()) from collections import deque queue = deque(range(1,10)) count = 0 while count < k: count += 1 tmp = queue.popleft() tail = tmp%10 if tail != 0: queue.append(10*tmp+tail-1) queue.append(10*tmp+tail) if tail != 9: queue.append(10*tmp+tail+1) print(tmp)
p02657
s010033190
Accepted
a, b = map(int, input().split()) print("{}".format(a*b))
p03385
s183497650
Accepted
s = input() if 'a' in s and 'b' in s and 'c' in s: print('Yes') else: print('No')
p02958
s597763552
Wrong Answer
n = int(input()) p = list(map(int, input().split())) s = sorted(p) count = 0 for i, j in zip(p, s): if i != j: count += 1 if count > 2: print("No") else: print("Yes")
p02681
s503643279
Accepted
S = input() T = input() if len(T) == 2 and S[0] == T[0]: print("Yes") else: if S[0] == T[0]: T = T.replace(S,"") if len(T)==1: print("Yes") else: print("No") else: print("No")
p03437
s282504042
Wrong Answer
x,y = map(int,input().split()) if x == y: print(-1) else: for i in range(1,10000000): a = i * x if a % y != 0: print(a) exit()
p03673
s044503485
Accepted
from collections import deque n=int(input()) a=list(map(str,input().split())) b=deque() #print(b) for i in range(n): if i%2==0: b.append(a[i]) else: b.appendleft(a[i]) b=list(b) if n%2==1: b=b[::-1] print(" ".join(b))
p02576
s849922084
Accepted
n, x, t = map(int, input().split()) if n % x == 0: total = n // x * t else: total = (n// x + 1) * t print(total)
p03284
s612979044
Accepted
print("01"[eval(input().replace(" ","%"))!=0])
p02572
s646523687
Wrong Answer
n=int(input()) a=list(map(int,input().split())) if n==1: print(a[0]) else: l=list(map(lambda z:z**2,a)) x=sum(a) y=sum(l) t=(x-y)//2 print(t)
p03387
s607743077
Accepted
a = list(map(int, input().split())) a.sort() ans = 0 while a[0]+1<a[2]: a[0] += 2 ans += 1 a.sort() if a[0]==a[1]==a[2]: print(ans) elif a[0]==a[1]: print(ans+1) else: print(ans+2)
p02682
s557658825
Accepted
a, b, c, k = list(map(int, input().split())) if k <= a+b: ans = min(a,k) else: ans = 2*a+b-k print(ans)
p03624
s778070596
Wrong Answer
S = [i for i in input()] S = set(S) S = sorted(list(S)) for i in range(97, 122): if chr(i) not in S: print(chr(i)) exit(0) else: print('None')
p03137
s080623123
Wrong Answer
n,m=map(int,input().split()) a=list(map(int,input().split())) a=sorted(a) b=[0]*(m-1) for i in range(m-1): b[i]=a[i+1]-a[i] b=sorted(b) b=b[:m-1-(n-1)] print(sum(b))
p03327
s855909590
Accepted
n = int(input()) if n < 1000: print("ABC") else: print("ABD")
p02725
s534916537
Wrong Answer
import numpy as np
p03416
s957831269
Accepted
a, b = map(int, input().split()) count = 0 for i in range(a, b+1): if str(i) == str(i)[::-1]: count += 1 print(count)
p03679
s027283268
Accepted
x, a, b = map(int, input().split()) if (-a + b) <= 0: print('delicious') elif 0 < (-a + b) <= x: print('safe') else: print('dangerous')
p02996
s378404118
Accepted
N = int(input()) C = [] for i in range(N): A, B = map(int, input().split()) C.append([B, A]) C.sort() a = 0 ans = 'Yes' for i in range(N): if a + C[i][1] <= C[i][0]: a += C[i][1] else: ans = 'No' break print(ans)
p02639
s481802903
Wrong Answer
list = list(map(int, input().split())) for i in range(4): if list[i]==0: print(i+1)
p03095
s661870157
Accepted
import sys from collections import Counter input = sys.stdin.readline P = 10 ** 9 + 7 def main(): N = int(input()) S = input().rstrip() c = Counter(S) ans = 1 for v in c.values(): ans = (ans * (v + 1)) % P ans = (ans - 1) % P print(ans) if __name__ == "__main__": main()
p02778
s535675601
Accepted
leng = len(input()) ans = 'x' * leng print(ans)
p03011
s448735148
Accepted
s = sorted(list(map(int, input().split()))) print(sum(s[:2]))
p03986
s366063883
Accepted
x = input() s_cnt = 0 t_cnt = 0 ans = 0 tmp = 0 for s in x: if s == "T": if tmp == 0: ans += 2 else: tmp -= 1 else: tmp += 1 print(ans)
p03061
s299112742
Accepted
from fractions import gcd N = int(input()) A = list(map(int, input().split())) mx = 1 L = [0] * (N + 2) R = [0] * (N + 2) for i in range(1, N + 1): L[i] = gcd(L[i - 1], A[i - 1]) for i in range(N, 0, -1): R[i] = gcd(R[i + 1], A[i - 1]) for i in range(1, N + 1): mx = max(mx, gcd(L[i - 1], R[i + 1])) print(mx)
p02731
s004361141
Wrong Answer
l = int(input()) max = 0.0 for x in range(l+1): for y in range(l+1-x): vol = x * y * (l-x-y) if vol > max: max = vol print(max)
p03611
s910081327
Accepted
n = int(input()) num = list(map(int,input().split())) lis = [0]*(max(num)+4) for i in num: if i == 0: lis[i] +=1 lis[i+1] +=1 else: lis[i-1] +=1 lis[i] +=1 lis[i+1] +=1 print(max(lis))
p03075
s435370259
Wrong Answer
a=int(input()) b=int(input()) c=int(input()) d=int(input()) e=int(input()) k=int(input()) if e-a>k: print(':(') else: ('Yay!')
p02987
s937705280
Accepted
s=input() if ((s[0]==s[1] and s[2]==s[3]) or (s[0]==s[2]and s[1]==s[3]) or (s[0]==s[3]and s[1]==s[2])): if s[0]==s[1]==s[2]==s[3]: print("No") else: print("Yes") else: print("No")
p02622
s145221275
Accepted
a = input() b = input() count = 0 for i in range(len(a)): if a[i] != b[i]: count += 1 print(count)
p02995
s757682552
Wrong Answer
a,b,c,d = map(int,input().split()) from fractions import gcd cd_gcd = gcd(c,d) lcm= c*d // cd_gcd ans = [] for i in (a-1,b): ans.append(int(i/c) + int(i/d) - int(i/lcm)) print(b-a - (ans[1]-ans[0]))
p03803
s287902904
Accepted
a, b = map(int, input().split()) if a == b: print('Draw') exit() if a < b: if a == 1 and b == 13: print('Alice') exit() else: print('Bob') exit() if b == 1 and a == 13: print('Bob') exit() print('Alice')
p02629
s683135278
Accepted
n = int(input()) - 1 ans = "" for _ in range(13): ans += chr(ord("a") + (n%26)) n //= 26 if n == 0: break n -= 1 print(ans[::-1])
p03386
s059693711
Accepted
a, b, k = [int(i) for i in input().split()] if k < b-a+1: tmp1 = list(range(a, a+k)) tmp2 = list(range(b-k+1, b+1)) tmp1.extend(tmp2) tmp = sorted(list(set(tmp1))) else: tmp = list(range(a, b+1)) for i in tmp: print(i)
p03073
s056063593
Wrong Answer
s=input() a=[] for i in range(0,len(s),2): a.append(s[i:i+2]) a10=a.count('10') a01=a.count('01') if len(s)%2: s1=int(s[-1]) else:s1=-1 if a10>a01: if s1==0: cnt=len(a)-a10+a01+1 else: cnt=len(a)-a10+a01 elif a01>a10: if s1==1: cnt=len(a)-a01+a10+1 else: cnt=len(a)-a01+a10 else: cnt=len(a) print(cnt)
p03250
s176867057
Accepted
num_list = list(map(int,input().split())) num_list = sorted(num_list) print(int(num_list[2]*10 + num_list[0] + num_list[1]))
p03696
s927838484
Accepted
def submit(): n = int(input()) s = input() cnt = 0 op = 0 for c in s: if c == "(": cnt += 1 else: if cnt == 0: op += 1 else: cnt -= 1 print("(" * op + s + ")" * cnt) submit()
p03986
s369278952
Wrong Answer
s = input() sc = 0 tc = 0 ans = len(s) for si in s: if si == "S": sc += 1 else: tc += 1 if sc: ans -= min(sc,tc)*2 sc -= min(sc,tc) tc -= min(sc,tc) #print(ans,sc,tc) print(ans)
p03449
s515685252
Accepted
n = int(input()) a_list = [] for i in range(2): a_list.append(list(map(int,input().split()))) max_list = [[0 for i in range(n)] for i in range(2)] max_list[0][0] = a_list[0][0] max_list[1][0] = a_list[0][0] + a_list[1][0] for i in range(1,n): max_list[0][i] = max_list[0][i-1] + a_list[0][i] for j in range(1,n): max_list[1][j] = max(max_list[0][j],max_list[1][j-1]) + a_list[1][j] print(max_list[1][n-1])
p03760
s927184639
Accepted
o = input() e = input() ans = "" for a,b in zip(o,e): ans += a + b if len(o)-len(e) == 1: print(ans+o[-1]) else: print(ans)
p02909
s971867184
Wrong Answer
#!/usr/bin/env python3 #%% for atcoder uniittest use import sys input= lambda: sys.stdin.readline().rstrip() sys.setrecursionlimit(10**9) def pin(type=int):return map(type,input().split()) def tupin(t=int):return tuple(pin(t)) def lispin(t=int):return list(pin(t)) #%%code def resolve(): S=input() W=["Sunny","Cloudy","Rainy"] if S==S[0]:print(W[1]) elif S==S[1]:print(W[2]) else: print(W[0]) #%%submit! resolve()
p02835
s847722839
Accepted
# 147 A a, b, c = map(int, input().split()) if a + b + c >= 22 : print("bust") else: print("win")
p04034
s400236659
Accepted
n,m=map(int,input().split()) a=[1]*(n+1) b=[0]*(n+1) b[1]=1 for _ in range(m): x,y=map(int,input().split()) a[x]-=1 a[y]+=1 if b[x]:b[y]=1 if a[x]==0:b[x]=0 ans=0 for i,j in zip(a,b): ans+=(i!=0)*j print(ans)
p03075
s000785974
Accepted
# coding: utf-8 import sys sr = lambda: sys.stdin.readline().rstrip() ir = lambda: int(sr()) lr = lambda: list(map(int, sr().split())) A = [0] * 5 for i in range(5): A[i] = ir() K = ir() bl = A[-1] - A[0] <= K print('Yay!' if bl else ':(')
p02773
s883541106
Accepted
import collections n=int(input()) lst=[] for i in range(n): lst.append(input()) cnt=collections.Counter(lst) ma=0 for val in cnt.values(): val=int(val) if(val>ma): ma=val li=[] for key,val in cnt.items(): val=int(val) if(val==ma): li.append(key) li.sort() for i in li: print(i)
p02859
s420530196
Accepted
r=int(input()) print(r**2)
p03469
s941235486
Accepted
s = input() print(s[:3]+"8"+s[4:])
p03323
s230874384
Wrong Answer
a, b = map(int, input().split()) if a >= 9 or b >= 9: print(":(") else: print("Yay")
p02546
s023800417
Wrong Answer
S = input() N = S[-1] if N == 'e': print(S+'s') else: print(S+'es')
p02639
s361145299
Wrong Answer
a=list(map(int,input().split())) for i in range(4): if a[i]==0: print(i+1)
p04020
s000328306
Accepted
N = int(input()) ans = 0 prev = 0 for i in range(N): a = int(input()) if prev == 1 and a >= 1: ans += 1 a -= 1 ans += a // 2 prev = a % 2 print(ans)