s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time stringlengths 1 5 | memory stringlengths 1 7 | code_size stringlengths 1 6 | code stringlengths 1 539k |
|---|---|---|---|---|---|---|---|---|---|---|---|
s447213610 | p03803 | u884692162 | 1588004549 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 702 | #!/usr/bin/env python3
import sys
def solve(A: int, B: int):
A = 14 if A == 1 else A
B = 14 if B == 1 else B
if A == B:
print("Draw")
elif A > B:
print("Alice")
else:
print("Bob")
return
# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)
def main():
def iterate_tokens():
for line in sys.stdin:
for word in line.split():
yield word
tokens = iterate_tokens()
A = int(next(tokens)) # type: int
B = int(next(tokens)) # type: int
solve(A, B)
if __name__ == '__main__':
main()
|
s448829000 | p03803 | u320511454 | 1587997138 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 106 | a,b=list(map(int,input().split()))
if a>b:
print("Alice")
elif a=b:
print("Draw")
else:
print("Bob") |
s899100377 | p03803 | u062881897 | 1587760912 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38512 | 259 | A,B = map(int,input().split())
if A == 1:
if A < B:
print('Alice')
else:
print('Draw')
if B == 1:
if B < A:
print('Bob')
else:
print(Draw)
else:
if A > B:
print('Alice')
elif A == B:
print('Draw')
else:
print('Bob') |
s025430416 | p03803 | u235066013 | 1587685426 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 204 | a,b=[int(i) for i in input().split()]
list=["2","3","4","5","6","7","8","9","10","11","12","13","1"]
A=list.index(a)
B=list.index(b)
if A>B:
print('Alice')
elif A==B:
print('Draw')
else:
print('Bob' |
s777581451 | p03803 | u733321071 | 1587677745 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 217 | a, b = map(int, input().split())
if a == b:
print("Draw")
elif a == 1:
print("Alice")
elif b == 1:
print("Bob")
elif a > b:
print("Alice")
else:
print("Bob") |
s014928691 | p03803 | u764501786 | 1587388869 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 816 | import itertools
N, M_a, M_b = map(int, input().split())
a_l = [None] * N
b_l = [None] * N
c_l = [None] * N
result = -1
for i in range(N):
a_l[i], b_l[i], c_l[i] = map(int, input().split())
# print(a_l[i], b_l[i], c_l[i])
for i in range(N+1):
for V in itertools.combinations_with_replacement([n for n in range(N)], i):
if len(V) == 0:
continue
# print(V)
# continue
a_total = sum(a_l[v] for v in V)
b_total = sum(b_l[v] for v in V)
c_total = sum(c_l[v] for v in V)
if result < c_total and result != -1:
continue
# print('a_total:', a_total)
# print('b_total:', b_total)
if a_total / b_total == M_a / M_b:
# print(f'調合可能 {c_total}')
result = c_total
print(result)
|
s433461281 | p03803 | u486990800 | 1587146653 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 209 | A, B= map(int, input().split())
if A==1 & B==!:
print("Draw")
elif A==1 :
print("Alice")
elif B==1 :
print("Bob")
elif A > B:
print("Alice")
elif B>A:
print("Bob")
else :
print("Draw") |
s232287824 | p03803 | u932465688 | 1586873103 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38452 | 874 | n,ma,mb = map(int,input().split())
L = []
for i in range(n):
a,b,c = map(int,input().split())
L.append([a,b,c])
dp = [[10**5]*401 for i in range(401)]
make = [[0,0],[L[0][0],L[0][1]]]
dp[L[0][0]][L[0][1]] = L[0][2]
dp[0][0] = 0
for i in range(1,n):
a = L[i][0]
b = L[i][1]
c = L[i][2]
for j in range(len(make)):
t = make[j][0]
u = make[j][1]
dp[t+a][u+b] = min(dp[t][u]+c,dp[t+a][u+b])
make.append([t+a, u+b])
make = list(set(make))
if ma <= mb:
cnt = 1
ans = 10**5
while mb*cnt <= 400:
ans = min(ans, dp[ma*cnt][mb*cnt])
cnt += 1
if ans == 10**5:
print(-1)
else:
print(ans)
else:
cnt = 1
ans = 10**5
while ma*cnt <= 400:
ans = min(ans, dp[ma*cnt][mb*cnt])
cnt += 1
if ans == 10**5:
print(-1)
else:
print(ans)
|
s751729629 | p03803 | u581603131 | 1586807229 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 97 | A, B = map(int, input().split())
print('Alice' if A>B or A==1 and B==2 else 'Draw' if A==B 'Bob') |
s998956082 | p03803 | u581603131 | 1586807198 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 92 | A, B = map(int, input().split())
print('Alice' if A>B or A==1 and B==2 'Draw' if A==B 'Bob') |
s850916108 | p03803 | u581603131 | 1586807168 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 97 | A, B = map(int, input().split())
print('Alice' if A>B or A==1 and B==2 else 'Draw' if A==B 'Bob') |
s365203193 | p03803 | u581603131 | 1586807120 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 99 | A, B = map(int, input().split())
print('Alice' if A>B or A==1 and B==2 elif A==B 'Draw' else 'Bob') |
s850685717 | p03803 | u457957084 | 1586514418 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 223 | a, b = map(int,input().split())
if a == b:
print("Draw")
elif a == 1 B != 1:
print("Alice")
elif a != 1 B == 1:
print("Bob")
elif a < b:
print("Alice")
else:
print("Bob") |
s555126870 | p03803 | u457957084 | 1586514289 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 231 | a , b = map(int(input().split())
if a == b:
print("Draw")
elif a == 1 B != 1:
print("Alice")
elif a != 1 B == 1:
print("Bob")
elif a < b:
print("Alice")
else:
print("Bob")
|
s705385900 | p03803 | u843318346 | 1586396837 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 163 | a,b = map(int,input().split())
if a==b:
print('Draw')
elif a==1:
print('Alice')
elif b==1:
print('Bob')
elif a>b:
print('Alice')
else b>a:
print('Bob')
|
s320565938 | p03803 | u107601154 | 1585790823 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 909 | N,Ma,Mb= (int(x) for x in input().split())
a = [0]*N
b = [0]*N
c = [0]*N
# use = [0]*N
ans = 40*100+1
for i in range (N):
a[i],b[i],c[i] = (int(x) for x in input().split())
# 0ならつかわない1なら使う
A = 0
B = 0
C = 0
def search(N,Ma,Mb,a,b,c,A,B,C):
if (B!= 0 and A/B == Ma/Mb):
return C
if(N==1):
# use[N-1] = 0
# if (B!= 0 and A/B == Ma/Mb):
# return C
use[N-1] = 1
A += a[N-1]
B += b[N-1]
C += c[N-1]
if (B!= 0 and A/B == Ma/Mb):
return C
else: C = ans
return C
else:
# use[N-1] = 0
c0 = search(N-1,Ma,Mb,a,b,c,A,B,C)
# use[N-1] = 1
A += a[N-1]
B += b[N-1]
C += c[N-1]
c1 = search(N-1,Ma,Mb,a,b,c,A,B,C)
return min(c0,c1)
Ans = search(N,Ma,Mb,a,b,c,use,A,B,C)
if(Ans == ans):
print("-1")
else: print(Ans) |
s470137794 | p03803 | u063346608 | 1585674642 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 129 | A,B = int(input().split())
if A > B and B != 1:
print("Alice")
elif A == B:
print("Draw")
elif B > A and A != 1:
print("Bob") |
s400011795 | p03803 | u159335277 | 1585618845 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 146 | a, b = list(map(int, input()))
if b == 1: b += 13
if a == 1: a += 13
if a < b:
print('Bob')
elif a == b
print('Draw')
else:
print('Alice') |
s914043324 | p03803 | u790048565 | 1585568818 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 577 | N, M = map(int, input().split())
A = []
for _ in range(N):
a = input()
A.append(a)
B = []
for _ in range(M):
b = input()
B.append(b)
existed = False
for i in range(N - M + 1):
for j in range(N - M + 1):
match = True
for mi in range(M):
for mj in range(M):
x = i + mi
y = j + mj
if (A[y][x] != B[mj][mi]):
match = False
break
if (match == False):
break
if (match):
existed = True
break
if (existed):
break
result = 'Yes' if (existed) else 'No'
print(result)
|
s671894385 | p03803 | u920621778 | 1585529002 | Python | PyPy3 (2.4.0) | py | Runtime Error | 177 | 38384 | 159 | a, b = map(int, input().split())
r = ''
if a == b:
r = 'Draw'
elif a == 1:
r = 'Alice'
elif b == 1:
r = 'Bob'
else
r = 'Alice' if a < b else 'Bob'
print(r) |
s542150203 | p03803 | u391819434 | 1585455790 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 104 | A,B=map(int,input().split())
if A=1:
A=14
if B=1:
B=14
print(['ABloibc e'[A<B::2],'Draw'][A==B]) |
s615040260 | p03803 | u132895075 | 1584916537 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 108 | A,B=map(int,input().split())
if A>B:
print('Alice')
elif A==B:
print('Draw')
else:
print('Bob')
|
s378346198 | p03803 | u553070631 | 1584850162 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 178 | a,b=map(int(input().split()))
s=[2,3,4,5,6,7,8,9,10,11,12,13,1]
if s.index(a)==s.index(b):
print('Draw')
elif s.index(a)>s.index(b):
print('Alice')
else:
print('Bob') |
s191665084 | p03803 | u553070631 | 1584850076 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 165 | a,b=map(int(input().split()))
s=[2,3,4,5,6,7,8,9,10,11,12,13,1]
if a.index=b.index:
print('Draw')
elif a.index>b.index:
print('Alice')
else:
print('Bob') |
s844832866 | p03803 | u076306174 | 1584814815 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 195 | import math
A,B=list(map(int, input().split()))
if A==1:
A=14
if B==1:
B=14
if A>B:
print('Alice')
elif A<B:
if b=='H':
print('Bob')
else:
print('Draw') |
s297881234 | p03803 | u624613992 | 1584759534 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 201 | if a > b :
if b == 1:
print("Bob")
else:
print("Alice")
print("Alice")
elif a <b :
if a==1:
print("Alice")
else:
print("Bob")
else:
print("Draw") |
s409860474 | p03803 | u586563885 | 1584420924 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 132 | a,b=map(int,input().split())
if a==b:
print("draw")
elif a=1 or a>b
print("Alice")
elif b=1:
print("Bob")
else:
print("Bob") |
s176001475 | p03803 | u119226758 | 1584309034 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 147 | a, b = map(int,input().split())
v = ""
if a = b:
v = "Draw"
elif a == 1 or a > b:
v = "Alice"
elif b == 1 or a < b:
v = "Bob"
print(v)
|
s132094613 | p03803 | u119226758 | 1584227299 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1146 | import math
N, Ma, Mb = map(int,input().split())
rate = Ma / Mb
a = [0] * N
b = [0] * N
c = [0] * N
MA = 0
MB = 0
for i in range(N):
a[i], b[i], c[i] = map(int, input().split())
MA += a[i]
MB += b[i]
dp = [[[math.inf for i in range(MB+1)] for j in range(MA+1)] for k in range(N+1)]
dp[0][0][0] = 0
for it_N in range(N):
for it_MA in range(MA+1):
for it_MB in range(MB+1):
if it_MA >= a[it_N] and it_MB >= b[it_N]:
if dp[it_N][it_MA-a[it_N]][it_MB-b[it_N]] != math.inf:
dp[it_N+1][it_MA][it_MB] = min(dp[it_N][it_MA-a[it_N]][it_MB-b[it_N]] + c[it_N], dp[it_N][it_MA][it_MB])
else:
dp[it_N+1][it_MA][it_MB]=dp[it_N][it_MA][it_MB]
# for it_MA in range(MA+1):
# for it_MB in range(MB+1):
#print(it_N+1,it_MA,it_MB,dp[it_N+1][it_MA][it_MB])
#中身確認
ans = -1
for a in range(1, MA+1):
for b in range(1, MB+1):
print(a,b,dp[N][a][b])
if a/b == rate and dp[N][a][b] != math.inf:
if ans == -1:
ans = dp[N][a][b]
else:
ans = min([dp[N][a][b], ans])
print(ans)
|
s399974883 | p03803 | u119226758 | 1584227178 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1156 | import math
N, Ma, Mb = map(int,input().split())
rate = Ma / Mb
a = [0] * N
b = [0] * N
c = [0] * N
MA = 0
MB = 0
for i in range(N):
a[i], b[i], c[i] = map(int, input().split())
MA += a[i]
MB += b[i]
dp = [[[math.inf for i in range(MB+1)] for j in range(MA+1)] for k in range(N+1)]
dp[0][0][0] = 0
for it_N in range(N):
for it_MA in range(MA+1):
for it_MB in range(MB+1):
if it_MA >= a[it_N] and it_MB >= b[it_N]:
if dp[it_N][it_MA-a[it_N]][it_MB-b[it_N]] != math.inf:
dp[it_N+1][it_MA][it_MB] = min(dp[it_N][it_MA-a[it_N]][it_MB-b[it_N]] + c[it_N], dp[it_N][it_MA][it_MB])
else:
dp[it_N+1][it_MA][it_MB]=dp[it_N][it_MA][it_MB]
for it_MA in range(MA+1):
for it_MB in range(MB+1):
# print(it_N+1,it_MA,it_MB,dp[it_N+1][it_MA][it_MB])
#中身確認
ans = -1
for a in range(1, MA+1):
for b in range(1, MB+1):
print(a,b,dp[N][a][b])
if a/b == rate and dp[N][a][b] != math.inf:
if ans == -1:
ans = dp[N][a][b]
else:
ans = min([dp[N][a][b], ans])
print(ans)
|
s116672178 | p03803 | u478266845 | 1584175561 | Python | Python (3.4.3) | py | Runtime Error | 148 | 12408 | 273 | import numpy as np
strong_order = np.array([14,2,3,4,5,6,7,8,9,10.11,12,13])
A,B = [int(i)-1 for i in input().split()]
if strong_order[A] > strong_order[B]:
print("Alice")
elif strong_order[A] < strong_order[B]:
print("Bob")
else:
print("Draw")
|
s531113424 | p03803 | u119655368 | 1583891017 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 541 | import itertools
n, m = map(int, input().split())
l = [list(map(int, input().split())) for i in range(m)]
r = [[] for i in range(n + 1)]
ans = 0
for i in range(m):
r[l[i][0]].append(l[i][1])
r[l[i][1]].append(l[i][0])
p = []
for i in range(n):
p.append(i + 1)
p = list(itertools.permutations(p))
for i in range(len(p)):
check = True
t = list(p[i])
if t[0] != 1:
check = False
for j in range(len(t)-1):
if not t[j + 1] in r[t[j]]:
check = False
if check:
ans += 1
print(ans) |
s665143301 | p03803 | u263824932 | 1583470111 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 220 | A,B=map(int,input().split())
if A==B:
print('Draw')
else:
if A==1:
print('Alice')
elif B==1:
print('Bob')
else:
if A > B:
print('Alice')
else:
print('Bob')
|
s177579978 | p03803 | u453683890 | 1583444861 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 425 | line = input().split(' ')
N,M = int(line[0]),int(line[1])
A = []
B = []
exe = 0
for i in range(N):
A.append(input())
for i in range(M):
B.append(input())
for i in range(N-M+1):
f = 0
for j in range(N-M+1):
if A[i][j:j+M] == B[0]:
f = 1
for k in range(M):
if not A[i+k][j:j+M] == B[k]:
f = 0
break
if f == 1:
exe = 1
if exe == 0:
print("No")
else:
print("Yes") |
s187060340 | p03803 | u131264627 | 1582606142 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 551 | from itertools import permutations
n, m = map(int, input().split())
ab = [[] for i in range(n)]
for i in range(m):
a, b = map(lambda x: int(x) - 1, input().split())
ab[a].append(b)
ab[b].append(a)
cnt = 0
if n == 2:
if 1 in ab[0]:
print(1)
else:
print(0)
exit()
for p in permutations(range(1, n)):
if p[0] in ab[0]:
flag = True
for i in range(n - 2):
if p[i + 1] not in ab[p[i]]:
flag = False
break
if flag:
cnt += 1
print(cnt) |
s434070356 | p03803 | u496687522 | 1582323205 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 134 | A, B = map(int, input().split())
if A==B:
print("Draw")
elif A>B or A==1:
print("Alice")
elif A<B or B==1:
print("Bob") |
s778914580 | p03803 | u496687522 | 1582323155 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 135 | A, B = map(int, input().split())
if A==B:
print("Draw")
elif A>B or A==1:
print("Alice")
elif: A<B or B==1:
print("Bob") |
s423706958 | p03803 | u419963262 | 1582279341 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 118 | A,B=map(int,input(),split())
a=A%13
b=B%13
if A>B:
print("Alice")
elif B>A:
print("Bob")
else:
print("Draw")
|
s272669702 | p03803 | u467831546 | 1581552290 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 244 | cards = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1]
card_alice = cards.index(int(input()))
card_bob = cards.index(int(input()))
if card_alice > card_bob:
print("Alice")
elif card_alice == card_bob:
print("Draw")
else:
print("Bob") |
s355675629 | p03803 | u772649753 | 1581369583 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 109 | A,B = map(int,input().split())
if A > B:
print("Alice")
else if A < B:
print("Bob")
else:
print("Draw") |
s381039726 | p03803 | u334712262 | 1581125003 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 144 | A, B = map(int, input().split())
if A == B:
print('Draw')
else:
print( 'Alice' if A if A != 1 else A+13 > B if B != 1 else B+ 13 else 'Bob') |
s768036862 | p03803 | u167254893 | 1580776427 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 226 | A,B = map(int,input().split())
if (A==1 and B!=1):
print("Alice")
exit()
elif(B==1 and A!=1):
print("Bob")
if (A>B):
print("Alice")
elif(A<B):
print("Bob")
elif(A==B):
print("Draw")
|
s983605763 | p03803 | u167254893 | 1580776346 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 226 | A,B = map(int,input().split())
if (A==1 and B!=1):
print("Alice")
exit()
elif(B==1 and A!=1):
print("Bob")
if (A>B):
print("Alice")
elif(A<B):
print("Bob")
elif(A==B):
print("Draw")
|
s084978853 | p03803 | u167254893 | 1580776138 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 176 | A,B = map(int,input().split())
if (A=1 and B!=1):
print("Alice")
if (A>B):
print("Alice")
elif(A<B):
print("Bob")
elif(A==B):
print("Draw")
|
s385973946 | p03803 | u843722521 | 1579315758 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38256 | 149 | a,b = map(int,input())
if a==b:
print("Draw")
elif a==1:
print("Alice")
elif b==1:
print("Bob")
elif a>b:
print("Alice")
else:
print("Bob") |
s420796420 | p03803 | u241190800 | 1578796702 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 206 | data = [int(idx) for idx in input().split()]
if data[0] == data[1]:
print("Draw")
else:
if data[0] > data[1] or data[0] == 1:
print("Alice")
else data[0] < data[1] or data[1] == 1:
print("Bob") |
s086325185 | p03803 | u823044869 | 1578354188 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 267 | cardArray = list(map(int,input().split()))
if cardArray[0]== carArray[1]:
print("Draw")
elif cardArray[0] < cardArray[1]:
if cardArray[0] == 1:
print("Alice")
else:
print("Bob")
else:
if cardArray[1] == 1:
print("Bob")
else:
print("Alice")
|
s185240974 | p03803 | u823044869 | 1578354135 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 257 | cardArray = list(map(int,input().split()))
if cardArray[0]== carArray[1]:
print("Draw")
elif cardArray[0] < cardArray[1]:
if cardArray[0] == 1:
print("Alice")
else:
print("Bob")
else:
if cardArray[1] == 1:
print("Bob")
print("Alice")
|
s135741501 | p03803 | u823044869 | 1578354029 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 214 | cardArray = list(map(int,input().split()))
if cardArray[0]== carArray[1]:
print("Draw")
elif cardArray[0] < cardArray[1]:
if cardArray[0] == 1:
print("Alice")
else:
print("Bob")
else:
print("Bob")
|
s492000986 | p03803 | u823044869 | 1578353964 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 213 | cardArray = list(map(int,input().split()))
if cardArray[0]= carArray[1]:
print("Draw")
elif cardArray[0] < cardArray[1]:
if cardArray[0] == 1:
print("Alice")
else:
print("Bob")
else:
print("Bob")
|
s662273891 | p03803 | u940139461 | 1578116641 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 684 | n,ma,mb=map(int,input().split())
dp=[[0]*401 for _ in range(401)]
for _ in range(n):
a,b,c=map(int,input().split())
for i in range(400,-1,-1):
for j in range(400,-1,-1):
if i-a<0 or j-b<0:
continue
else:
if dp[i-a][j-b]==0:
continue
else:
if dp[i][j]==0:
dp[i][j]=dp[i-a][j-b]+c
else:
dp[i][j]=min(dp[i][j],dp[i-a][j-b]+c)
if dp[a][b]==0:
dp[a][b]=c
else:
dp[a][b]=min(dp[a][b],c)
ans=10**10
for i in range(401):
if i*ma>400 or i*mb>400:
break
if dp[i*ma][i*mb]==0:
continue
else:
ans=min(ans,dp[i*ma][i*mb])
if ans==10**10:
print(-1)
else:
print(ans)
|
s072189398 | p03803 | u506858457 | 1578014242 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 168 | A,B=map(int,input().split())
if A==B:
print('Draw')
else if A=='1':
print('Alice')
else if B=='1':
print('Bob')
else if A>B:
print('Alice')
else:
print('Bob') |
s043800686 | p03803 | u148551245 | 1577869952 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 1509 | fn main() {
let a: i32 = read();
let b: i32 = read();
if a == 1 {
println!("Alice");
} else if b == 1 {
println!("Bob");
} else if a > b {
println!("Alice");
} else if a < b {
println!("Bob");
} else {
println!("Draw");
}
}
// 以下関数
use std::io::*;
use std::str::FromStr;
pub fn read<T: FromStr>() -> T {
let stdin = stdin();
let stdin = stdin.lock();
let token: String = stdin
.bytes()
.map(|c| c.expect("failed to read char") as char)
.skip_while(|c| c.is_whitespace())
.take_while(|c| !c.is_whitespace())
.collect();
token.parse().ok().expect("failed to parse token")
}
pub const MOD: u64 = 10e9 as u64 + 7;
pub fn is_prime(n: i32) -> bool {
if n < 2 {
return false;
} else if n == 2 {
return true;
}
let mut i = 2;
while i * i < n {
if n % i == 0 {
return false;
} else {
i += 1;
continue;
}
}
true
}
pub fn lcm(mut n: i32, mut m: i32) -> i32 {
n = if n > m { m } else { n };
m = if n > m { n } else { m };
let mut i = n;
while i % m != 0 {
i += n;
}
i
}
pub fn abs(n: i32) -> i32 {
if n >= 0 {
n
} else {
-n
}
}
pub fn max(n: i32, m: i32) -> i32 {
if n >= m {
n
} else {
m
}
}
pub fn min(n: i32, m: i32) -> i32 {
if n <= m {
n
} else {
m
}
} |
s993773175 | p03803 | u963468276 | 1577833228 | Python | PyPy3 (2.4.0) | py | Runtime Error | 171 | 38256 | 185 | A, B = map(int, input().split())
if A == 1:
A += 13
if B == 1:
B += 13
win_Alice = A - B
if win_Alice = 0:
print('Draw')
else:
print('Alice' if win_Alice > 0 else 'Bob') |
s518856372 | p03803 | u886655280 | 1577647465 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3444 | 1409 | # https://atcoder.jp/contests/abc054/tasks/abc054_c
import copy
import sys
input = sys.stdin.readline
# 頂点, 辺の数
N, M = map(int, input().split())
# グラフのリスト
# 各頂点からどこの頂点に向かう辺があるかどうかという情報
Graph_list = [[] for i in range(N)]
# 入力
for i in range(M):
a, b = map(int, input().split())
a += -1
b += -1
# 無向グラフなのでa, b両方
Graph_list[a].append(b)
Graph_list[b].append(a)
ans_count = 0
throwgh_point_list = [-1 for i in range(N)]
def dfs(i, current, throwgh_point_list, ans_point_list):
# 頂点をN個通ったら終了処理
if i >= N:
# すでにカウント済の経路である場合
if throwgh_point_list in ans_point_list:
return
# すでにカウント済ではないかつ全ての点に到達している場合
# 順不同で比較
if set(throwgh_point_list) == set(list(range(N))):
global ans_count
ans_count += 1
ans_point_list.append(copy.copy(throwgh_point_list))
return
for j in range(len(Graph_list[current])):
# 現在地を書き込む
throwgh_point_list[i] = current
# 次の点に移動する
dfs(i + 1, Graph_list[current][j], throwgh_point_list, ans_point_list)
dfs(0, 0, throwgh_point_list, [])
print(ans_count) |
s593748909 | p03803 | u027675217 | 1577300791 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 87 | a,b = int(input())
if a>b:
print("Alice")
elif a<b:
print("Bob")
else:
print("Draw") |
s952554312 | p03803 | u560988566 | 1577231357 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 249 | a,b = map(int, input().split())
if a == 1:
if b == 1:
print("Draw")
exit()
else:
print("Alice")
exit()
else:
if a == b:
print("Draw")
exit()
elif a > b:
print("Alice")
exit()
else:
print("Bob")
exit() |
s173516089 | p03803 | u654558363 | 1577044751 | Python | Python (3.4.3) | py | Runtime Error | 16 | 2940 | 592 | import java.util.Scanner;
public class A{
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
String j = scanner.nextLine();
String[] tmpcards = j.split(" ");
int[] cards = new int[3];
for (int i = 0; i < 2; i++){
cards[i] = Integer.parseInt(tmpcards[i]);
if (cards[i] == 1)
cards[i] += 13;
}
if (cards[0] == cards[1]){
System.out.println("Draw");
} else {
System.out.println(cards[0] > cards[1]?"Alice":"Bob");
}
}
} |
s745546134 | p03803 | u654558363 | 1577044630 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 645 | import java.util.Scanner;
public class A{
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
String j = scanner.nextLine();
String[] tmpcards = j.split(" ");
int[] cards = new int[3];
for (int i = 0; i < 2; i++){
cards[i] = Integer.parseInt(tmpcards[i]);
if (cards[i] == 1)
cards[i] += 13;
}
if (cards[0] == cards[1]){
System.out.println("Draw");
scanner.close();
return;
}
System.out.println(cards[0] > cards[1]?"Alice":"Bob");
scanner.close();
}
} |
s706693712 | p03803 | u006425112 | 1576850205 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 186 | import sys
a,b = map(int, sys.stdin.readline().split())
if a == 1:
a = 14
if b == 1:
b = 14:
if a > b:
print("Alice")
elif a == b:
print("Draw")
else:
print("Bob") |
s922550528 | p03803 | u181215519 | 1576639022 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 125 | A, B = map( int, input().split() )
if A > B :
print( "Alice" )
elseif A < B :
print( "Bob" )
else :
print( "Draw" ) |
s891465014 | p03803 | u227082700 | 1576288911 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 8 | :cross: |
s001525751 | p03803 | u055687574 | 1575865838 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 216 | N, M = map(int, input().split())
A = [input() for n in range(N)]
B = [input() for m in range(M)]
ans = "Yes"
for a in A:
for b in B:
print(a, b)
if b not in a:
ans = "No"
print(ans)
|
s279922568 | p03803 | u055687574 | 1575865077 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 290 | N, M = map(int, input().split())
A = [input() for n in range(N)]
B = [input() for m in range(M)]
for a in A:
cnt = 0
for b in B:
if b in a:
cnt += 1
else:
cnt = 0
if cnt == M:
print("Yes")
exit()
print("No")
|
s145172872 | p03803 | u339922532 | 1575752783 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 179 | a, b = map(int, input().split())
if a == b:
print("Draw")
elif a == 1:
print("Alice"):
elif b == 1:
print("Bob")
elif a < b:
print("Bob")
else:
print("Alice") |
s292354246 | p03803 | u905582793 | 1575607500 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 141 | A = int(input())
B = int(input())
if (A+11)%13 > (B+11)%13:
print("Alice")
elif (A+11)%13 < (B+11)%13:
print("Bob")
else:
print("Draw") |
s814175588 | p03803 | u189427183 | 1575318358 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 141 | A,B=map(int,input().split())
if (B==1 and A!=1) or B>A:
print("Bob")
elif (A==1 and B!=1) or B<A:
print("Alice")
elif A==B:
print(Draw) |
s612328660 | p03803 | u930841425 | 1575162142 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 342 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
string solve() {
ll A, B;
cin >> A >> B;
if ( A == 1 ) A = 14;
if ( B == 1 ) B = 14;
if ( A > B ) return "Alice";
else if ( A< B ) return "Bob";
else return "Draw";
}
int main() {
auto ans = solve();
cout << ans << "\n";
return 0;
} |
s203271076 | p03803 | u214434454 | 1574229391 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 413 | n , m = map(int, input().split())
a = [input() for _ in range(n)]
b = [input() for _ in range(m)]
#i, j はBの左端
for i in range(n-m+1):
ans = True
for j in range(n-m+1):
for k in range(m):
if a[i + k][j:j+m] != b[k]:
ans = False
if ans == True:
break
else:
continue
break
if ans == True:
print("Yes")
else:
print("No")
|
s061730644 | p03803 | u754022296 | 1572917417 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 192 | a, b = map(int, input().split())
l = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1]
if l.index(a) > l.index(b):
print("Alice")
elif l.index(a) < l,index(a):
print("Bob")
else:
print("Draw") |
s422043194 | p03803 | u348868667 | 1572016726 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 243 | A,B = map(int,input().split())
tmp = list(A,B)
ans = ["Alice","Bob"]
if tmp[0] == tmp[1]:
print("Draw")
elif tmp[0] == 1:
print(ans[0])
elif tmp[1] == 1:
print(ans[1])
elif tmp[0] > tmp[1]:
print(ans[0])
else:
print(ans[1]) |
s889139737 | p03803 | u117193815 | 1571227256 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 136 | A,B = map(int, input().split())
if A==1:
A=14
if B==1:
B=14
if a>b:
print('Alice')
elif b>a:
print('Bob')
else:
print('Draw') |
s247598805 | p03803 | u677400065 | 1571162680 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 130 | a,b = map(int, input())
if a == 1:
print("Alice")
elif b == 1:
print("Bob")
elif a < b:
print("Bob")
else:
print("Alice") |
s313758067 | p03803 | u117193815 | 1571081987 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 144 | a,b = map(int, input())
if a==1:
print('Alice')
if b==1:
print('Bob')
if a==b:
print("Draw")
if a>b:
print("Alice")
else:
print("Bob") |
s838003391 | p03803 | u630786674 | 1570835167 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3056 | 225 | n, m = map(int, input().split())
n_list = [input() for _ in range(n)]
m_list = [input() for _ in range(m)]
for i in n_list:
for j in m_list:
if j not in i:
print("No")
quit()
print("Yes") |
s954380544 | p03803 | u403986473 | 1570588348 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 161 | A, B = map(int,input())
if(A == B):
print('Draw')
elif(B != 1 and (A == 1 or A > B)):
print('Alice')
elif(A != 1 and (B == 1 or B > A)):
print('Bob') |
s778743099 | p03803 | u625741705 | 1570415063 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 379 | #include <bits/stdc++.h>
using namespace std;
int main() {
//input
int a,b;
cin >> a >> b;
if(a = b){
cout << "Draw" << endl;
}else if(a == 1){
cout << "Alice" << endl;
} else if(b == 1){
cout << "Bob" << endl;
}else if(a > b){
cout << "Alice" << endl;
}else{
cout << "Bob" << endl;
}
return 0;
} |
s365250681 | p03803 | u448655578 | 1570164216 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 212 | A,B = map(int, input().split())
if A != 1 and B != 1:
if A > B:
print("Alice")
elif B > A:
print("Bob")
elif A == B:
print("Draw")
else:
if A == 1:
print("Alice")
else:
print("Bob") |
s386440352 | p03803 | u089376182 | 1569538850 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 105 | a, b = map(int, input().split())
print('Draw' if a==b else 'Alice' if (a==1)or(b!=1 and a>b)) else 'Bob') |
s158340164 | p03803 | u062484507 | 1569015906 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 229 | N, M = map(int, input().split())
A = [input() for i in range(N)]
B = [input() for j in range(M)]
ans = True
for k in range(len(B)):
if B[k] not in A[k]:
ans = False
break
print("Yes" if ans == True else "No") |
s572751057 | p03803 | u055687574 | 1568951083 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 258 | a, b = input().split()
cards = {"2": 1, "3": 2, "4": 3, "5": 4, "6": 5, "7": 6, "8": 7, "9 ": 8, "10": 9, "11": 10, "12": 11, "13": 12, "1": 13 }
if cards[a] > cards[b]:
print("Alice")
elif cards[a] < cards[b]:
print("Bob")
else:
print("Draw")
|
s247385673 | p03803 | u055687574 | 1568950847 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 258 | a, b = input().split()
cards = {"2": 1, "3": 2, "4": 3, "5": 4, "6": 5, "7": 6, "8": 7, "9 ": 8, "10": 9, "11": 10, "12": 11, "13": 12, "1": 13 }
if cards[a] > cards[b]:
print("Alice")
elif cards[a] < cards[b]:
print("Bob")
else:
print("Draw")
|
s376997573 | p03803 | u536177854 | 1568919415 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 120 | a,b=map(int,input().split())
if a==b:
print('Draw')
elif a==1 or (a>b and B!=1):
print('Alice')
else:
print('Bob') |
s678712240 | p03803 | u528720841 | 1568767194 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 128 | A,B = map(int, input().split())
if A==B:
print("draw")
elif A == 1 or (b != 1 and A>B):
print("Alice")
else:
print("Bob")
|
s348405359 | p03803 | u528720841 | 1568767154 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 129 | A,B = map(int, input().split())
if A==B:
print("draw")
elif A == 1 or (b != 1 and A>B):
print("Alice")
else:
print("Bob");
|
s058495781 | p03803 | u819710930 | 1568735007 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 139 | a,b=map(int,input().split())
if a==b: print('Draw')
elif a==1: print('Alice')
elif b==1: print('Bob')
else print('Alice' if a>b else 'Bob') |
s092050990 | p03803 | u634461820 | 1568383751 | Python | PyPy3 (2.4.0) | py | Runtime Error | 178 | 38384 | 175 | Bob, Alice = list(map(int,input().split()))
ans = ["Bob", "Alice", "Draw"]
if Bob == Alice:
print(ans[2])
elif Bob = 1 or Bob > Alice:
print(ans[0])
else:
print(ans[1]) |
s125247562 | p03803 | u463775490 | 1568017041 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 210 | a,b = map(int,input().split())
if a == 1:
if b == 1:
print(Draw)
else:
print(Alice)
elif b == 1:
print(Bob)
else:
if a == b:
print(Draw)
elif a < b:
print(Alice)
else:
print(Bob) |
s112756942 | p03803 | u931489673 | 1567919290 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 172 | a,b=map(int,input().split())
def one_14(num):
if num==1:
return 14
a=one_14(a)
b=one_14(b)
if a > b:
print("Alice")
elif b < a:
print("Bob")
else:
print("Draw") |
s984974465 | p03803 | u532099150 | 1566848354 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 163 | a,b=map(int, input().split())
if a == b:
print("Draw")
elif a > b:
if b == 1:
print("Bob")
break
print("Alice")
else:
print("Bob") |
s033523806 | p03803 | u027929618 | 1566667749 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 158 | A, B = map(int, input().split())
if A == 1:
A = 14
if B == 1:
B = 14
if A < B:
print("Bob")
elif B < A:
print("Alice")
elif B == A:
pritn("Draw") |
s153320717 | p03803 | u717626627 | 1566528407 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 168 | a, b = map(int, input().split())
if:
print('Draw')
elif a == 1:
print('Alice')
elif b == 1:
print('Bob')
elif a < b:
print('Bob')
elif a > b:
print('Alice')
|
s683559483 | p03803 | u717626627 | 1566528169 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 110 | a = int(input())
b = int(input())
if a < b:
print('Bob')
elif a > b:
print('Alice')
else:
print('Draw') |
s482613143 | p03803 | u762540523 | 1566421820 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 120 | a,b=map(int,input()).split()
print("Draw" if a==b else "Alice" if a==1 else "Bob"if b==1 else "Alice" if a>b else "Bob") |
s076908061 | p03803 | u762540523 | 1566421795 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 121 | a,b=map(int,input()).split())
print("Draw" if a==b else "Alice" if a==1 else "Bob"if b==1 else "Alice" if a>b else "Bob") |
s811639141 | p03803 | u271044469 | 1566090974 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 176 | a, b = map(int, input().split())
if (a > b and b != 1) or (a==1 and b!=1):
print('Alice')
elif (b > a a!=1) and (a!=1 and b==1):
print('Bob')
else:
print('Draw')
|
s268722246 | p03803 | u302292660 | 1566052264 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 141 | a,b = map(int,input().split())
print("Alice" if (a>b and b!=1) or (a==1 and b!=1) else "Bob" (if a<b and a!=1) or(a!=1 and b==1) else "Draw") |
s959870310 | p03803 | u076498277 | 1565978263 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 61 | N = int(input())
bonus = N // 15 * 200
print(N * 800 - bonus) |
s733485087 | p03803 | u690576712 | 1565894453 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3064 | 411 | n,m = map(int,input().split())
path = list([False] * n for _ in range(n))
for i in range(m):
a,b = map(int,input().split())
a -= 1
b -= 1
path[a][b] = True
path[b][a] = True
ans = 0
import itertools
for i in itertools.permutations(range(n),n):
if i[0] == 0:
for j in range(n):
if j == n-1:
ans += 1
break
if not path[i[j]][i[j+1]]:
break
print(ans)
|
s242417000 | p03803 | u453500284 | 1565889421 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 130 | a, b = map(lambda x:(int(x) + 13) % 15, input().split())
if a > b: print("Alice")
if a < b: print("Bob")
else: print("Draw") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.