problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p02594
s203296027
Wrong Answer
K = int(input()) m = 0 for i in range(K): m = (m * 10 + 7) % K if m == 0: print(i+1) break elif m == K-1: print(-1) break
p02784
s861172205
Accepted
import os, sys, re, math (H, N) = [int(n) for n in input().split()] A = [int(n) for n in input().split()] if sum(A) >= H: print('Yes') else: print('No')
p02754
s336594271
Accepted
N, A, B = map(int, input(). split()) amari = N%(A+B) kaisu = N//(A+B) kazu = kaisu*A + min(amari, A) print(kazu)
p03264
s856177850
Wrong Answer
k=int(input()) if k%2==0: ans=(k//2)**2 else: ans=(k//2)*(k//2+1)
p03317
s943186746
Accepted
n,k=map(int,input().split()) a=list(map(int,input().split())) g=1 while k+(k-1)*(g-1)< n: g+=1 print(g)
p03698
s351321432
Wrong Answer
s = list(input().split()) if len(s)==len(set(s)): print("yes") else: print("no")
p02730
s761172454
Wrong Answer
s=input() def kai(s): if len(s)//2 == 0: if s[:int(len(s)/2-1)] == s[int(len(s)/2):]: return True else: return False else: if s[:int((len(s)-1)/2)] == s[int((len(s)+1)/2):]: return True else: return False if kai(s) and kai(s[:int((len(s)-1)/2)]) and kai(s[int((len(s)+1)/2):]): print('Yes') else: print('No')
p03449
s757876891
Accepted
n = int(input()) a = [list(map(int,input().split())) for _ in range(2)] ans = 0 for i in range(n): candy = 0 for j in range(n): if j <= i: candy += a[0][j] if j >= i: candy += a[1][j] ans = max(ans, candy) print(ans)
p03705
s345473274
Accepted
N, A, B = map(int, input().split()) if (N == 1 and A != B) or A > B: print(0) exit() min_ab = (N-1)*A+B max_ab = (N-1)*B+A print(max_ab-min_ab+1)
p03211
s298420099
Accepted
# B - 754 S = input() def f(i): return abs(100*int(S[i])+10*int(S[i+1])+int(S[i+2])-753) ans = 10000 for i in range(len(S)-2): ans = min(ans, f(i)) print(ans)
p03211
s466438276
Wrong Answer
S = input() list = [] for i in S: list.append(int(i)) n = len(S) ans =[] for i in range(n-2): ans.append(100*list[i]+10*list[i+1]+list[i+2]) print(abs(max(ans)-753))
p03329
s874340240
Wrong Answer
dp = [999999] * 100100 n = int(input()) dp[0] = 0 for i in range(0, 100010): dp[i+1] = min(dp[i+1], dp[i] + 1) for j in range(1,100): c = i + 6**j if (i+c) > 100000: break dp[c] = min(dp[c], dp[i] + 1) for j in range(1,100): c = i + 9**j if (i+c) > 100000: break dp[c] = min(dp[c], dp[i] + 1) #print(dp[:100]) print(dp[n])
p03862
s802432604
Accepted
N,x=map(int,input().split()) A=list(map(int,input().split()))+[0] ans=0 for i in range(N): eated=max(0,A[i]+A[i-1]-x) ans+=eated A[i]-=eated print(ans)
p03456
s778650579
Wrong Answer
a, b = input().split() x = int(a + b) n = 1000 for i in range(n): if i**2 == x: print('Yes') break print('No')
p03377
s586856969
Accepted
a, b, x = map(int, input().split()) print("YES" if a <= x and x <= a+b else "NO")
p02862
s917707881
Accepted
x,y = map(int, input().split()) if (x+y)%3 != 0: print(0) exit() if 2*y<x or y>2*x: print(0) exit() dan = (x+y)//3+1 num=y-dan+1 def modinv(a, mod=10**9+7): return pow(a, mod-2, mod) def comb(n, r, mod=10**9+7): r = min(r, n-r) res = 1 for i in range(r): res = res * (n - i) * modinv(i+1, mod) % mod return res ans = comb(dan-1,num) print(int(ans))
p02664
s900136809
Wrong Answer
word = input() start = 0 end = len(word) while(True): i = word.find('?', start, end) if (i == -1): break elif (i == (end-1)): word = word.replace('?', "D", 1) elif (word[i-1] == 'P'): word = word.replace('?', "D", 1) elif ((word[i+1] == "?") or (word[i+1] == "D")): word = word.replace('?', "P", 1) start = i + 1 print(word)
p02766
s220349517
Wrong Answer
# coding: utf-8 import math n, k = map(int, input().split()) print(math.ceil(math.log(n, k)))
p02661
s665964860
Accepted
from numpy import* a,b=median(t:=loadtxt(open(0),skiprows=1),0) print(int((a-b)*~(~len(t)%2))+1)
p03698
s565159949
Wrong Answer
a=input() count=0 for i in range(len(a)): if a[i] in a: count=count+1 if count==0: print("yes") else: print("no")
p02780
s703981089
Accepted
#!/usr/bin/env python3 n, k, *P = map(int, open(0).read().split()) p = [(i + 1) / 2 for i in P] s = [float()] for i in range(n): s.append(s[i] + p[i]) print(max(s[i + k] - s[i] for i in range(n - k + 1)))
p03455
s832724968
Accepted
s = input().split() if int(s[0]) * int(s[1]) % 2 == 0: print("Even") else: print("Odd")
p02691
s538208433
Wrong Answer
n = int(input()) a = [] for i in list(map(int, input().split())): # 番号の差の絶対値の最大以上の身長を持つものは条件を満たさないのでパス if i < n - 1: a.append(i) answer = 0 for i, hi in enumerate(a): for j in range(i + 1, len(a)): hj = a[j] if abs(i - j) == hi + hj: answer += 1 print(answer)
p02640
s131405861
Wrong Answer
x, y = map(int, input().split()) c = 0 while x >= 0: if c * 2 + x * 4 == y: break c += 1 x -= 1 else: print("No") print("Yes")
p03680
s049387155
Accepted
N = int(input()) A = [] for i in range(N): A.append(int(input())) button = [0] * N button[0] = 1 next_button = 1 i = 0 while True: button[next_button - 1] = 2 next_button = A[next_button - 1] if button[next_button - 1] == 2: print("-1") break elif next_button == 2: i += 1 print(i) break else: button[next_button - 1] = 1 i += 1
p03371
s488975168
Wrong Answer
a,b,c,x,y = map(int,input().split()) first = 2 * max(x,y) + 1 total = 5000 * 10 ** 5 * 2 for i in range(0,x+1): for j in range(0,y+1): k = 2 * max(x-i,y-j) if first > k : first = k target = a * i + b * j + c * k if total > target: total = target else: continue else: break print(total)
p02783
s092331798
Wrong Answer
H,A=input().split() H,A=int(H),int(A) if max(A,H)<=10000 and min(A,H)>=1: print((int(H)//int(A)+1))
p02645
s655852623
Wrong Answer
S=str(input()) S[:3]
p03417
s920477022
Accepted
n,m=[int(i) for i in input().split()] if n!=1 and m!=1: print(max(0,(n-2)*(m-2))) elif n==1 and m==1: print(1) elif n==1 or m==1: print(max(n,m)-2)
p03862
s296067193
Wrong Answer
n,x=map(int,input().split()) a=[int(i) for i in input().split()][::-1] diff = [] for i in range(n-1): diff.append(a[i+1]+a[i]) c=0 #print(diff) for i in range(n-2): if diff[i]>x: temp = diff[i+1] - x c += temp diff[i] -= temp diff[i+1] -= temp if diff[-1] >x: c += diff[-1] - x diff[-1] = x print(c)
p03555
s750215136
Accepted
a, b = [input() for i in range(2)] print("YES" if a[0]==b[2] and a[1]==b[1] and a[2]==b[0] else "NO")
p03339
s925957567
Accepted
n = int(input()) s = input() e_cnt = 0 for i in range(n): if s[i] == "E": e_cnt += 1 ans = e_cnt w_cnt = 0 for i in range(n): if s[i] == "E": e_cnt -= 1 ans = min(w_cnt + e_cnt, ans) if s[i] == "W": w_cnt += 1 print(ans)
p02792
s585745216
Wrong Answer
N = int(input()) A = [[0 for i in range(11)] for j in range(11)] for i in range(1, N): A[int(str(i)[0])][int(str(i)[-1])] +=1 B = [[0 for i in range(11)] for j in range(11)] for i in range(1, N): B[int(str(i)[0])][int(str(i)[-1])] +=1 ans = 0 for i in range(10): for j in range(10): ans += A[i][j] * B[j][i] print(ans)
p02546
s444449977
Accepted
def readInts(): return [int(i) for i in input().split()] S = input() if S[-1] == 's': print(S + 'es') else: print(S + 's')
p02624
s241670252
Wrong Answer
''' Created on 2020/07/04 @author: fanta ''' import numpy as np N = int(input()) sum = 0 start = 0 end = 0 startL = [] endL = [] v = np.array([]) for n in range(N): start = n+1 end = N - N%start if (start == end): sum += start else: startL.append(start) endL.append(end) np_startL = np.array(startL) np_endL = np.array(endL) v = (np_endL - np_startL) // np_startL + 1 sum += np.sum((np_endL + np_startL) * v // 2) print(sum)
p02600
s347011483
Accepted
a=int(input()) if 400<=a and a<=599: print(8) if 600<=a and a<=799: print(7) if 800<=a and a<=999: print(6) if 1000<=a and a<=1199: print(5) if 1200<=a and a<=1399: print(4) if 1400<=a and a<=1599: print(3) if 1600<=a and a<=1799: print(2) if 1800<=a and a<=1999: print(1)
p02939
s860424966
Accepted
S=input() ans=0 l=["hoge"] j=0 for i in range(len(S)): if S[j:i+1]==l[-1]: continue else: l.append(S[j:i+1]) ans+=1 j=i+1 #print(l) print(ans)
p02682
s831087953
Accepted
if __name__ == '__main__': a,b,c,k = map(int,input().split()) ans = 0 if k >= a: k -= a ans += a else: ans += k print(ans) exit() if k >= b: k -= b else: print(ans) exit() if k >= c: ans += c * (-1) else: ans += k * (-1) print(ans)
p02759
s630211237
Accepted
print((int(input())+1)//2)
p02696
s536532937
Accepted
import math A,B,N = map(int,input().split()) C = N - N%B ans = A*(C-1) // B - A*math.floor((C-1)/B) if B > N: ans = math.floor(A*N/B) - A*math.floor(N/B) print(ans)
p02727
s736405452
Accepted
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() q.sort() r.sort() p = p[-X:] q = q[-Y:] r.extend(p) r.extend(q) r.sort() print(sum(r[-(X + Y):]))
p03639
s745602005
Wrong Answer
n=int(input()) lis=list(map(int,input().split())) t,f=0,0 for i in lis: if i%2==0: t+=1 if i%4==0: f+=1 if t+f>=n-1: print("Yes") else: print("No")
p02613
s036654190
Wrong Answer
N=int(input()) a=0 w=0 t=0 r=0 for i in range(N): s=input() if s=="AC": a+=1 elif s=="WA": w+=1 elif s=="TLE": t+=1 else: r+=1 print("AC ×",a) print("WA ×",w) print("TLE ×",t) print("RE ×",r)
p02767
s927511341
Accepted
a = int(input()) b = input().split() b = [int(j) for j in b] x = round(sum(b) / a) y = [] for i in range(a): y.append((x - b[i])**2) print(sum(y))
p03077
s676877443
Wrong Answer
from math import ceil N = int(input()) l = [None] * 5 for i in range(5): l[i] = int(input()) print(5 + ceil(N/min(l)))
p02689
s121324614
Wrong Answer
n, m = map(int, input().split()) h = list(map(int, input().split())) ab = [list(map(int, input().split())) for i in range(m)] for i in range(m): h[min(ab[i][0]-1, ab[i][1]-1)] = 0 if h[ab[i][0]-1] == h[ab[i][1]-1]: h[ab[i][0]-1] = h[ab[i][1]-1] = 0 h = [i for i in h if i != 0] print(len(h))
p02689
s933311910
Accepted
n,m = map(int,input().split()) H = list(map(int,input().split())) L = [1]*n for _ in range(m): a,b = map(int,input().split()) if H[a-1] == H[b-1]: L[a-1] = 0 L[b-1] = 0 elif H[a-1] < H[b-1]: L[a-1] = 0 elif H[a-1] > H[b-1]: L[b-1] = 0 print(sum(L))
p03360
s405877916
Wrong Answer
a,b,c=map(int,input().split()) k=int(input()) l=[] l.append((k+1)*a +b+c) l.append((k+1)*b +a+c) l.append((k+1)*c +a+b) print(l)
p04011
s141575661
Accepted
#宿泊数N,金額を表す計算用宿泊日数K,K泊目の金額X,K+1泊目の金額 N=int(input()) K=int(input()) X=int(input()) Y=int(input()) if N<K: a=N*X b=0 else: a=K*X b=(N - K) * Y print(a+b)
p02631
s543874855
Accepted
N = int(input()) a = list(map(int, input().split())) S = 0 for i in range(N): S = S ^ a[i] num = [] for i in range(N): num.append(S ^ a[i]) ans = " ".join(map(str, num)) print(ans)
p02765
s650826237
Accepted
a = list(map(int, input().split())) if a[0] >= 10: print(a[1]) else: print(a[1] + 100 * (10 - a[0]))
p02958
s323611883
Wrong Answer
n = int(input()) p = list(map(int, input().split())) c = 0 for i in range(n): if p[i]!=i+1: c+=1 print(c) if c>2: print("NO") else: print("YES")
p02578
s280594459
Wrong Answer
n = int(input()) a_L = list(map(int,input().split())) if len(a_L) == 1: print(0) exit() ans = 0 for i in range(0,len(a_L)-1): if a_L[i] > a_L[i+1]: ans += abs(a_L[i+1] - a_L[i]) a_L[i+1] = a_L[i] if a_L[-1] > a_L[-2]: ans += abs(a_L[-1]-a_L[-2]) print(ans)
p03657
s308431593
Accepted
a, b = map(int, input().split()) if (a+b) % 3 == 0 or a % 3 == 0 or b % 3 == 0: print("Possible") else: print("Impossible")
p03243
s052231578
Accepted
# B - AtCoder Beginner Contest 111 import bisect N = int(input()) arr = [111, 222, 333, 444, 555, 666, 777, 888, 999] ans_idx = bisect.bisect_left(arr, N) print(arr[ans_idx])
p04019
s952366416
Accepted
s = input() if ("S" in s and not "N" in s) or ("N" in s and not "S" in s) or ("E" in s and not "W" in s) or ("W" in s and not "E" in s): print("No") else: print("Yes")
p03804
s600726245
Accepted
n,m=map(int,input().split()) a=[input() for _ in range(n)] b=[input() for _ in range(m)] b1=b[0] res="No" for i in range(n-m+1): if b1 in a[i]: x=a[i].index(b1) match=1 for j in range(1,m): if a[i+j][x:x+m]!=b[j]: match=0 if match: res="Yes" print(res)
p03433
s138134155
Accepted
n = int(input())%500 if n<=int(input()): print("Yes") else: print("No")
p02917
s693677968
Accepted
N = int(input()) B = list(map(int, input().split())) A = [0]*(N+1); A[0] = B[0] B.append(B[N-2]) for i in range(1, N): A[i] = min(B[i-1], B[i]) print(sum(A))
p02873
s155470899
Wrong Answer
s = input() a = [] ans = 0 for i in range(len(s)): dainari = 0 syonari = 0 for j in reversed(range(i)): if s[j] == "<": dainari += 1 else: break for j in range(i,len(s)): if s[j] == ">": syonari += 1 else: break ans += max(dainari,syonari) #print(max(dainari,syonari),s[i],a) print(sum(a)+(s[-1] == "<"))
p03043
s638908020
Accepted
def f(n): k = 0 while n*2**k<K: k += 1 return k N,K = map(int,input().split()) if K<=N: P = (N-K+1)/N for i in range(1,K): P += 2**(-f(i))/N else: P = 0 for i in range(1,N+1): P += 2**(-f(i))/N print(P)
p03524
s531434668
Accepted
from collections import Counter s = input() l = len(s) a = s.count('a') b = s.count('b') c = s.count('c') if max([a, b, c]) - min([a, b, c]) <= 1: print('YES') exit(0) print('NO')
p03838
s952442699
Wrong Answer
# AGC008 A Simple Calculator x, y = map(int, input().split()) _x = abs(x) _y = abs(y) if x >= 0 and y >= 0: if x <= y: print(y-x) else: print(x-y+2) elif x * y <= 0: print(abs(_y-_x)+1) else: if _x < _y: print(_y-_x+2) else: print(_x-_y)
p03494
s683775911
Accepted
N = int(input()) List = list(map(int,input().split())) count = 0 while all(li % 2 == 0 for li in List): List = [i // 2 for i in List] count += 1 print(count)
p02696
s812800711
Accepted
a, b, n = map(int, input().split()) start = min(b - 1, n) def f(x): return int(a * x / b) - a * int(x / b) print(f(start))
p02623
s178347885
Accepted
import bisect n, m, k = map(int, input().split()) a = [int(_) for _ in input().split()] b = [int(_) for _ in input().split()] for i in range(1, n): a[i] += a[i-1] for i in range(1, m): b[i] += b[i-1] a = [0] + a b = [0] + b ans = 0 for i in range(n+1): can = k - a[i] if can < 0: break j = bisect.bisect_right(b, can) ans = max(ans, i+j-1) print(ans)
p02724
s226281180
Accepted
# -*- coding: utf-8 -*- X = int(input()) q500 = int(X/500) mod = X - (q500*500) q5 = int(mod/5) print(q500*1000 + q5*5)
p03543
s005339585
Accepted
a,b,c,d = input() print('Yes' if a==b==c or b==c==d else 'No')
p02792
s499783213
Accepted
#!/usr/bin/env python3 import sys sys.setrecursionlimit(10**8) input = sys.stdin.readline n = int(input()) cnt = [[0] * 10 for _ in range(10)] for i in range(1, n+1): s = str(i) front = int(s[0]) end = int(s[-1]) cnt[front][end] += 1 ans = 0 for i in range(1, 10): for j in range(1, 10): ans += cnt[i][j] * cnt[j][i] print(ans)
p02909
s982541242
Accepted
S = input() if S == 'Sunny': print('Cloudy') elif S == 'Cloudy': print('Rainy') else: print('Sunny')
p03481
s212182959
Accepted
X,Y = map(int,input().split()) ans = 0 while X <= Y: ans += 1 X *= 2 print(ans)
p03962
s242754212
Accepted
str = input().split() print(len(set(str)))
p02772
s954154689
Wrong Answer
_,a=open(0);print('ADPEPNRIOEVDE D'[any(a%3*a%5&~a for a in map(int,a.split()))::2])
p04031
s360954622
Wrong Answer
n = int(input()) A = list(map(int, input().split())) x = int((sum(A) / n) + 0.5) ans = 0 for a in A: ans += (a - x) ** 2 print(ans)
p02909
s578965524
Wrong Answer
print('CRSlauoinunndyyy'[id(id)%3::3])
p03543
s559470700
Accepted
# -*- coding: utf-8 -*- """ Created on Wed May 13 11:36:51 2020 @author: shinba """ n = list(input()) if (n[0] == n[1] and n[1] == n[2]) or (n[1] == n[2] and n[2] == n[3]): print("Yes") else: print("No")
p03427
s990253847
Accepted
Num = str(input()) L = len(Num) if Num[1:] == '9'*(L-1): val = int(Num[0]) + 9*(L-1) else: val = int(Num[0])-1 + 9*(L-1) print(val)
p02708
s003491122
Wrong Answer
def solution(): n, k = map(int, input().split()) ans = 0 for i in range(k, n+2): smallest = (i-1) * i / 2 largest = (n-i+1) * i + smallest ans += largest - smallest + 1 ans %= 10 ** 9 + 7 print(ans) solution()
p02714
s095019777
Wrong Answer
n = int(input()) s = input() from collections import Counter c = Counter(s) cnt = 0 for i in range(n): for a in range(1,n//2): j = i + a k = j + a if k >= n: break if (s[i] != s[j])&(s[j] != s[k])&(s[i] != s[k]): cnt += 1 else: continue print(c['R']*c['B']*c['G'] - cnt)
p03838
s335073420
Wrong Answer
x, y = map(int, input().split()) if x == y: print(0) exit() if abs(y) > abs(x): ans = abs(y) - abs(x) if x < 0: ans += 1 if y < 0: ans += 1 print(ans) else: print(abs(x) - abs(y) + 1)
p03041
s844798637
Accepted
N, K = map(int, input().split()) S = list(input()) A = S[K-1] S[K-1] = A.lower() print("".join(S))
p03339
s847287248
Accepted
N = int(input()) S = input() a = S[1:].count("E") ans = [a] for i in range(1,N): if S[i]=="E" and S[i-1]=="E": a -= 1 elif S[i]=="E" and S[i-1]=="W": a += 0 elif S[i]=="W" and S[i-1]=="E": a += 0 elif S[i]=="W" and S[i-1]=="W": a += 1 ans.append(a) print(min(ans))
p03696
s603147273
Accepted
N = int(input()) S = input() T = list(1 if c == "(" else -1 for c in S) l, l_min = 0, 0 r, r_min = 0, 0 for i in range(N): l += T[i] l_min = min(l_min, l) r -= T[N - i - 1] r_min = min(r_min, r) print("".join(["(" * -l_min, S, ")" * -r_min]))
p02814
s478411186
Wrong Answer
import fractions N,M = list(map(int,input().split())) a = list(map(int,input().split())) for i in range(N): a[i] = a[i]//2 semi_lcm = a[0] for i in range(1,N): semi_lcm = semi_lcm*a[i]//fractions.gcd(semi_lcm,a[i]) m = M//semi_lcm if m == 0: print(0) else: if m%2 == 1: print((m+1)//2) else: print(m//2)
p03817
s360666267
Accepted
x = int(input()) if x <= 6: print(1) elif x <= 11: print(2) else: ans = (x // 11) * 2 tmp = x % 11 if tmp == 0: print(ans) elif tmp <= 6: print(ans+1) else: print(ans+2)
p03435
s140613213
Accepted
c = [list(map(int,input().split())) for i in range(3)] if c[0][1]-c[0][0] == c[1][1]-c[1][0] == c[2][1]-c[2][0] and c[0][2]-c[0][1] == c[1][2]-c[1][1] == c[2][2]-c[2][1] and c[0][0]-c[1][0] == c[0][1]-c[1][1] == c[0][2]-c[1][2] and c[1][0]-c[2][0] == c[1][1]-c[2][1] == c[1][2]-c[2][2]: print("Yes") else: print("No")
p03852
s797481883
Accepted
boin = ['a','e','i','o','u'] print(['consonant','vowel'][input() in boin])
p04011
s980508281
Wrong Answer
s=input() print('Yes'if all(s.count(i)%2==0for i in s)else'No')
p03360
s196962338
Accepted
abc = list(map(int, input().split())) k = int(input()) mx = abc.pop(abc.index(max(abc))) print(mx * pow(2, k) + sum(abc))
p03860
s582426232
Accepted
name = input().split() print(name[0][0]+name[1][0]+name[2][0])
p02681
s611178753
Wrong Answer
S=input() T=input() S = S[0:-1] if S == T: print("Yes") else: print("No")
p03951
s402950378
Accepted
N = int(input()) s = input() t = input() ans = 2 * N for i in range(N): for j in range(N - i): if s[i + j] != t[j]: break else: ans = min(ans, N + i) print(ans)
p03838
s384142825
Accepted
def INT(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) x, y = MI() ans = 0 if abs(x) == abs(y): ans = int(x * y < 0) elif abs(x) < abs(y): ans = abs(abs(y) - abs(x)) + int(x < 0) + int(y < 0) else: ans = abs(abs(y) - abs(x)) + int(x * y <= 0) + int(x > 0 and y > 0) * 2 if x < 0 and y == 0: ans -= 1 print(ans)
p02613
s814022046
Wrong Answer
n = int(input()) result = ['AC','WA','TLE','RE'] c = [0]*4 for i in range(n): str = input() for n,r in enumerate(result): if str == r: c[n] += 1 for i in range(4): print(result[i], ' × ', c[i])
p02742
s055470711
Accepted
h,w=map(int,input().split()) if h==1 or w==1: print(1) exit() if h%2==1 and w%2==1: print((h*w+1)//2) else: print(h*w//2)
p02773
s850972702
Wrong Answer
import collections N = int(input()) S = [input() for i in range(N)] #重複チェック c = collections.Counter(S) value,count = zip(*c.most_common(len(c))) if len(set(count)) == 1: s = sorted(value) for i in s: print(i) else: for i in value: print(i) exit()
p02832
s079833627
Accepted
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def main(): N = int(input()) a = list(map(int, input().split())) num = 1 count = 0 for i in a: if i == num: num += 1 else: count += 1 if num == 1: print(-1) else: print(count) if __name__ == '__main__': main()
p02657
s501984317
Wrong Answer
def c169(x): x = x.split() x = map(lambda x:int(x),x) return(sum(x)) if __name__=="__main__": input = input() print(c169(input))
p02642
s120012509
Accepted
n=int(input()) alist=list(map(int,input().split())) alist.sort() hurui=[0]*(alist[-1]+1) for i in range(n): for j in range(1,alist[-1]//alist[i]+1): hurui[alist[i]*j]+=1 ans=0 for i in range(n): if hurui[alist[i]]==1: ans+=1 print(ans)
p02576
s316788994
Wrong Answer
N, X, T = map(int, input().split()) if N%X == 0: ans = (N/X)*T else: ans = (N//X +1)*T print(ans)