problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03711
s658401776
Accepted
x,y = map(int, input().split()) a = [1,3,5,7,8,10,12] b = [4,6,9,11] c = [2] if x in a and y in a or x in b and y in b: print("Yes") else: print("No")
p04033
s362515978
Accepted
def solve(a,b): if a <= 0 and b >= 0: return "Zero" elif a < b < 0 and (b-a+1) % 2 == 1: return "Negative" else: return "Positive" a,b = map(int,input().split()) print(solve(a,b))
p03836
s674269494
Accepted
sx,sy,tx,ty = map(int, input().split()) diff_x = tx-sx diff_y = ty-sy first_path = 'U'*diff_y + 'R'*diff_x + 'D'*diff_y + 'L'*diff_x second_path = 'L' + 'U'*diff_y + 'U' + 'R' + 'R'*diff_x + 'D' + \ 'R' + 'D'*diff_y + 'D' + 'L' + 'L'*diff_x + 'U' print(first_path+second_path)
p03645
s224441481
Accepted
n,m=map(int,input().split()) d={i:[] for i in range(n)} n-=1 for i in range(m): a,b=map(int,input().split()) a-=1 b-=1 d[a].append(b) d[b].append(a) for i in d[0]: if n in d[i]: print('POSSIBLE') exit() print('IMPOSSIBLE')
p03324
s727045143
Accepted
D,N=map(int,input().split()) p=0 if N==100: print(pow(100,D+1)+pow(100,D)) else: print(pow(100,D)*N)
p03711
s148529941
Accepted
x, y = map(int, input().split()) ga = [4,6,9,11] gb = [1,3,5,7,8,10,12] gc = [2] xg = yg = "" def group(x): if x in ga: return "ga" if x in gb: return "gb" if x in gc: return "gc" xg = group(x) yg = group(y) if xg == yg: print("Yes") else: print("No")
p02687
s789592499
Accepted
S = input() if S == "ARC": ans = "ABC" else: ans = "ARC" print(ans)
p03796
s352207432
Accepted
from functools import reduce N = int(input()) div = pow(10, 9) + 7 print(reduce(lambda ans, n: ans * n % div, range(1, N + 1)))
p03639
s382775060
Wrong Answer
n=int(input()) l=list(map(int,input().split())) c_4=0 even=0 odd=0 for i in l: if i%4==0: c_4+=1 elif i%2==0: even+=1 else: odd+=1 if even==0 and odd <= c_4: ans="Yes" else: ans="No" if even>0 and odd <= c_4: ans="Yes" else: "No" print(ans)
p02627
s150121912
Accepted
a = input() if a.isupper()==1: print("A") else: print("a")
p04012
s362152802
Accepted
w=input() x=list(sorted(set(w))) flag=1 for i in x: if w.count(i)%2!=0: flag=0 break print('Yes' if flag==1 else 'No')
p02743
s271727652
Accepted
a,b,c = map(int,input().split()) if c > a+b and 4*a*b < (c-a-b)**2: print("Yes") else: print("No")
p02694
s085907904
Accepted
import math x=int(input()) a=100 result=0 while a<x: a=math.floor(a*1.01) result+=1 print(result)
p03665
s251508990
Accepted
import collections, math def combinations_count(n, r): return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) N, P = map(int, input().split()) A = list(map(int, input().split())) for i in range(N): A[i] = A[i] % 2 c = collections.Counter(A) zero = c[0] one = c[1] ans = 0 if P == 0: for i in range(0, one + 1, 2): ans += (2 ** zero) * (combinations_count(one, i) ) else: for i in range(1, one + 1, 2): ans += (2 ** zero) * (combinations_count(one, i) ) print(ans)
p02675
s503887638
Accepted
n = int(input()) while n >= 10: n = n % 10 if n == 2 or n==4 or n == 5 or n==7 or n== 9: print('hon') elif n == 0 or n==1 or n == 6 or n==8: print('pon') elif n== 3: print('bon')
p03001
s631437984
Accepted
w,h,x,y = map(int,input().split()) half = w*h/2 msg = 0 if x == w/2 and y == h/2: msg = 1 print(half, msg)
p03696
s519451276
Accepted
n = int(input()) s = str(input()) left_count = 0 right_count = 0 dif = 0 for i in range(len(s)): if s[i] == '(': left_count += 1 elif s[i] == ')': if left_count > 0: left_count -= 1 else: right_count += 1 ans = '(' * right_count + s + ')' * left_count print(ans)
p02731
s767713883
Accepted
L=int(input()) print((L/3)**3)
p02755
s098731651
Wrong Answer
A,B = map(int,input().split()) PA = int(-(-A // 0.08)) if int(PA*0.1) == B: print(PA) else: print(-1)
p02777
s481874275
Wrong Answer
tmp = input().split() S = tmp[0] T = tmp[1] i = list(map(int, input().split())) A = i[0] B = i[1] U = input() if S == U: print(str(A-1) + " " + str(B)) else: print(str(B-1) + " " + str(A))
p03481
s892143380
Accepted
def solve(): x,y = map(int,input().split()) cnt = 0 while x<=y: x*=2 cnt+=1 print(cnt) if __name__=='__main__': solve()
p02897
s471316491
Wrong Answer
def odds_of_oddness(n): return (n/2)/n if n%2 == 0 else int(n//2)+1 / n def main(): n = int(input()) print(odds_of_oddness(n)) if __name__ == '__main__': main()
p02582
s999037686
Accepted
S = input() if 'RRR' in S: print(3) elif 'RR' in S: print(2) elif 'R' in S: print(1) else: print(0)
p03380
s962970396
Accepted
import bisect N = int(input()) a = sorted(list(map(int,input().split()))) ans = [] for i in range(1,N): candind = bisect.bisect_left(a,a[i]/2) if candind == i: candind -= 1 cand = a[candind] elif candind == 0: cand = a[candind] else: if a[candind]-a[i]/2 <= a[i]/2-a[candind-1]: cand = a[candind] else: cand = a[candind-1] ans.append([a[i],cand]) ans.sort() print(*ans[-1])
p02631
s549977887
Wrong Answer
N = int(input()) A = list(map(int, input().split())) # m = bin(10**9)[2:] # print(int('11010', 2)) # print(26^19^12) first = 0 tmp = 0 for (i, a) in enumerate(A): if i == 0: first = a continue else: xor = first^a tmp = tmp^xor f = tmp^first print(f) for (i, a) in enumerate(A): if i == 0: continue else: print(f^a)
p03543
s274658913
Accepted
a=input() b=set(a[:-1]);c=set(a[1:]) if len(b)==1 or len(c)==1: print('Yes') else: print('No')
p02988
s224435758
Wrong Answer
n=int(input()) p=list(map(int,input().split())) count=0 for i in range(1,n-2): if p[i-1] < p[i] < p[i+1] or p[i+1] < p[i] < p[i-1]: count+=1 print(count)
p03797
s695667572
Accepted
def solve(): N, M = list(map(int, input().split())) remain_c = M - N * 2 if remain_c <= 0: return M // 2 else: return N + (remain_c // 4) if __name__ == '__main__': res = solve() print(res)
p02688
s095471715
Wrong Answer
N,K = map(int,input().split()) ls = [0 for i in range(N)] for i in range(K): d = int(input()) A = list(map(int,input().split())) for j in range(d): ls[A[j]-1] += 1 for i in range(N): if ls[i] == 0: print(i+1)
p03077
s429053735
Accepted
n = int(input()) l = [int(input()) for _ in range(5)] bottle = min(l) print(4 + (n // bottle) + (n % bottle != 0))
p03698
s056249212
Accepted
def i(): return str(input()) def i2(): return map(int,input().split()) def s(): return str(input()) def l(): return list(input()) def intl(): return list(int(k) for k in input().split()) s = i() if len(s) == len(set(s)): print('yes') else: print('no')
p02612
s653433158
Accepted
n=int(input()) i=0 N=n while n>0: n-=1000 i+=1 print(i*1000-N)
p02714
s067456126
Accepted
n=int(input());s=[*input()];count=0 count=s.count('R')*s.count('G')*s.count('B') for i in range(n+1): for j in range(i,n+1): k=2*j-i if k<n: if s[i]!=s[j] and s[j]!=s[k] and s[i]!=s[k]: count-=1 print(count)
p03624
s909040725
Accepted
S = list(input()) S = list(set(S)) ans = "None" for i in range(97, 123): cnt = chr(i) if not cnt in S: ans = cnt break print(ans)
p02787
s016544425
Accepted
import sys readline = sys.stdin.readline INF = 10 ** 8 def main(): H, N = map(int, readline().rstrip().split()) dp = [INF] * (H + 1) # HPを減らすのに必要な最小のMP dp[0] = 0 for _ in range(N): hp, mp = map(int, readline().rstrip().split()) for i in range(H): j = min(i+hp, H) dp[j] = min(dp[j], dp[i] + mp) print(dp[-1]) if __name__ == '__main__': main()
p02910
s319832457
Wrong Answer
N=str(input()) if 'R' in N[0::2] or 'L' in N[1::2]: print('No') else: print('Yes')
p02747
s775438026
Accepted
S = input() S = S.replace("hi", "") if S: print("No") else: print("Yes")
p03042
s665328946
Accepted
s = (input()) a= s[0:2] b= s[2:4] a = int(a) b= int(b) if a == 0 or b == 0: if b!= 0 and b<13: print('YYMM') elif a!= 0 and a<13: print('MMYY') else: print('NA') elif a<13 or b<13: if a>12: print('YYMM') elif b>12: print('MMYY') else: print('AMBIGUOUS') else: print('NA')
p03557
s040027961
Accepted
import bisect N = int(input()) A = sorted([int(_) for _ in input().split()]) B = sorted([int(_) for _ in input().split()]) C = sorted([int(_) for _ in input().split()]) cnt = 0 for i in range(N): j = bisect.bisect_left(A,B[i]) k = bisect.bisect_right(C,B[i]) cnt += j*(N-k) print(cnt)
p03042
s520442879
Accepted
s = input() s1 = int(s[0])*10 + int(s[1]) s2 = int(s[2])*10 + int(s[3]) #print(s1, s2) if (s1>12 or s1==0) and (s2>12 or s2==0): print('NA') elif (s1>12 or s1==0) and 1<=s2<=12: print('YYMM') elif (s2>12 or s2==0) and 1<=s1<=12: print('MMYY') elif 1<=s1<=12 and 1<=s2<=12: print('AMBIGUOUS')
p02897
s401983463
Wrong Answer
N = int(input()) print((N//2)/N if N!=1 else 1)
p03545
s486028957
Wrong Answer
def main(): A, B, C, D = input() for i in range(2**3): op = ['+', '+', '+'] for j in range(len(op)): if (i >> j) & 1: op[j] = '-' if eval(A + op[0] + B + op[1] + C + op[2] + D) == 7: print(A + op[0] + B + op[1] + C + op[2] + D + '=7') break main()
p02711
s131728153
Wrong Answer
import math k = int(input()) sum = 0 for a in range(1,k+1): for b in range(1,k+1): ab = math.gcd(a,b) for c in range(1,k+1): sum += math.gcd(ab,c) print(sum)
p02900
s329964944
Accepted
def p(n): i = 2 t = [] while i * i <= n: while n % i == 0: n //= i t.append(i) i += 1 if n > 1: t.append(n) return t def main(): from fractions import gcd a, b = map(int, input().split()) g = gcd(a, b) print(len(set(p(g))) + 1) if __name__ == '__main__': main()
p03486
s173175400
Accepted
s = input() l_s = "".join(sorted(s)) t= input() l_t = "".join(sorted(t, reverse=True)) if l_s < l_t: print("Yes") else : print("No")
p03221
s484830011
Accepted
n,m=map(int,input().split()) pys=[0]*m for i in range(m): p,y=map(int,input().split()) pys[i]=(p,y,i) pys.sort(key=lambda x:x[1]) num=[0]*n ans=[0]*m for p,y,i in pys: num[p-1]+=1 ans[i]=str(p).zfill(6)+str(num[p-1]).zfill(6) for a in ans: print(a)
p03416
s777528513
Wrong Answer
a, b = map(int, input().split()) counter = 0 for i in range(a, b+1): if str(i)[:2] == reversed(str(i)[3:]): counter += 1 print(counter)
p03419
s105101169
Accepted
def main(): ans = 0 n,m = map(int, input().split()) if n == m == 1: ans = 1 elif n == 1 or m == 1: ans = max(n,m)-2 else: ans = (n-2)*(m-2) print(ans) if __name__ == '__main__': main()
p03962
s769245528
Accepted
#ABC046A https://atcoder.jp/contests/abc046/tasks/abc046_a a,b,c=(int(x) for x in input().split()) if a==b and b==c and c==a: print(1) elif a!=b and b!=c and c!=a: print(3) else: print(2)
p03821
s733999274
Wrong Answer
N = int(input()) AB = [0] * N for n in range(N): AB[-1-n] = [int(x) for x in input().strip().split()] ans = 0 cnt = 0 for (a, b) in AB: if (a + cnt) % b == 0: if a + cnt == 0: cnt += b ans += b else: t = b - ((a + cnt) % b) cnt += t ans += t print(ans)
p03719
s543881598
Accepted
a, b, c = map(int, input().split()) if c>=a and c<=b: print('Yes') else: print('No')
p03345
s408707451
Accepted
a,b,c,k = map(int,input().split()) if abs(a - b) > 10**18: print("unfair") exit() if k % 2 == 0: print(a-b) else: print(b-a)
p02719
s994775183
Wrong Answer
n, k = map(int,input().split()) print(min(abs(n - k * int(n/k)), abs(n - k * (int(n/k) + 1))))
p03264
s581810188
Accepted
# -*- coding: utf-8 -*- k = int(input()) if k % 2 != 0: ans = (k // 2) * (k // 2 + 1) else: ans = (k // 2) ** 2 print(ans)
p03696
s909444234
Accepted
N = int(input()) S = input() ans = S count = 0 for i in range(N): if(S[i] == "("): count += 1 else: count -= 1 if(count<0): ans = "(" + ans count += 1 count = 0 for i in range(N-1,-1,-1): if(S[i] == "("): count += 1 else: count -= 1 if(count>0): ans = ans + ")" count -= 1 print(ans)
p03163
s086700299
Accepted
n,w = map(int,input().split()) v = [0]*n for i in range(n): v[i] = list(map(int,input().split())) dp = [[0 for j in range(w+1)] for i in range(n+1)] for i in range(n): for j in range(w+1): if j - v[i][0] >= 0: if dp[i][j-v[i][0]] + v[i][1] > dp[i][j]: dp[i+1][j] = dp[i][j-v[i][0]] + v[i][1] dp[i+1][j] = max(dp[i+1][j],dp[i][j]) print(dp[-1][-1])
p02888
s173674686
Accepted
import bisect N = int(input()) L = sorted(list(map(int, input().split()))) def valid(i, j ,x): if x < i + j: return True else: return False ans = 0 for i in range(N-2): for j in range(i+1, N-1): # L[j]より大きくて、L[i] + L[j]より小さい棒を選ぶと三角形を作ることができる。 insert_point = bisect.bisect_left(L, L[i] + L[j]) ans += insert_point - j - 1 print(ans)
p03624
s037681644
Accepted
s = input() ascii_lowercase = list('abcdefghijklmnopqrstuvwxyz') s = list(s) s = set(s) s = list(s) s = sorted(s) n = len(s) flag = 0 for i in range(n): if s[i] != ascii_lowercase[i]: print(ascii_lowercase[i]) flag = 1 break if len(s) != len(ascii_lowercase) and flag != 1: print(ascii_lowercase[len(s)]) elif flag != 1: print('None')
p03679
s381590222
Accepted
x,a,b=map(int,input().split()) print("delicious" if b<=a else ("safe" if b<=a+x else "dangerous"))
p03042
s899513452
Accepted
z = input() x = int(z[:2]) y = int(z[2:]) if (0<x <= 12): if (0<y<= 12): print("AMBIGUOUS") else: print("MMYY") elif (0<y <= 12): if (0<x<= 12): print("AMBIGUOUS") else: print("YYMM") else: print("NA")
p02787
s229440331
Accepted
H, N = map(int, input().split()) AB = [] for i in range(N): tmp = list(map(int, input().split())) AB.append(tmp) dp = [10**9] * (H+1) dp[0] = 0 for i in range(N): for j in range(H+1): a, b = AB[i] if j < a: dp[j] = min(dp[0]+b, dp[j]) else: dp[j] = min(dp[j-a]+b, dp[j]) print(dp[H])
p02702
s547576356
Accepted
ss=input().rstrip() x=1 y=0 mod=[0]*3000 ans=0 mod[0]=1 for i in range(len(ss)): s=ss[i*(-1)-1] n=int(s) y=(y+x*n)%2019 ans+=mod[y] mod[y]+=1 x=(x*10)%2019 print(ans)
p03557
s891970580
Accepted
# 二分探索法を利用する場合 from bisect import bisect_left, bisect_right N = int(input()) A = list(int(i) for i in input().split()) B = list(int(i) for i in input().split()) C = list(int(i) for i in input().split()) # sortの計算量はO(nlogn) A.sort() B.sort() C.sort() ans = 0 for i in range(N): x = bisect_left(A,B[i]) y = bisect_right(C,B[i]) ans += x*(N-y) print(ans)
p03836
s325547450
Wrong Answer
sx, sy, tx, ty = map(int, input().split()) ans = '' diff_x = tx - sx diff_y = ty - sy ans += 'R' * diff_x ans += 'U' * diff_y * 2 ans += 'R' * diff_x ans += 'D' ans += 'R' * (diff_x + 1) ans += 'U' * (diff_y + 1) ans += 'L' * 2 ans += 'U' * (diff_y + 1) ans += 'R' * (diff_x + 1) ans += 'D' print(ans)
p03239
s852607048
Accepted
N, T = input().split() N = int(N) T = int(T) import numpy as np c = np.zeros(N) t = np.zeros(N) for i in range(N): c[i], t[i] = input().split() c[i] = int(c[i]) t[i] = int(t[i]) if t[i] > T : c[i] = 1001 if min(c) == 1001: print('TLE') else: print(int(min(c)))
p02548
s276982438
Wrong Answer
import os,sys n=int(input()) if n%2==1: m=n+1 m=n//2 count=m for a in range(1,m): i = n//a for b in range(1,i+1): if a*b<=n-1: count+=1 print(count)
p02570
s183464415
Accepted
line = input().split() D = int(line[0]) T = int(line[1]) S = int(line[2]) if(D/S > T): print("No") else: print("Yes")
p02675
s731245868
Accepted
tmp = input().split() N = int(tmp[0]) LastN = N%10 if LastN == 3: print('bon') elif LastN == 0 or LastN == 1 or LastN == 6 or LastN == 8: print('pon') else: print('hon')
p02553
s880945467
Accepted
a,b,c,d=map(int,input().split()) ans=[a*c,a*d,b*c,b*d] print(max(ans))
p03250
s591053962
Accepted
l = list(map(int,input().split())) l.sort() print(l[2]*10+l[0]+l[1])
p04011
s020560051
Accepted
li = list(int(input()) for i in range(4)) if li[0] > li[1]: ans = li[1]*li[2] + (li[0]-li[1])*li[3] else: ans = li[0]*li[2] print(str(ans))
p03162
s074592109
Accepted
import sys # read = sys.stdin.read input = sys.stdin.readline # readlines = sys.stdin.readlines days = int(input()) prev = [0, 0, 0] while days: nxt = [0, 0, 0] a, b, c = map(int, input().split()) nxt[0] = a + max(prev[1], prev[2]) nxt[1] = b + max(prev[0], prev[2]) nxt[2] = c + max(prev[0], prev[1]) prev = nxt days -= 1 print(max(prev))
p03624
s028020383
Accepted
s = input() alpha = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] l = list(set(alpha) - set(s)) l.sort() print(l[0] if len(l) != 0 else "None")
p02723
s301476760
Accepted
S = input() print("Yes" if S[2]==S[3] and S[4]==S[5] else "No")
p03624
s131254202
Accepted
s=input() sets=set(s) for i in range(97,123): if not chr(i) in sets: print(chr(i)) exit() print("None")
p02600
s142095093
Wrong Answer
X = int(input()) if X <= 400 and X <= 599: print(8) elif 600 <= X and X <= 799: print(7) elif 800 <= X and X <= 999: print(6) elif 1000 <= X and X <= 1199: print(5) elif 1200 <= X and X <= 1399: print(4) elif 1400 <= X and X <= 1599: print(3) elif 1600 <= X and X <= 1799: print(2) elif 1800 <= X and X <= 1999: print(1) else: pass
p03475
s008901089
Accepted
n=int(input()) l=[list(map(int,input().split())) for _ in range(n-1)] for i in range(n-1): ans=0 for j in range(i,n-1): c,s,f=l[j] if ans<s: ans+=s-ans else: if ans%s!=0: if (ans%s)%f!=0: ans+=f-(ans%s)%f ans+=c print(ans) print(0)
p03377
s367322554
Accepted
a, b, x = map(int, input().split()) print('YES' if a <= x <= a + b else 'NO')
p02792
s033962675
Accepted
n = int(input()) l = [[0 for i in range(10)] for j in range(10)] for i in range(1,n+1): a = str(i) l[int(a[:1])][int(a[-1:])] += 1 ans = 0 for i in range(1,10): for j in range(i,10): if i==j: ans += l[i][j] * l[j][i] else: ans += 2 * l[i][j] * l[j][i] print(ans)
p03475
s485048717
Accepted
N=int(input()) CSF=[list(map(int,input().split())) for _ in range(N-1)] for j in range(N): t=0 for i in range(j,N-1): if t<CSF[i][1]: t=CSF[i][1] else: x=(t-1)//CSF[i][2]+1 t=CSF[i][2]*x t+=CSF[i][0] print(t)
p02743
s497155252
Accepted
a, b, c = [int(i) for i in input().split()] if a + b >= c: print("No") else: if 4 * a * b < (c - a - b)** 2: print("Yes") else: print("No")
p02766
s827720918
Wrong Answer
n,k = map(int,input().split()) d = k ans = 1 while True: if k >= n: break ans += 1 k *= d print(ans)
p02720
s735921840
Accepted
k = int(input()) lunlun = [1, 2, 3, 4, 5, 6, 7, 8, 9] def generate_lunlun(p): last = p % 10 if last - 1 >= 0: yield p * 10 + last - 1 yield p * 10 + last if last + 1 <= 9: yield p * 10 + last + 1 p = 0 while len(lunlun) < k: for new_lunlun in generate_lunlun(lunlun[p]): lunlun.append(new_lunlun) p += 1 print(lunlun[k-1])
p04019
s733530629
Wrong Answer
s = input() a = 'N' in s b = 'S' in s c = 'E' in s d = 'W' in s ans = all([a == b, c == d]) print(ans)
p02933
s335544473
Wrong Answer
n = int(input()) s = input() print("red" if n >= 3200 else s)
p02601
s729896807
Wrong Answer
a,b,c = map(int, input().split()) x = int(input()) for _ in range(x): if a > b: b *= 2 elif b > c: c *= 2 if a < b and b < c: print('Yes') exit() print('No')
p02792
s110522886
Accepted
N = int(input()) # top, bot C = [[0 for _ in range(10)] for _ in range(10)] for i in range(1,N+1): topi = int(str(i)[0]) boti = i % 10 C[topi][boti] += 1 #for i in range(10): # print(C[i]) ans = 0 for i in range(10): for j in range(10): ans += C[i][j] * C[j][i] print(ans)
p03719
s668959270
Accepted
a,b,c=map(int,input().split()) if a<=c<=b: print("Yes") else: print("No")
p02681
s751856956
Accepted
s = input() t = input() print("Yes" if s == t[:-1] else "No")
p02554
s047938258
Accepted
seq = int(input()) a = int(10**9 + 7) answer = (10**seq - 9**seq - 9**seq + 8**seq)%a print(answer)
p02607
s870236776
Accepted
n = int(input()) l = list(map(int,input().split())) ans = 0 for i in range(len(l)): if ((i+1)%2 == 1) and (l[i]%2 == 1): ans += 1 print (ans)
p03150
s190152008
Accepted
A=input() if A=="keyence" or A[:7]=="keyence" or A[-7:]=="keyence": print("YES") exit() for i in range(6): if A[:i+1]+A[-6+i:]=="keyence": print("YES") exit() print("NO")
p02603
s131655112
Accepted
N = int(input()) A = list(map(int,input().split())) ans = 1000 for i in range(N-1): if A[i] < A[i+1]: ans += ans // A[i] * (A[i+1] - A[i]) print(ans)
p03779
s747824635
Wrong Answer
import math X = int(input()) for i in range(1, int(math.sqrt(X)) + 10): if i * (i + 1) // 2 >= X: print(i) exit()
p03075
s828618489
Wrong Answer
a=int(input()) b=int(input()) c=int(input()) d=int(input()) e=int(input()) k=int(input()) if k > e-a: print('Yay!') else: print(':(')
p03612
s313552325
Wrong Answer
#coding: utf-8 N = int(input()) P = list(map(int, input().split())) l = list(range(1, N+1)) L = [] for i in range(N): L.append(P[i] != l[i]) ans = 0 for i in range(N-1): if L[i] and L[i+1]: continue ans += 1 L[i] = True L[i+1] = True print(ans)
p02683
s388005719
Accepted
N, M, X = map(int, input().split()) book_lists = [list(map(int, input().split())) for _ in range(N)] max_cost = 10**5*12+1 min_cost = max_cost for i in range(1, 2**N): score_list = [0 for _ in range(M)] cost = 0 for j in range(N): if i >> j & 1: cost += book_lists[j][0] for k in range(M): score_list[k] += book_lists[j][k+1] if min(score_list) >= X: min_cost = min(cost, min_cost) print(min_cost if not min_cost == max_cost else -1)
p02861
s816156154
Wrong Answer
n = int(input()) xy_list = [] for i in range(n): xy_list.append(list(map(int, input().split()))) import itertools import math comb = list(itertools.permutations(xy_list)) ans = 0 for s in comb: #print(ans) for zyun in range(len(s)-1): ans += math.sqrt((s[zyun][0] - s[zyun+1][0])**2 + (s[zyun][1] - s[zyun+1][1])**2) print(round(ans/n/(len(s)-1), 7))
p03803
s304924490
Accepted
import antigravity a, b = map(lambda x: 14 if x == "1" else int(x), input().split()) print("Draw" if a == b else ("Alice" if a > b else "Bob"))
p03773
s521198249
Accepted
a, b = map(int, input().split()) if a + b >= 24: print(a + b - 24) else: print(a+b)