problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03633
s591790753
Accepted
import math n = int(input()) tL = [int(input()) for _ in range(n)] def lcm(x, y): return (x * y) // math.gcd(x, y) ans = tL[0] for t in tL[1:]: ans = lcm(t, ans) print(ans)
p03481
s836073615
Accepted
x,y=map(int,input().split()) cnt=0 while(x<=y): cnt+=1 x*=2 print(cnt)
p02767
s041094517
Accepted
n = int(input()) x = list(map(int, input().split())) ans = ((max(x)-min(x)))**2*n for i in range(min(x),max(x)+1): t = 0 for j in x: t+= (j-i)**2 ans = min(ans,t) print(ans)
p03075
s687520832
Accepted
import sys def input(): return sys.stdin.readline().strip() def main(): A = [int(input()) for _ in range(5)] k = int(input()) if A[-1] - A[0] > k: print(":(") else: print("Yay!") if __name__ == "__main__": main()
p03696
s206269588
Accepted
input() s=t=input() l,r=p='()' exec("t=t.replace(p,'');"*50) c=t.count print(l*c(r)+s+r*c(l))
p03803
s906943054
Wrong Answer
a, b = map(int, input().split()) if a == b: print("Draw") if a == 1: print("Alice") elif b == 1: print("Bob") elif a > b: print("Alice") else: print("Bob")
p02947
s351905915
Accepted
N=int(input()) dictionary={} count=0 for i in range(N): s="".join(sorted(input())) if s in dictionary: dictionary[s]+=1 count+=dictionary[s] else: dictionary[s]=0 print(count)
p02789
s021751464
Accepted
n, m = map(int,input().split()) if m == n: print("Yes") else: print("No")
p02718
s123210508
Wrong Answer
n,m=list(map(int,input().split())) a=list(map(int,input().split())) a.sort(reverse=True) cnt=0 for j in range(n): cnt+=a[j] b=[] for i in range(n): if a[i]>(cnt*(1/(4*m))): b.append(a[i]) if len(b) >= m: print("Yes") else: print("No")
p03103
s570465948
Accepted
import sys read = sys.stdin.read readline = sys.stdin.readline n, m = map(int, readline().split()) ab = map(int, read().split()) ab = sorted(zip(ab, ab)) ans = 0 for a, b in ab: drink = min(b, m) ans += a * drink m -= drink if m <= 0: break print(ans)
p03711
s771163517
Accepted
list1 = [1,3,5,7,8,10,12] list2 = [2] list3 = [4,6,9,11] x,y = map(int,input().split()) if (x in list1 and y in list1) or (x in list2 and y in list2) or (x in list3 and y in list3): print("Yes") else: print('No')
p03243
s445928240
Accepted
n,i=int(input()),1 while n>111*i: i+=1 print(111*i)
p02633
s825268905
Accepted
X = int(input()) K = 0 rad = 360 while rad != 0: rad -= X K += 1 if rad < 0: rad += 360 print(K)
p02832
s604439297
Accepted
n = int(input()) a = list(map(int,input().split())) if(1 in a): ans = 0 jud = 0 f = 1 for i in range(n): if(a[i]!=f): ans += 1 else: f += 1 print(ans) else: print(-1)
p03469
s598413752
Accepted
s=input() print(s[:3]+"8"+s[4:])
p02622
s386967935
Accepted
s = input() t = input() ans = 0 for idx in range(len(s)): if s[idx] != t[idx]: ans += 1 print(ans)
p02701
s503301755
Accepted
l=set() for _ in range(int(input())): l.add(input()) print(len(l))
p03644
s027851937
Wrong Answer
import math N = int(input()) a = math.floor(math.log(N, 2)) print(a)
p04029
s524218617
Wrong Answer
N = int (input ()) print ((N*(N+1))/2)
p03377
s128824350
Accepted
a,b,x=map(int,input().split()) if x<a or x-a>b: print("NO") else: print("YES")
p02995
s124406360
Accepted
#import math import fractions a,b,c,d = map(int,input().split()) def anti_div(a,b,c): aa = (a-1) - (a-1) // c bb = b - b // c return bb - aa # c,dの最小公倍数を求める # l = c*d / gcd #lcd = c // math.gcd(c,d) * d lcd = c // fractions.gcd(c,d) * d ans = anti_div(a,b,c) + anti_div(a,b,d) - anti_div(a,b,lcd) print(ans)
p03077
s871549675
Accepted
n = int(input()) a = [int(input()) for _ in range(5)] minimum = min(a) print((n + minimum - 1) // minimum + 4)
p03329
s175110556
Accepted
n = int(input()) INF = 10**5 answer = INF for i in range(n+1): money = i cnt = 0 while money > 0: cnt += money % 6 money //= 6 money = n-i while money > 0: cnt += money % 9 money //= 9 if answer > cnt: answer = cnt print(answer)
p02744
s142284331
Wrong Answer
import sys sys.setrecursionlimit(1000000) N = int(input()) alpha = [chr(ord('a') + i) for i in range(26)] def dfs(s, max_i): if len(s) == N: print(s) else: for i in range(97,max_i+1): dfs(s+chr(i), i+1) dfs('', 97)
p02675
s477926923
Accepted
n=int(input())%10 if n in[2,4,5,7,9]: print("hon") elif n==3: print("bon") else: print("pon")
p03821
s582354004
Wrong Answer
n = int(input()) l = [] r = [] for _ in range(n): a, b = map(int, input().split()) l.append(a) r.append(b) before_sa = 0 for i in range(1, n+1): j = 0 a, b = l[-i], r[-i] a += before_sa if a % b == 0: continue else: sa = (a//b + 1) * b - a before_sa = sa print(before_sa)
p02813
s572121678
Accepted
n = int(input()) p = list(map(int, input().split())) q = list(map(int, input().split())) from itertools import permutations l = [] for pp in permutations(range(1, n+1)): ll = [] for _p in pp: ll.append(_p) l.append(str(ll)) a = l.index(str(p)) b = l.index(str(q)) print(abs(a - b))
p02768
s827022219
Accepted
MOD = 10**9+7 def cmb2(n, r): x = 1 y = 1 for i in range(r): x = x * (n-i) % MOD y = y * (i+1) % MOD return x * pow(y, MOD-2, MOD) % MOD def main(): n, a, b = map(int, input().split()) ans = pow(2, n, MOD) ans -= 1 ans %= MOD ans -= cmb2(n, a) ans %= MOD ans -= cmb2(n, b) ans %= MOD print(ans) main()
p02583
s015833566
Wrong Answer
import itertools N = int(input()) L = list(map(int,(input().split()))) Combination = list(itertools.permutations(L, 3)) count = 0 for i in Combination: # a+b>c かつ b+c>a かつ c+a>b a = int(i[0]) b = int(i[1]) c = int(i[2]) if((a+b)> c and (b+c) >a and (c+a) >b and a!=b and b!= c and a!= c and a<b and b<c and a<c): count+=1 print(i) print(count)
p03994
s959053580
Accepted
a=input() n=len(a) m=int(input()) ans="" for i in range(n-1): if a[i]=="a": ans += "a" continue x=ord(a[i])-97 if m>=26-x: ans += "a" m -= 26-x else: ans += a[i] ans += chr((ord(a[n-1])-97+m)%26+97) print(ans)
p03286
s894307801
Wrong Answer
N = int(input()) ans = 0 def F(N): if(N == 0): return '' if(N % 2 == 0): return F(N//-2) + '0' else: return F((N-1)//-2) + '1' print(F(N))
p03136
s125834367
Wrong Answer
n=int(input()) l=list(map(int,input().split())) if max(l)<=(sum(l)-max(l)): print("Yes") else: print("No")
p02786
s820671976
Accepted
h = int(input()) ans = 0 if h == 1: print(1) exit() for i in range(h): ans += 2 ** i h//= 2 if h == 1: ans += 2 ** (i + 1) print(ans) exit()
p03860
s407792328
Accepted
a,b,c = input().split() print(a[0]+b[0]+c[0])
p02860
s580952304
Accepted
N=int(input()) S=input() print("Yes" if S[:N//2]==S[N//2:] else "No")
p03252
s447795297
Accepted
S, T = input().strip(), input().strip() ds, dt = {}, {} for s, t in zip(S, T): if s not in ds or ds[s] == t: ds[s] = t else: print('No') exit() if t not in dt or dt[t] == s: dt[t] = s else: print('No') exit() print('Yes')
p03243
s226007954
Accepted
n=int(input()) if n%111==0: print(n) else: print(((n//111)+1)*111)
p02899
s903355789
Accepted
import numpy as np n = int(input()) a = np.array(list(map(int, input().split()))) print(*list(map(lambda x : x + 1, np.argsort(a))))
p03681
s355376000
Accepted
N,M=map(int,input().split()) md=10**9+7 def P(m): ret=1 for i in range(1,m+1): ret = (ret*i)%md return ret if N<M: N,M=M,N MK = P(M) if N==M: ans=(2*(MK**2))%md elif N==M+1: ans=(MK**2)%md ans=(ans*N)%md else: ans=0 print(ans)
p02600
s965898684
Wrong Answer
x = int(input()) if x < 600: print(8) elif 600 <= x < 800: print(7) elif 800 <= x < 1000: print(6) elif 600 <= x < 800: print(5) elif 1200 <= x < 1400: print(4) elif 1400 <= x < 1600: print(3) elif 1600 <= x < 1800: print(2) elif 1800 <= x < 2000: print(1)
p03719
s493207443
Accepted
A, B, C = map(int, input().split()) if A<=C and B>= C: print('Yes') else: print('No')
p03469
s652015506
Accepted
s=input() s1=s.replace('7','8',1) print(s1)
p02683
s687361262
Accepted
N, M, X = map(int, input().split()) A = [list(map(int, input().split())) for _ in range(N)] ans = 10**9 + 10 for i in range(1, 2**N): money = 0 L = [0] * M for j in range(N): if (i >> j) & 1: money += A[j][0] for k in range(M): L[k] += A[j][k+1] if min(L) >= X and money < ans: ans = money if ans == 10**9+10: ans = -1 print(ans)
p03419
s741072233
Accepted
import math import sys import collections import bisect readline = sys.stdin.readline def main(): n, m = map(int, readline().rstrip().split()) if n == 1 or m == 1: print(abs(abs(n - m) - 1)) return print(abs((m - 2) * (n - 2))) if __name__ == '__main__': main()
p03852
s801665696
Accepted
vowel=["a","i", "u", "e", "o"] c=input() if c in vowel: print("vowel") else: print("consonant")
p02789
s934934850
Wrong Answer
s=input();print("YNeos"[s[0]!=s[-1]::2])
p02754
s750875567
Wrong Answer
n,b,r = map(int,input().split()) loop = n/(b+r) mod = n%(b+r) extra = min([b,mod]) print(int(loop*b + extra))
p03145
s659155940
Wrong Answer
AB, BC, CA = map(int, input().split()) print((BC*AB)/2)
p02660
s133641948
Accepted
from collections import defaultdict n = int(input()) arr = defaultdict(int) temp = n for i in range(2, int(-(-n**0.5//1))+1): if temp%i==0: cnt=0 while temp%i==0: cnt+=1 temp //= i arr[i] = cnt if temp!=1: arr[temp] = 1 if arr==[]: arr[n] = 1 ans = 0 for i in arr: c = 1 while arr[i]-c>=0: arr[i] -= c c += 1 ans += 1 print(ans)
p02772
s789401596
Accepted
N = int(input()) A = list(map(int, input().split())) B = [] for item in A: if item%2==0: B.append(item) cnt = 0 ans = '' for item in B: if item%3!=0: if item%5!=0: ans = 'DENIED' if ans!='DENIED': ans = 'APPROVED' print(ans)
p02675
s441278662
Accepted
N = int(input()) x = N%10 if x in [2, 4, 5, 7, 9]: print('hon') elif x in [0, 1, 6, 8]: print('pon') else: print('bon')
p03062
s028472126
Accepted
#!/usr/bin/env python # coding: utf-8 # In[8]: N = int(input()) A = list(map(int, input().split())) # In[9]: a_abs = list(map(abs,A)) minus_cnt = sum([1 for x in A if x < 0]) if minus_cnt%2 == 0: ans = sum(a_abs) else: ans = sum(a_abs) - min(a_abs)*2 print(ans) # In[ ]:
p02963
s214210083
Wrong Answer
S=int(input()) if S == 10**18: print(0,0,10**9,1,0,10**9) else: q,r = S//10**9, S%10**9 print(0,0,10**9,1,q+1,10**9-r)
p03785
s041234917
Accepted
N, C, K = map(int, input().split()) T = sorted([int(input()) for i in range(N)]) bs = 0 st = 0 ans = 0 for t in T: if bs == 0: st = t if bs == C or t-st>K: bs = 1 st = t ans += 1 else: bs += 1 if bs > 0: ans += 1 print(ans)
p03387
s948085685
Wrong Answer
a=list(map(int,input().split())) a=sorted(a) dist1=a[2]-a[0] dist2=a[2]-a[1] if (dist1%2)==0 and (dist2%2)==0: ans=(dist1+dist2)//2 print(ans) elif (dist1%2)==1 and (dist2%2)==1: ans=(dist1+dist2)//2 print(ans) elif (dist1%2)==2 and (dist2%2)==1: ans=(dist1//2)+(dist2+1)//2 print(ans) else: ans=(dist2//2)+(dist1+1)//2 print(ans)
p03804
s493016537
Accepted
n, m = map(int, input().split()) a, b = [], [] for i in range(n): a.append(input()) for i in range(m): b.append(input()) ans = False for i in range(n-m+1): for j in range(n-m+1): flag = True for k in range(m): if a[i+k][j:j+m] != b[k]: flag = False if flag: ans = True if ans: print("Yes") else: print("No")
p02742
s465215498
Accepted
import sys def input(): return sys.stdin.readline()[:-1] H,W = map(int,input().split(' ')) A = -(-W//2) if W==1 or H==1: print(1) exit() if H%2==0: print(W*H//2) else: print(W*(H-1)//2+A)
p03797
s694134480
Accepted
n,m=map(int,input().split()) part1 = n part2 = m if n*2 < m: part3 = (m-(n*2))//4 print(n+part3) elif n*2 > m: print(m//2)
p02624
s576159708
Wrong Answer
n = int(input()) cnt_tb = [0]*n for i in range(1, n + 1): j = 1 tmp = i*j while (tmp < n): cnt_tb[tmp] += 1 j += 1 tmp = i*j ans = 0 for i, cnt in enumerate(cnt_tb): ans += (i + 1) * cnt print(ans)
p03799
s676546473
Accepted
n, m = map(int, input().split()) ans = 0 if n*2 <= m: ans += n + (m-n*2)//4 print(ans) else: ans += m//2 print(ans)
p02548
s980697452
Wrong Answer
n = int(input()) count = 0 for a in range(1,10**6): if n - a <= 0: exit() for b in range(a,10**6): if n - a*b > 0: if a == b: count += 1 else: count += 2 if n -a*b <= 0: break print(count)
p03475
s249232306
Accepted
N = int(input()) CSF = [list(map(int, input().split())) for i in range(N-1)] import math for i in range(N): time = 0 for csf in CSF[i:]: if time <= csf[1]: time = csf[1] + csf[0] else: time = math.ceil((time - csf[1]) / csf[2])*csf[2] + csf[1] + csf[0] print(time)
p02922
s478107993
Accepted
a, b = map(int, input().split()) print(-(-(b-1)//(a-1)))
p03293
s501531873
Wrong Answer
s=list(input()) t=list(input()) s.sort() t.sort() if s==t: print("Yes") else: print("No")
p02859
s336681901
Wrong Answer
r = int(input()) m = 3.14159265359*r*r ans = int(m/3.14) print(ans)
p02847
s050844559
Accepted
store = {"SUN":7,"MON":6,"TUE":5,"WED":4,"THU":3,"FRI":2,"SAT":1} s = input() print(store[s])
p03854
s659314070
Accepted
s = input()[::-1] # 反転 template = list('dream dreamer erase eraser'.split()) template = [c[::-1] for c in template] # 反転 while s: for c in template: if s.startswith(c): s = s[len(c):] break else: break print("YES") if s == "" else print("NO")
p03319
s170071136
Wrong Answer
import math N, K = map(int, input().split()) A = list(map(int, input().split())) one_idx = A.index(1) before = math.ceil(one_idx / (K - 1)) after = math.ceil((N - one_idx - 1) / (K - 1)) print(before + after)
p02933
s184388871
Accepted
# Red or Not a = int(input()) s = input() if a < 2800 or 5000 <= a: print('数値が範囲外です') if len(s) < 1 or 10 < len(s): print('文字数が範囲外です') elif a < 3200: print('red') else: print(s)
p03323
s904453464
Accepted
line = input() A, B = [int(n) for n in line.split()] if A > 8 or B > 8: print(":(") else: print("Yay!")
p02918
s409494133
Accepted
""" 1度の操作で最大+2できる 隣り合う箇所はN-1 LないしRが連続している箇所をグループとして見ると、求める数は N-1-隣り合うグループが異なっている場所の個数 = N-1-(グループの個数-1) """ import sys sys.setrecursionlimit(10**6) n, k = map(int, input().split()) s = input() score = 0 for i in range(n-1): if s[i] == s[i+1]: score += 1 ans = min(score+2*k, n-1) print(ans)
p02789
s397148517
Wrong Answer
str1, str2 = [s for s in input().split()] a = str1*int(str2) b = str2*int(str1) if str1 > str2: print(b) elif str1 < str2: print(a) else: print(a)
p03281
s701073728
Accepted
n = int(input()) ans = 0 for i in range(105,n+1,2): c=0 for d in range(1,i+1,2): if i % d == 0: c+=1 if c == 8: ans += 1 print(ans)
p02862
s470107964
Wrong Answer
def nCr(n, r): mod=10**9+7 r = min(r, n-r) numer = denom = 1 for i in range(1, r+1): numer = numer * (n+1-i) % mod denom = denom * i % mod return numer * pow(denom, mod-2, mod) % mod x,y=map(int,input().split()) if (x+y)%3 or max(x,y)>min(x,y)*2: print(0) exit() f=(x+y)//3 m=-(1/3)*x+(2/3)*y n=f-m print(nCr(int(f),int(m)))
p03699
s776492288
Accepted
N = int(input()) S = [] for i in range(N): S.append(int(input())) S.sort() if sum(S)%10!=0: print(sum(S)) else: for i in range(N): if S[i]%10!=0: print(sum(S)-S[i]) break elif i==N-1: print(0) break
p03637
s662784771
Accepted
N = int(input()) a = list(map(int, input().split())) cnt = 0 cnt1 = 0 for i in range(len(a)): if(a[i]%4==0): cnt += 1 elif(a[i]%2 == 0): cnt1 += 1 if(cnt+cnt1//2 >= N//2): print("Yes") else: print("No")
p02935
s292402242
Wrong Answer
N = int(input()) a = map(int, input().split()) # N = 3 # a = [200, 300, 500] s = sorted(a) t = 0 result = 0 for i in range(0, N-1): if i == N - (N - 1): result = (t + s[i+1]) / 2 z = (s[i] + s[i+1]) / 2 t = z print(result)
p03274
s456593619
Wrong Answer
[N,K] = list(map(int,input().split())) x = list(map(int,input().split())) #連続する蝋燭を全探索 l=0 r=K-1 ans=2*(10**8)+1 for i in range(N-K+1): print('x[l], x[r]:', x[l], x[r]) # ans = min(ans, min(abs(x[l]), abs(x[r])) + x[r]-x[l]) l+=1 r+=1 print(ans)
p02761
s825209126
Wrong Answer
N, M = list(map(int,input().split())) s = [0]*M c = [0]*M for i in range(M): s[i], c[i] = list(map(int,input().split())) s[i] -= 1 err = False digit = [0]*N digit_bool = [False]*N for i in range(M): if digit_bool[s[i]]: if digit[s[i]] != c[i]: err = True else: digit[s[i]] = c[i] digit_bool[s[i]] = True if digit[0] == 0: err = True if err: print('-1') else: print(''.join(list(map(str,digit))))
p02719
s105421179
Accepted
N, K = list(map(int, input().split())) print(min(N%K,abs(N-((N//K)+1)*K)))
p03637
s218431534
Accepted
n = int(input()) a = list(map(int, input().split())) num4 = 0 num2 = 0 for i in range(n): if a[i]%4 == 0: num4 += 1 elif a[i]%2 == 0: num2 += 1 #print(num4, num2) if n-num4*2 <= 1: print("Yes") elif n-num4*2 <= num2: print("Yes") else: print("No")
p02963
s321570036
Accepted
S = int(input()) X1 = 0 Y1 = 0 X2 = 10**9 Y2 = 1 X3 = S%(10**9) Y3 = S//(10**9) if X3 != 0: Y3 += 1 X3 = X2 - X3 print(X1,Y1,X2,Y2,X3,Y3)
p02939
s951430941
Wrong Answer
s = input() s_len = len(s) check = s[0:2] if s_len == 2 and s[0] != s[1]: print(2) exit() s = s+"1" ind = 1 ans = 1 for i in range(2,s_len): if check == s[ind+1]: check = s[ind+1:ind+3] ind += 1 else: check = s[ind+1] ind += 1 ans += 1 if ind >= s_len-1: break if ind == s_len+1 and s[s_len-1] == s[s_len-2]: ans -= 1 print(ans)
p02761
s567335804
Accepted
N, M = map(int, input().split()) sc = [list(map(int, input().split())) for _ in range(M)] ans = 0 exist = False if N == 1: x = 0 else: x = 10 ** (N - 1) for i in range(x, 1000): s = str(i) f = True for j in range(M): if int(s[sc[j][0] - 1]) != sc[j][1]: f = False break if f: ans = i exist = True break print(ans if exist else -1)
p03472
s534226839
Accepted
n, h = map(int, input().split()) a = [0] * n b = [0] * n for i in range(n): a[i], b[i] = map(int, input().split()) a = sorted(a, reverse=True) b = sorted(b, reverse=True) ans = 0 i = 0 while i < n and b[i] > a[0]: h -= b[i] ans += 1 if h <= 0: print(ans) exit() i += 1 print(ans + (h + a[0] - 1) // a[0])
p02820
s198876507
Wrong Answer
a, b, t = open(0) n, k = map(int, a.split()) r, s, p = map(int, b.split()) d = {"r": p, "s": r, "p": s} l = [0]*n for i, s in enumerate(list(t.strip())): c = d[s] if i-k >= 0 and l[i-k] == c: continue l[i] = c print(sum(l))
p02971
s084450556
Wrong Answer
N=int(input()) A=sorted([int(input()) for _ in range(N)]) B=A[:N-1] for i in range(N): if i==N-1: print(max(B)) else: print(max(A))
p02602
s014981657
Accepted
N, K = map(int, input().split()) A = list(map(int,input().split())) i = 0 while i+K<N: if A[i]<A[K+i]: print('Yes') i += 1 else: print('No') i += 1
p04031
s837807309
Wrong Answer
import math N = int(input()) A = [int(x) for x in input().split()] s = sum(A) ave = s / N if s % 2 == 0: ave = s // N ans = [(x - ave)**2 for x in A] ans = sum(ans) print(ans) exit() else: ave1, ave2 = math.ceil(s / N), math.floor(s / N) ans1 = [(x - ave1)**2 for x in A] ans2 = [(x - ave2)**2 for x in A] ans = min(sum(ans1), sum(ans2)) print(ans)
p02641
s748310542
Wrong Answer
def main(): x,n = map(int,input().split()) p = list(map(int,input().split())) ans = -100 for i in range(-1,101): if i not in p and abs(i-x) < abs(ans-x): ans = i print(ans) return if __name__ == '__main__': main()
p02832
s874236766
Accepted
n = int(input()) a = [int(x) for x in input().split()] cnt = 1 br = 0 for i in a: if i == cnt: cnt += 1 else: br += 1 if br == n: br = -1 print(br)
p03545
s915665054
Accepted
a,b,c,d = input() for x in '+-': for y in '+-': for z in '+-': f = a + x + b + y + c + z + d if eval(f) == 7: print(f + '=7') exit()
p03745
s067745722
Accepted
N = int(input()) A = list(map(int, input().split())) up_or_down = 0 ans = 1 for i in range(len(A) - 1): if up_or_down == 0: up_or_down = A[i+1] - A[i] else: if up_or_down > 0 and A[i+1] - A[i] < 0: ans += 1 up_or_down = 0 elif up_or_down < 0 and A[i+1] - A[i] > 0: ans += 1 up_or_down = 0 print(ans)
p02702
s013399415
Accepted
S = input() M = 2019 cnt = [0] * M cnt[0] = 1 N = 0 ans = 0 for i, n in enumerate(map(int, S[::-1])): N = (N + n * pow(10, i, M)) % M ans += cnt[N] cnt[N] += 1 print(ans)
p03455
s024498132
Accepted
a, b = map(int, input().split()) if a * b % 2 == 0: print('Even') else: print('Odd')
p02731
s516553725
Wrong Answer
l=int(input()) ans=0 for i in range(0,l+1): for j in range(0,l+1): e=l-i-j ans=max(i*j*e,ans) print(ans)
p02797
s143402125
Accepted
[N, K, S] = [int(i) for i in input().split()] ans = [str(S)]*N if S != 10**9: for i in range(K, N): ans[i] = str(S+1) else: for i in range(K, N): ans[i] = str(1) print(' '.join(ans))
p02727
s211290908
Accepted
from heapq import heappush, heappop, heapify x,y,a,b,c = map(int, input().split()) p = sorted(list(map(int, input().split())), reverse=True) q = sorted(list(map(int, input().split())), reverse=True) r = sorted(list(map(int, input().split())), reverse=True) R = p[:x] B = q[:y] heapify(R) heapify(B) for i in range(c): if min(R[0],B[0]) > r[i]: break if R[0] < B[0]: heappop(R) heappush(R,r[i]) else: heappop(B) heappush(B,r[i]) print(sum(R) + sum(B))
p02795
s895901095
Accepted
#coding:utf-8 h = int(input()) w = int(input()) n = int(input()) #切り上げ if h >= w: print(-(-n//h)) else: print(-(-n//w))
p02813
s211755570
Wrong Answer
from itertools import permutations N = int(input()) P = tuple(map(int, input().split())) Q = tuple(map(int, input().split())) a, b = 0, 0 for i, l in enumerate(permutations(range(1, N+1))): if l==P: a = i elif l==Q: b = i print(abs(a-b))