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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s047407116 | p03803 | u923279197 | 1540158610 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 282 | a.b=map(int,input().split())
if a==1:
if b==1:
print('Draw')
else:
print('Alice')
else:
if b==1:
print('Bob')
else:
if a>b:
print('Alice')
elif a==b:
print('Draw')
else:
print('Bob') |
s696609601 | p03803 | u328755070 | 1540140466 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 183 | A. B = list(map(int, input().split()))
if A == B:
ans = 'Draw'
elif A == 1:
ans = 'Alice'
elif B == 1:
ans = 'Bob'
else:
ans = 'Alice' if A > B else 'Bob'
print(ans)
|
s009153743 | p03803 | u426108351 | 1539958338 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 160 | A, B = map(int, input(),split())
if A == 1:
A = 14
elif B == 1:
B = 14
if A > B:
print("Alice")
elif A < B:
print("Bob")
else:
print("Draw") |
s163388668 | p03803 | u873849550 | 1539633148 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 140 | A,B = map(int, input().split())
print('Alice' if cards.index(A) > cards.index(B) else 'Bob' if cards.index(A) < cards.index(B) else 'Draw' ) |
s836866332 | p03803 | u094565093 | 1538687378 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 319 | N,M=map(int,input().split())
A=[ list(input()) for i in range(N)]
B=[ list(input()) for i in range(M)]
ans='Yes'
for i in range(N-M+1):
for j in range(N-M+1):
for k in range(i,i+M):
for l in range(j,j+M):
if A[k][l]!=B[k-i][l-j]:
ans='No'
print(ans)
|
s635595499 | p03803 | u462538484 | 1537652412 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 98 | a, b = input().split()
a, b = int(a), int(b)
print("Draw" if a == b elif a < b "Bob" else "Alice") |
s291433758 | p03803 | u518556834 | 1537328582 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 139 | a,b = int(input())
if a == 1:
a += 13
if b == 1:
b += 13
if a > b:
print("Alice")
if a < b:
print("Bob")
if a == b:
print("Drow") |
s071784785 | p03803 | u102126195 | 1536594298 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 171 | A, B = map(int, input())
if A == B:
print("Draw")
elif A == 1:
print("Alice")
elif B == 1:
print("Bob")
else:
if A < B:
print("Bob")
else:
print("Alice") |
s112329526 | p03803 | u474270503 | 1536438304 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 253 | N,M=map(int, input().split())
A=[input() for _ in range(N)]
B=[input() for _ in range(M)]
for i in range(N-M+1):
for j in range(N-M+1):
t=[k[j:j*m] for k in a[i:i+m]]
if t==B:
print('Yes')
exit()
print('No')
|
s952037195 | p03803 | u094565093 | 1536205181 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 209 | A,B=input().split()
poker=['2','3','4','5','6','7','8','9','10','11','12','1']
if poker.index(A)<poker.index(B):
print('Bob')
elif poker.index(A)>poker.index(B):
print('Alice')
else:
print('Draw') |
s201275575 | p03803 | u562016607 | 1535159619 | Python | PyPy3 (2.4.0) | py | Runtime Error | 165 | 38256 | 740 | N,Ma,Mb=map(int,input().split())
a=[0 for i in range(N)]
b=[0 for i in range(N)]
c=[0 for i in range(N)]
M=401
dp=[[[10**4 for cb in range(M)]for ca in range(M)]for i in range(N+1)]
for i in range(N):
a[i],b[i],c[i]=map(int,input().split())
dp[0][0][0]=0
for i in range(N):
for ca in range(M):
for cb in range(M):
if dp[i][ca][cb]==10**4:
continue
dp[i+1][ca][cb]=min([dp[i+1][ca][cb],dp[i][ca][cb]])
dp[i+1][ca+a[i]][cb+b[i]]=min([dp[i+1][ca+a[i]][cb+b[i]],dp[i][ca][cb]+c[i]])
ans=10**4
for i in range(1,M):
for j in range(1,M):
if i*Mb==j*Ma:
if dp[N][i][j]<ans:
ans=dp[N][i][j]
if ans!=10**4:
print(ans)
else:
print(-1)
|
s053679924 | p03803 | u277802731 | 1534281701 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 259 | #54b
n,m =map(int,input().split())
a=[input() for _ in range(n)]
b=[input() for _ in range(m)]
for i in range(n-m+1):
for j in range(n-m+1):
t = [k[j:j+m] for k in a[i:i+m]]
if t==b:
print('Yes')
exit()
print('No') |
s538885789 | p03803 | u268793453 | 1533645751 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 419 | n, m = [int(i) for i in input().split()]
A = [[] for i in range(n+1)]
for i in range(m):
a, b = [int(i) for i in input().split()]
A[a].append(b)
A[b].append(a)
flag = [False] * (n+1)
flag[0] = True
cnt = 0
def dfs(i, flag):
flag[i] = True
for b in A[i]:
if not flag[b]:
dfs(b, flag[:])
if all(flag) == True:
global cnt
cnt += 1
dfs(1, flag[:])
print(cnt)
|
s253982655 | p03803 | u095969144 | 1530079792 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 241 |
def one(x):
if x == 1:
ret = 14
return ret
else:
ret = x
return ret
a, b = map(int, int(input())
if one(a) > one(b):
print("Alice")
elif one(a) < one(b):
print("Bob")
else:
print("Draw")
|
s955492226 | p03803 | u095969144 | 1530078991 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 109 | a, b = map(input().split())
if a > b:
print("Alice")
elif a < b:
print("Bob")
else:
print("Draw") |
s243232476 | p03803 | u732963817 | 1529999515 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 510 | from itertools import combinations
N, Ma, Mb = list(map(int, input().split()))
abc = [list(map(int, input().split())) for _ in range(N)]
min_cost = -1
for _i in range(1, N+1):
all_pattern = list(combinations(range(N), _i))
for _j in all_pattern:
_a = sum([abc[_k][0] for _k in _j])
_b = sum([abc[_k][1] for _k in _j])
_c = sum([abc[_k][2] for _k in _j])
if _b * Ma == _a * Mb:
if min_cost == -1 or min_cost > _c:
min_cost = _c
print(min_cost) |
s174428469 | p03803 | u594859393 | 1529543063 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 117 | a, b = [int('14' if x == '1' else x) for x in input().split()
print('Alice' if a > b else 'Bob' if b > a else 'Draw') |
s506315888 | p03803 | u657913472 | 1528278828 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 95 | a,b=(int(i)+11)%13 for i in input().split()
print("Bob" if a<b else "Alice" if a>b else "Draw") |
s372054056 | p03803 | u288087195 | 1528211547 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 189 | a = [int(i) for i in input().split()]
if a[0] == 1:
a[0] = a[0] +13
if a[1] ==1:
a[1] = a[1] + 13
if a[0] > a[1]:
print("Alice")
elif a[0] < a[1]:
print("Bob")
else
print("Draw") |
s000761098 | p03803 | u982762220 | 1527035456 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 167 | 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') |
s389553901 | p03803 | u999228723 | 1524260634 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 208 | while 1<=A<=13 and 1<=B<=13
if A=B:
print("Draw")
elif A=1 and B=13:
print("Alice")
elif A=13 and B=1:
print("Bob")
elif A>B:
print("Alice")
else A<B:
print("Bob") |
s898979842 | p03803 | u499259667 | 1524258693 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 155 | 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") |
s364120435 | p03803 | u766407523 | 1523387370 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 154 | A, B = map(int, input())
if A == 1:
A = 14
if B == 1:
B = 14
if A == B:
print('Draw')
elif A > B:
print('Alice')
else:
print ('Bob')
|
s646714639 | p03803 | u461636820 | 1522305875 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 162 | 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') |
s355350228 | p03803 | u479060428 | 1522091352 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 203 | A,B=map(int,input().split())
elif A==B==1 :
print("Draw")
if A==1:
print("Alice")
elif B==1 :
print("Bob")
elif A<B:
print("Bob")
elif A>B:
print("Alice")
elif A==B:
print("Draw") |
s513175535 | p03803 | u479060428 | 1522091214 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 191 | A,B=map(int,input().split())
if A==1:
print(Alice)
elif B==1 :
print(Bob)
elif A==B==1 :
print(Draw)
elif A<B:
print(Bob)
elif A>B:
print(Alice)
elif A==B:
print(Draw) |
s953746498 | p03803 | u391475811 | 1521773894 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 137 | A,B=map(int,input().split())
if A==1:
A+=13
if B==1:
B+=13:
if A==B:
print("Draw")
elif A<B:
print("Bob")
else:
print("Alice") |
s086524285 | p03803 | u228759454 | 1521683305 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 222 | a, b = map(int input().split())
def convert_num(a):
if a == 1:
a = 14
return a
a = convert_num(a)
b = convert_num(b)
if a > b:
print('Alice')
elif a == b:
print('Draw')
else:
print('Bob')
|
s093013653 | p03803 | u127856129 | 1521467839 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 154 | s=[13,1,2,3,4,5,6,7,8,9,10,11,12]
a,b=map(int,input().split())
if s[a-1]==s[b-1]:
print("Draw")
elif s[a-1]<s[b-1]
print("Bob")
else:
print("Alice") |
s935931329 | p03803 | u143492911 | 1519160035 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 164 | a,b=map(int,input().split())
if a==1:
print("Alice")
elif b==1:
print("Bob")
elif a<b:
print("Bob")
elif:b<a
print("Alice")
else:
print("Draw")
|
s553977606 | p03803 | u030726788 | 1518901733 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 181 | a,b=map(int,input().split())
if(a==b):
print("Draw")
elif(a<b):
if(a==1):
print("Alice")
else:
print("Bob")
else:
if(b==1):
print("Alice")
else:
print("Bob")
|
s065968539 | p03803 | u748135969 | 1516230518 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 109 | A, B = map(int, input().split())
if A > b:
print('Alice')
elif A < B:
print('Bob')
else:
print('Draw') |
s661394781 | p03803 | u612721349 | 1514555265 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 121 | a,b=map(int,input().split())
h=[14]+list(range(2,14))
ifa==b:
print("Draw")
else:
print("Alice"if h[a]>h[b]else"Bob") |
s980799779 | p03803 | u558836062 | 1513666512 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 205 | N,M = map(int,input().split())
A = ""
B = ""
for i in range(N):
A += input()
for i in range(M):
if i % 2 == 0:
B += input()
else:
B += input()[::-1]
if B in A:
print("Yes")
else:
print("No") |
s766426462 | p03803 | u865646085 | 1510109851 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 162 | a = input()
b = input()
if(a==1):
a = 14
elif(b==1):
b = 14
if(a==b):
print("Draw\n")
elif(a>b):
print("Alice\n")
elif(a<b):
print("Bob\n")
|
s592024956 | p03803 | u785205215 | 1507671276 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1049 | from sys import stdin, setrecursionlimit
setrecursionlimit(5000)
def readLine_int_list():return list(map(int, stdin.readline().split()))
def readAll_int(): return list(list(map(int,i.split())) for i in stdin.read().split("\n"))
def gcd(a, b):
while b:
a, b = b, a % b
return a
def ratio(a,b):
return (a//gcd(a,b), b//gcd(a,b))
def add_ratio(a,b):
if a != 0:
sum_a = sum(a)
sum_b = sum(b)
_a = a[0]*sum_b + b[0]*sum_a
_b = b[1]*sum_a + a[1]*sum_b
return ratio(_a, _b)
else:
return(b)
def dfs(i, v, r,ans):
if i == n:
if r == (Ma,Mb):
ans.append(v)
return 0
if dfs(i+1, v, r,ans):
return 0
if dfs(i+1, v+D[i][2], add_ratio(r,ratio(D[i][0],D[i][1])), ans):
return 0
return 0
ans = []
n, Ma, Mb = readLine_int_list()
D = readAll_int()
e=0
for i in D:
e += i[2]
def main():
dfs(0,0,0,ans)
if ans:
print(min(ans))
else:
print(-1)
if __name__ == "__main__":
main() |
s107547054 | p03803 | u742897895 | 1505444822 | Python | PyPy3 (2.4.0) | py | Runtime Error | 171 | 38512 | 821 | n, ma, mb = map(int,input().split())
a = [0] * (n + 1)
b = [0] * (n + 1)
c = [0] * (n + 1)
for i in range(1, n + 1):
a[i], b[i], c[i] = map(int,input().split())
#iまでの薬品で、aがj(g),bがk(g)となるときの最小コスト
dp = [[[10 ** 15 for i in range(n + 1)] for j in range(401)] \
for k in range(401)]
dp[0][0][0] = 0
for i in range(1, n + 1):
for j in range(401):
for k in range(401):
if j < a[i] or k < b[i]:
dp[k][j][i] = dp[k][j][i - 1]
else:
dp[k][j][i] = min(dp[k][j][i - 1], \
dp[k - b[i]][j - a[i]][i - 1] + c[i])
i = 1
ans = 10 ** 15
while True:
if i * ma > 400 or i * mb > 400:
break
ans = min(ans, dp[i * mb][i * ma][n])
i += 1
if ans == 10 ** 15:
ans = -1
print(ans) |
s931853916 | p03803 | u742897895 | 1505443609 | Python | Python (3.4.3) | py | Runtime Error | 69 | 5596 | 1025 | import fractions
n, ma, mb = map(int,input().split())
a = [0] * (n + 1)
b = [0] * (n + 1)
c = [0] * (n + 1)
for i in range(1, n + 1):
a[i], b[i], c[i] = map(int,input().split())
#iまでの薬品で、aがj(g),bがk(g)となるときの最小コスト
dp = [[[10**15 for i in range(n + 1)] for j in range(401)] \
for k in range(401)]
dp[0][0][0] = 0
sa = [0] * (n + 1)
sb = [0] * (n + 1)
for i in range(1, n + 1):
sa[i] = sa[i - 1] + a[i]
sb[i] = sb[i - 1] + b[i]
for i in range(1, n + 1):
for j in range(sa[i] + 1):
for k in range(sb[i] + 1):
# i番目を買うか、買わないか
if j < a[i] or k < b[i]:
dp[k][j][i] = dp[k][j][i - 1]
else:
dp[k][j][i] = min(dp[k][j][i - 1], \
dp[k - b[i]][j - a[i]][i - 1] + c[i])
i = 1
ans = 10 ** 15
while True:
if i * ma > 400 or i * mb > 400:
break
ans = min(ans, dp[i * mb][i * ma][n])
i += 1
if ans == 10 ** 15:
ans = -1
print(ans)
|
s826532422 | p03803 | u742897895 | 1505443576 | Python | Python (3.4.3) | py | Runtime Error | 39 | 5300 | 1025 | import fractions
n, ma, mb = map(int,input().split())
a = [0] * (n + 1)
b = [0] * (n + 1)
c = [0] * (n + 1)
for i in range(1, n + 1):
a[i], b[i], c[i] = map(int,input().split())
#iまでの薬品で、aがj(g),bがk(g)となるときの最小コスト
dp = [[[10**15 for i in range(n + 1)] for j in range(401)] \
for k in range(401)]
dp[0][0][0] = 0
sa = [0] * (n + 1)
sb = [0] * (n + 1)
for i in range(1, n + 1):
sa[i] = sa[i - 1] + a[i]
sb[i] = sb[i - 1] + b[i]
for i in range(1, n + 1):
for j in range(sa[i] + 1):
for k in range(sb[i] + 1):
# i番目を買うか、買わないか
if j < a[i] or k < b[i]:
dp[k][j][i] = dp[k][j][i - 1]
else:
dp[k][j][i] = min(dp[k][j][i - 1], \
dp[k - b[i]][j - a[i]][i - 1] + c[i])
i = 1
ans = 10 ** 15
while True:
if i * ma > 400 or i * mb > 400:
break
ans = min(ans, dp[i * mb][i * ma][n])
i += 1
if ans == 10 ** 15:
ans = -1
print(ans)
|
s794192108 | p03803 | u772180901 | 1499351270 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 175 | if a == b:
print("Draw")
elif a > b and b != 1:
print("Alice")
elif b == 1 and a > b:
print("Bob")
elif a == 1 and b > a:
print("Alice")
else:
print("Bob") |
s025810221 | p03803 | u120026978 | 1498152837 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 148 | a, b = int(input())
if a == 1:
a = 14
elif b == 1:
b = 14
if a > b:
print("Alice")
elif a < b:
print("Bob")
else:
print("Draw") |
s043962705 | p03803 | u667084803 | 1497943375 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 336 | import sys
N,M=map(int,input().split())
A=[]
B=[]
A+=[str(input()) for i in range(N)]
B+=[str(input()) for i in range(M)]
for i in range(N-M+1):
for j in range(N-M+1):
ans=1
for k in range(M):
for l in range(M):
if B[k][l]!=A[i+k][j+l]:
ans=0
if ans:
print("Yes")
sys.exit()
print("No") |
s040861229 | p03803 | u502149531 | 1497858461 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 163 | , b = map(int, input().split())
if a == 1 :
a = 14
if b == 1 :
b = 14
if a > b :
print ('Alice')
elif a < b :
print('Bob')
else :
print('Draw') |
s201580389 | p03803 | u093492951 | 1496257822 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 546 | import sys
N, M = [int(i) for i in input().split()]
A = [[i for i in input()] for j in range(N)]
B = [[i for i in input()] for k in range(M)]
for i in range(N-M):
for j in range(N-M):
diff = 0
for k in range(M):
for l in range(M):
if A[i+k][j+l] != B[k][l]:
diff = 1
break
if diff == 1:
break
if diff == 0:
print('Yes')
sys.exit()
print('No')
|
s726280279 | p03803 | u683479402 | 1494451105 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 642 | # Suplemental: ABC54 C
N, M = map(int, input().split())
E = [[] for i in range(N+1)]
for i in range(M):
a,b = map(int, input().split())
E[a].append(b)
E[b].append(a)
#for i in range(1,N+1):
# print(E[i])
visited = [False for i in range(N+1)]
num_of_paths = 0
def dfs(v):
global num_of_paths
if visited.count(True) == N:
num_of_paths += 1
return
else:
for next_v in E[v]:
if not visited[next_v]:
visited[next_v] = True
dfs(next_v)
visited[next_v] = False
return
visited[1] = True
dfs(1)
print(num_of_paths) |
s469169229 | p03803 | u410717334 | 1493452335 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3192 | 466 | def bsolve(a,b,c,d):
M=len(b)
for i in range(M):
for j in range(M):
if(a[c+i][d+j]!=b[i][j]):
return int(0)
return int(1)
def b():
N,M=list(map(int,input().split()))
A=[input()for _ in range(N)]
B=[input()for _ in range(M)]
flag=0
for i in range(N-M+1):
for j in range(N-M+1):
if(A[i][j]==B[0][0]):
flag=bsolve(A,B,i,j)
if(flag==1):
print("Yes")
return
if(flag==1):
print("Yes")
return
else:
print("No")
return
b() |
s253056390 | p03803 | u961606648 | 1493265013 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 119 | A = int(input())
B = int(input())
if A > B:
print("Alice")
if A == B:
print("Draw")
if A < B:
print("Bob") |
s017476950 | p03803 | u961606648 | 1493264222 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 113 | A = input("")
B = input("")
if A > B:
print("Alice")
if A == B:
print("Draw")
if A < B:
print("Bob") |
s809733671 | p03803 | u961606648 | 1493263985 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 109 | A = input()
B = input()
if A > B:
print("Alice")
if A == B:
print("Draw")
if A < B:
print("Bob") |
s177778647 | p03803 | u732844340 | 1492966816 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 204 | n = list(map(int, input().split))
a = n[0]
b = n[1]
if a == b:
print("Draw")
elif a == 1:
print("Alice")
elif b == 1:
print("Bob")
elif a > b:
print("Alice")
elif b > a:
print("Bob") |
s983047420 | p03803 | u322993301 | 1492344210 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 612 | '''
Created on 2017/04/15
@author: admin
'''
import itertools
# import random
# for i in range(20):
# print(random.randint(1, 10), random.randint(1, 10), random.randint(1, 100))
chemicals = []
N, Ma, Mb = map(int, input().split())
chemicals = [[int(i) for i in input().split()] for i in range(N)]
# print(chemicals)
ans = False
cost = []
for i, j in itertools.combinations(chemicals, 2):
if(i[0] + j[0] == i[1] + j[1]):
# print(i, j, "cost:", i[2]+j[2])
cost.append(i[2]+j[2])
ans = True;
# print(i, j)
# print(cost)
if(ans is not True): print(-1)
else: print(min(cost)) |
s862364008 | p03803 | u466826467 | 1489124513 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3316 | 661 | import re
first_line = input().split()
n = int(first_line[0])
m = int(first_line[1])
n_list = []
for i in range(n):
n_list.append(input())
m_list = []
for i in range(m):
m_list.append(input())
match_flg = False
for i in range(0, n - m + 1):
matchOb = re.match(m_list[0], n_list[i])
if matchOb:
start_pos = matchOb.start()
end_pos = matchOb.end()
for j in range(0, m):
if n_list[i + j][start_pos:end_pos] == m_list[j] and j == m - 1:
match_flg = True
elif n_list[i + j][start_pos:end_pos] != m_list[j]:
break
if match_flg:
print("Yes")
else:
print("No")
|
s718087683 | p03803 | u112902287 | 1489006640 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 568 | import sys
n, m = map(int, input().split())
a = []
for i in range(n):
a.append(list(input()))
b = []
for i in range(m):
b.append(list(input()))
for i in range(n-m+1):
for j in range(n-m+1):
for k in range(m):
if k <= m-2:
if a[i+k][j:j+m] == b[k]:
continue
else:
break
else:
if a[i+k][j:j+m] == b[k]:
print("Yes")
sys.exit()
else:
break
print("No")
|
s282666179 | p03803 | u873904588 | 1488515013 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 247 | N,M = map(int, input().split())
a=[input() for i in range(N)]
b=[input() for i in range(M)]
ans = 0
for i in range(N-M+1):
for j in range(N-M+1):
t = [k[j:j+M] for k in a[i:i+M]]
if t==b: ans =1
print("Yes" if ans else "No")
|
s583914906 | p03803 | u583631641 | 1488144808 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 394 | n,m = map(int,input().split())
a = [input() for i in range(n)]
b = [input() for i in range(m)]
def check(i,j):
for row in range(m):
for col in range(m):
if a[row + i][col + j] == b[row][col]:
return True
return False
for i in range(n-m+1):
for j in range(n-m+1):
if check(i,j):
print("Yes")
exit()
print("No")
|
s692195765 | p03803 | u916127336 | 1488091799 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 174 | alice, bob = int(raw_input().split())
if alice == 1: alice = 14
if bob == 1: bob = 14
if alice < bob:
print 'Alice'
elif alice > bob:
print 'Bob'
else:
print 'Draw'
|
s896351690 | p03803 | u916127336 | 1488091755 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 184 | alice = int(raw_input())
bob = int(raw_input())
if alice == 1: alice = 14
if bob == 1: bob = 14
if alice < bob:
print 'Alice'
elif alice > bob:
print 'Bob'
else:
print 'Draw'
|
s091342727 | p03803 | u805887876 | 1487796761 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 140 | a,b = map(int, raw_input().split())
ap = (a+11)%12
bp = (b+11)%12
if ap > bp:
print "Alice"
elif ap < bp:
print "Bob"
else:
print Draw |
s266194087 | p03803 | u177756077 | 1487740514 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2692 | 374 | #!/usr/bin/env python
from itertools import permutations
N,M=map(int,raw_input().split())
path=[]
all_list=[]
count=0
for i in range(M):
path.append(map(int,raw_input().split()))
NN=N*(N-1)/2
all_list=map(list,permutations(range(1,NN+1),2))
for i in range(len(all_list)):
for j in range(M):
if all_list[i]==path[j]:
count=count+1
print count |
s691540839 | p03803 | u177756077 | 1487738427 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 320 | #!/usr/bin/env python
N,M=map(int,input().split())
path=[]
all_list=[]
count=0
for i in range(M):
path.append(map(int,raw_input().split()))
NN=N*(N-1)/2
all_list=map(list,permutations(range(NN),2))
for i in all_list[i]:
for j in path[j]:
if all_list[i]==path[j]:
count=count+1
print count |
s439458463 | p03803 | u177756077 | 1487737895 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 311 | #!/usr/bin/env python
N,M=input().split()
path=[]
all_list=[]
count=0
for i in range(M):
path.append(map(int,raw_input().split()))
NN=N*(N-1)/2
all_list=map(list,permutations(range(NN),2))
for i in all_list[i]:
for j in path[j]:
if all_list[i]==path[j]:
count=count+1
print count |
s986846457 | p03803 | u588339505 | 1487382693 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 147 | a, b = int(input().split())
if a == 1: a = 14
if b == 1: b = 14
if a < b:
print('Bob')
elif b < a:
print('Alice')
else:
print('Draw') |
s600257914 | p03803 | u132313362 | 1487308217 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 270 | #-*- encoding:utf-8 -*-
AliceN = input()
BobN = input()
if AliceN == BobN:
print("Draw")
elif AliceN == 1:
print("Alice")
elif BobN == 1:
print("Bob")
elif AliceN > BobN:
print("Alice")
elif AliceN < BobN:
print("Bob")
|
s458390499 | p03803 | u132313362 | 1487307774 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 329 | #-*- encoding:utf-8 -*-
AliceN = input()
BobN = input()
if AliceN == 1 and BobN == 1:
print("Draw")
elif AliceN == BobN:
print("Draw")
elif AliceN == 1:
print("Alice")
elif BobN == 1:
print("Bob")
elif AliceN > BobN:
print("Alice")
elif AliceN < BobN:
print("Bob")
|
s728224332 | p03803 | u132313362 | 1487307557 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 320 | #-*- encoding:utf-8 -*-
AliceN, BobN = input()
if AliceN == 1 and BobN == 1:
print("Draw")
elif AliceN == BobN:
print("Draw")
elif AliceN == 1:
print("Alice")
elif BobN == 1:
print("Bob")
elif AliceN > BobN:
print("Alice")
elif AliceN < BobN:
print("Bob")
|
s112433045 | p03803 | u132313362 | 1487307346 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 347 | #-*- encoding:utf-8 -*-
AliceN = int(raw_input())
BobN = int(raw_input())
if AliceN == 1 and BobN == 1:
print("Draw")
elif AliceN == BobN:
print("Draw")
elif AliceN == 1:
print("Alice")
elif BobN == 1:
print("Bob")
elif AliceN > BobN:
print("Alice")
elif AliceN < BobN:
print("Bob")
|
s063887400 | p03803 | u132313362 | 1487307294 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 347 | #-*- encoding:utf-8 -*-
AliceN = int(raw_input())
BobN = int(raw_input())
if AliceN == 1 and BobN == 1:
print("Draw")
elif AliceN == BobN:
print("Draw")
elif AliceN == 1:
print("Alice")
elif BobN == 1:
print("Bob")
elif AliceN > BobN:
print("Alice")
elif AliceN < BobN:
print("Bob")
|
s399102641 | p03803 | u132313362 | 1487307265 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 348 | #-*- encoding:utf-8 -*-
AliceN = int(raw_input(1))
BobN = int(raw_input(1))
if AliceN == 1 and BobN == 1:
print("Draw")
elif AliceN == BobN:
print("Draw")
elif AliceN == 1:
print("Alice")
elif BobN == 1:
print("Bob")
elif AliceN > BobN:
print("Alice")
elif AliceN < BobN:
print("Bob") |
s118382919 | p03803 | u132313362 | 1487307237 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 24 | 金獅子のホルモン |
s986533998 | p03803 | u600601196 | 1487281224 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 226 | import sys
[Alice, Bob] = sys.argv[1].split()
if Alice == Bob:
print 'Draw'
return 0
if Alice == '1':
print 'Alice'
return 0
if Bob == '1':
print 'Bob'
return 0
if int(Alice) < int(Bob):
print 'Bob'
else:
print 'Alice' |
s045120846 | p03803 | u754820589 | 1487273623 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 153 | a = int(raw_input())
b = int(raw_input())
if a == 1:
a = 14
if b == 1:
b = 14
if a > b:
print "Alice"
elif a < b:
print "Bob"
else:
print "Draw"
|
s628782118 | p03803 | u754820589 | 1487273402 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 156 | a = int(raw_input())
b = int(raw_input())
if a == 1:
a = 14
if b == 1:
b = 14
if a > b:
print("Alice")
elif a < b:
print("Bob")
else:
print("Draw")
|
s456990713 | p03803 | u754820589 | 1487273305 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 164 | a = int(raw_input())
b = int(raw_input())
if a == 1:
a = a + 13
if b == 1:
b = b + 13
if a > b:
print("Alice")
elif a < b:
print("Bob")
else:
print("Draw")
|
s236074365 | p03803 | u754820589 | 1487273144 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 162 | a = int(raw_input())
b = int(raw_input())
if a == 1
a = a + 13
if b == 1
b = b + 13
if a > b:
print("Alice")
elif a < b:
print("Bob")
else:
print("Draw")
|
s179871496 | p03803 | u754820589 | 1487272857 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 116 | a = int(raw_input())
b = int(raw_input())
if a > b:
print("Alice")
elif a < b:
print("Bob")
else:
print("Draw")
|
s838826999 | p03803 | u754820589 | 1487272824 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2572 | 115 | a = int(raw_input())
b = int(raw_input())
if a > b:
print("Alice")
elif a < b:
print("Bob")
else:
print("Draw") |
s032188974 | p03803 | u438396676 | 1487268926 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 248 | lis=input().split()
a=int(lis[0])
b=int(lis[1])
if a=1:
if b=1:
print(Draw)
else :
print(Alice)
elif b=1:
print(Bob)
else :
if a>b:
print(Alice)
elif a=b:
print(Draw)
else :
print(Bob) |
s698333806 | p03803 | u966601619 | 1487225560 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 103 | a = map(int, raw_input().split())
a[0] = (a[0] + 12) % 13
a[1] = (a[1] + 12) % 13
if a[0] == a[1] :
|
s344710469 | p03803 | u290326033 | 1487133436 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 194 | import sys
A, B = list(map(int, input().spllit()))
if A == B:
print("draw")
sys.exit()
elif A == 1: print("Alice")
elif B == 1: print("Bob")
elif A > B: print("Alice")
else: print("Bob") |
s733186906 | p03803 | u261839764 | 1487101739 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 295 | # -*- coading: utf-8 -#-
A = raw_input()
B = A.split()
C, D = int(B[0]), int(B[1])
if C == 1:
if D == 1:
print 'Draw'
else:
print 'Alice'
else:
if D == 1:
print 'Bob'
else:
if C > D:
print 'Alice'
elif C < D:
print 'Bob'
else:
print 'Draw' |
s665472783 | p03803 | u344563796 | 1487101662 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2568 | 296 | # -*- coading: utf-8 -#-
A = raw_input()
B = A.split( )
C, D = int(B[0]), int(B[1])
if C == 1:
if D == 1:
print 'Draw'
else:
print 'Alice'
else:
if D == 1:
print 'Bob'
else:
if C > D:
print 'Alice'
elif C < D:
print 'Bob'
else:
print 'Draw' |
s959557777 | p03803 | u261839764 | 1487101541 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2568 | 296 | # -*- coading: utf-8 -#-
A = raw_input()
B = A.split( )
C, D = int(B[0]), int(B[1])
if C == 1:
if D == 1:
print 'Draw'
else:
print 'Alice'
else:
if D == 1:
print 'Bob'
else:
if C > D:
print 'Alice'
elif C < D:
print 'Bob'
else:
print 'Draw' |
s918635515 | p03803 | u791838908 | 1487095105 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 112 |
A = int(input())
B = int(input())
if(A > B):
print("Alice")
elif(B > A):
print("Bob")
else:
print("Draw") |
s532878045 | p03803 | u791838908 | 1487094749 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 111 | A = int(input())
b = int(input())
if(A > B):
print("Alice")
elif(B > A):
print("Bob")
else:
print("Draw") |
s288688883 | p03803 | u791838908 | 1487094667 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 78 | if(A > B):
print("Alice")
elif(B > A):
print("Bob")
else:
print("Draw")
|
s139282522 | p03803 | u261839764 | 1487056928 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 150 | {1:14}
A = raw_input()
A.split( )
if int(A) == int(B):
print 'Draw'
elif int(A) > int(B):
print 'Alice'
elif int(B) > int(A):
print 'Bob' |
s813045044 | p03803 | u261839764 | 1487056866 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2568 | 151 | A = raw_input()
A.split( )
{1:14}
if int(A) == int(B):
print 'Draw'
elif int(A) > int(B):
print 'Alice'
elif int(B) > int(A):
print 'Bob' |
s600626350 | p03803 | u261839764 | 1487056733 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2568 | 153 | A = raw_input()
A.split(' ')
{1:14}
if int(A) == int(B):
print 'Draw'
elif int(A) > int(B):
print 'Alice'
elif int(B) > int(A):
print 'Bob' |
s606204605 | p03803 | u261839764 | 1487056655 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 158 | A = int(raw_input())
A.split(' ')
{1:14}
if int(A) == int(B):
print 'Draw'
elif int(A) > int(B):
print 'Alice'
elif int(B) > int(A):
print 'Bob' |
s243975078 | p03803 | u261839764 | 1487056586 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 156 | A = int(raw_input())
A.split( )
{1:14}
if int(A) == int(B):
print 'Draw'
elif int(A) > int(B):
print 'Alice'
elif int(B) > int(A):
print 'Bob' |
s588708265 | p03803 | u261839764 | 1487055996 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2568 | 200 | A = raw_input(('A='))
B = raw_input(('B='))
if A == 1:
A = 1
if B == 1:
B = 1
if int(A) == int(B):
print 'Draw'
elif int(A) > int(B):
print 'Alice'
elif int(B) > int(A):
print 'Bob' |
s342497777 | p03803 | u261839764 | 1487055790 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2568 | 123 | {1:14}
if int(A) == int(B):
print 'Draw'
elif int(A) > int(B):
print 'Alice'
elif int(B) > int(A):
print 'Bob' |
s596733787 | p03803 | u261839764 | 1487055557 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 164 | {1:14}
A = raw_input('A=')
B = raw_input('B=')
if int(A) == int(B):
print 'Draw'
elif int(A) > int(B):
print 'Alice'
elif int(B) > int(A):
print 'Bob' |
s951048712 | p03803 | u261839764 | 1487055419 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 161 | {1:14}
A = raw_input('A=')
B = raw_input('B=')
if int(A) == int(B)
print 'Draw'
elif int(A) > int(B)
print 'Alice'
elif int(B) > int(A)
print 'Bob' |
s120384245 | p03803 | u344563796 | 1487054917 | Python | PyPy2 (5.6.0) | py | Runtime Error | 44 | 9328 | 444 | A = jnt(raw_input('A='))
B = int(raw_input('B='))
if A == 1
A = A + 13
if B == 1
B = B + 13
if A == B
print 'Draw'
elif A > B
print 'Alice'
elif B > A
print 'Bob'
elif B != 1
if A == B
print 'Draw'
elif A > B
print 'Alice'
elif B > A
print 'Bob'
elif A != 1
if A == B
print 'Draw'
elif A > B
print 'Alice'
elif B > A
print 'Bob' |
s446110791 | p03803 | u284774654 | 1487024145 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2692 | 93 | a = input()
b, c = map(int, raw_input().split())
s = raw_input()
print str(a+b+c) + " " + s
|
s294230405 | p03803 | u712187387 | 1487022674 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 525 | import itertools
import numpy as np
N,Ma,Mb=map(int,input().split())
yaku=[]
for _ in range(N):
yaku.append(list(map(int,input().split())))
candi_money=[]
for n in range(N):
candis=list(itertools.combinations(np.arange(N),n))
for candi in candis:
a,b,c=0,0,0
for num in candi:
a +=yaku[num][0]
b +=yaku[num][1]
c +=yaku[num][2]
if a/flaot(Ma/Mb)=b:
candi_money.append(c)
if len(candi_money)==0:
print(-1)
else:
print(min(candi_money)) |
s521193392 | p03803 | u805944761 | 1487013272 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 225 | # get Alice's card A and Bob's card B
a, b = map(int, raw_input().split())
# adjust for card strength, 1 > 13
if a == 1:
a = 14
if b == 1:
b = 14
if a > b:
print ("Alice")
elif a < b:
print ("Bob")
else:
print ("Draw") |
s975587124 | p03803 | u820357030 | 1486952547 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 809 | N, M = (int(i) for i in input().split())
a = []
b = []
for i in range(N):
data = list(input())
a.append(data)
for i in range(M):
data = list(input())
b.append(data)
#N=4
#M=2
#a=[['a','s','a','s'],['a','a','s','s'],['s','a','a','s'],['s','a','a','a']]
#b=[['s','a'],['a','s']]
L = N-M
def check(i,j):
ans=True
for line in range(M):
if (ans==False):
break
for row in range(M):
if (a[i+line][j+row]!=b[line][row]):
ans=False
break
return ans
ans=False
for i in range(L+1):
if(ans==True):
break
for j in range(L+1):
ansnow=check(i,j)
print(ansnow,i,j)
if(ansnow==True):
ans=True
break
if(ans==True):
print('Yes')
else:
print('No')
|
s983388109 | p03803 | u820357030 | 1486952137 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 628 | N, M = (int(i) for i in input().split())
a = []
b = []
for i in range(N):
data = list(input())
a.append(data)
for i in range(M):
data = list(input())
b.append(data)
L = N-M
def check(i,j):
ans=True
for line in range(L+1):
for row in range(L+1):
if (a[i+line][j+row]!=b[line][row]):
ans=False
break
return ans
ans=False
for i in range(L+1):
for j in range(L+1):
ansnow=check(i,j)
# print(ansnow,i,j)
if(ansnow==True):
ans=True
break
if(ans==True):
print('Yes')
else:
print('No')
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.