Problem:


Score : 100 points

Problem Statement

Alice and Bob are playing One Card Poker.

One Card Poker is a two-player game using playing cards.  

Each card in this game shows an integer between 1 and 13, inclusive.

The strength of a card is determined by the number written on it, as follows:  

Weak 2 < 3 < 4 < 5 < 6 < 7 < 8 < 9 < 10 < 11 < 12 < 13 < 1 Strong  

One Card Poker is played as follows:  

Each player picks one card from the deck. The chosen card becomes the player's hand.

The players reveal their hands to each other. The player with the stronger card wins the game.

If their cards are equally strong, the game is drawn.  

You are watching Alice and Bob playing the game, and can see their hands.

The number written on Alice's card is A, and the number written on Bob's card is B.

Write a program to determine the outcome of the game.  

Constraints

1≦A≦13 

1≦B≦13 

A and B are integers.

Input

The input is given from Standard Input in the following format:

A B

Output

Print Alice if Alice will win. Print Bob if Bob will win. Print Draw if the game will be drawn.

Sample Input 1

8 6

Sample Output 1

Alice

8 is written on Alice's card, and 6 is written on Bob's card.
Alice has the stronger card, and thus the output should be Alice.

Sample Input 2

1 1

Sample Output 2

Draw

Since their cards have the same number, the game will be drawn.

Sample Input 3

13 1

Sample Output 3

Bob



Sample input:
8 6


Sample output:
Alice

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())

if A > b:
  print('Alice')
elif A < B:
  print('Bob')
else:
  print('Draw')

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
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()

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
, 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')

Submission status: Runtime Error

Solution code:
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')

Submission status: Runtime Error

Solution code:
# 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)

Submission status: Runtime Error

Solution code:
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()

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())

if A > B:
    print("Alice")
if A == B:
    print("Draw")
if A < B:
    print("Bob")

Submission status: Runtime Error

Solution code:
A = input("")
B = input("")

if A > B:
    print("Alice")
if A == B:
    print("Draw")
if A < B:
    print("Bob")

Submission status: Runtime Error

Solution code:
A = input()
B = input()

if A > B:
    print("Alice")
if A == B:
    print("Draw")
if A < B:
    print("Bob")

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
'''
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))

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
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'

Submission status: Runtime Error

Solution code:
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'

Submission status: Runtime Error

Solution code:
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

Submission status: Runtime Error

Solution code:
#!/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

Submission status: Runtime Error

Solution code:
#!/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

Submission status: Runtime Error

Solution code:
#!/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

Submission status: Runtime Error

Solution code:
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')

Submission status: Runtime Error

Solution code:
#-*- 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")

Submission status: Runtime Error

Solution code:
#-*- 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")

Submission status: Runtime Error

Solution code:
#-*- 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")

Submission status: Runtime Error

Solution code:
#-*- 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")

Submission status: Runtime Error

Solution code:
#-*- 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")

Submission status: Runtime Error

Solution code:
金獅子のホルモン

Submission status: Runtime Error

Solution code:
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'

Submission status: Runtime Error

Solution code:
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"

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
a = int(raw_input())
b = int(raw_input())

if a > b:
	print("Alice")
elif a < b:
	print("Bob")
else:
	print("Draw")

Submission status: Runtime Error

Solution code:
a = int(raw_input())
b = int(raw_input())

if a > b:
	print("Alice")
elif a < b:
	print("Bob")
else:
	print("Draw")

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
a = map(int, raw_input().split())

a[0] = (a[0] + 12) % 13
a[1] = (a[1] + 12) % 13

if a[0] == a[1]  :

Submission status: Runtime Error

Solution code:
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")

Submission status: Runtime Error

Solution code:
# -*- 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'

Submission status: Runtime Error

Solution code:
# -*- 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'

Submission status: Runtime Error

Solution code:

A = int(input())
B = int(input())
if(A > B):
  print("Alice")
elif(B > A):
  print("Bob")
else:
  print("Draw")

Submission status: Runtime Error

Solution code:
A = int(input())
b = int(input())
if(A > B):
  print("Alice")
elif(B > A):
  print("Bob")
else:
  print("Draw")

Submission status: Runtime Error

Solution code:
if(A > B):
  print("Alice")
elif(B > A):
  print("Bob")
else:
  print("Draw")

Submission status: Runtime Error

Solution code:
{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'

Submission status: Runtime Error

Solution code:
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'

Submission status: Runtime Error

Solution code:
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'

Submission status: Runtime Error

Solution code:
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'

Submission status: Runtime Error

Solution code:
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'

Submission status: Runtime Error

Solution code:
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'

Submission status: Runtime Error

Solution code:
{1:14}

if int(A) == int(B):
  print 'Draw'

elif int(A) ＞ int(B):
  print 'Alice'

elif int(B) ＞ int(A):
  print 'Bob'

Submission status: Runtime Error

Solution code:
{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'

Submission status: Runtime Error

Solution code:
{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'

Submission status: Runtime Error

Solution code:
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'

Submission status: Runtime Error

Solution code:
a = input()
b, c = map(int, raw_input().split())
s = raw_input()

print str(a+b+c) + " " + s

Submission status: Runtime Error

Solution code:
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))

Submission status: Runtime Error

Solution code:
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')

Submission status: Runtime Error

Solution code:
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')

Submission status: Runtime Error

Solution code:
#ABC054A

a,b=map(int<raw_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'

Submission status: Runtime Error

Solution code:
import numpy as np

if __name__=="__main__":
    inputs_number  = lambda : [int(x) for x in input().split()]
    N, Ma, Mb = inputs_number()
    drugs = [inputs_number() for i in range(N)]
    inf = 100*N + 1
    dp = np.ones((N+1,N*10+1,N*10+1)) * inf
    dp[0,0,0] = 0.0

    for i in range(N):
	for ca in range(N*10+1):
            for cb in range(N*10+1):
		if(dp[i,ca,cb]==inf):
                    continue
                dp[i+1,ca,cb]=np.min([dp[i+1,ca,cb],dp[i,ca,cb]])
                dp[i+1,ca+drugs[i][0],cb+drugs[i][1]]=np.min([dp[i+1,ca+drugs[i][0],cb+drugs[i][1]],dp[i,ca,cb]+drugs[i][2]])

Submission status: Runtime Error

Solution code:
import numpy as np

if __name__=="__main__":
    inputs_number  = lambda : [int(x) for x in input().split()]
    N, Ma, Mb = inputs_number()
    drugs = np.array([inputs_number() for i in range(N)])

    inf = 100*N + 1
    dp = np.ones((N,N*10,N*10)) * inf
    dp[0,0,0] = 0
    for i in range(0, N-1):
	for ca in range(N*10):
            for cb in range(N*10):
		if(dp[i,ca,cb]==inf):
                    continue
		dp[i+1,ca,cb]=np.min([dp[i+1,ca,cb],dp[i,ca,cb]]);
		dp[i+1,ca+drugs[i,0],cb+drugs[i,1]]=np.min([dp[i+1,ca+drugs[i,0],cb+drugs[i,1]],dp[i,ca,cb]+drugs[i,2]]);

    ans = inf
    for i in range(1, N):
	for ca in range(1, N*10):
            for cb in range(1, N*10):
		if(Ma*cb == Mb*ca and dp[i,ca,cb] < ans):
                    ans = dp[i,ca,cb]
    if(ans==inf):
	ans = -1
    print(int(ans))

Submission status: Runtime Error

Solution code:
from copy import deepcopy

N, MA, MB = map(int, raw_input().split())
X = [map(int, raw_input().split()) for _ in range(N)]

DP = [[100000 for _ in range(401)] for _ in range(401)]
DP[0][0] = 0

S = {(0, 0)}
for a, b, c in X:
    DP2 = deepcopy(DP)
    for sa, sb in S:
        if DP[sa+a][sb+b] > DP2[sa][sb] + c:
            DP[sa+a][sb+b] = DP2[sa][sb] + c
    T = {(sa+a, sb+b) for sa, sb in S}
    S |= T

a, b = MA, MB
ans = 100000
while a <= 400 and b <= 400:
    ans = min(ans, DP[a][b])
    a += MA
    b += MB

if ans == 100000:
    print -1
else:
    print ans

Submission status: Runtime Error

Solution code:
m,n=map(int,raw_input().split())
a=[]*m
b=[]*n
p=0
q=0
while(q<m):
	q+=1
	a.append(raw_input())
while(p<n):
	p+=1
	b.append(raw_input())
flag=False
# print a
# print b
for i in xrange(n):
	if not b[i] in (a[i]):
		flag=True
		break
if flag:
	print "No"
else:
	print "Yes"

Submission status: Runtime Error

Solution code:
import numpy as np
n, m = map(int, raw_input().split())
a = [raw_input() for _ in xrange(n)]
b = [raw_input() for _ in xrange(m)]
f = False
for i in xrange(m):
    if b[i] in a:
        f = True

if f:
    print "Yes"
else:
    print "No"

Submission status: Runtime Error

Solution code:
if __name__=="__main__":
    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):
        print("Draw")
    else:
        print("Bob")

Submission status: Runtime Error

Solution code:
import sys
if __name__=="__main__":
    a, b = list(map(int, input().split(" ")))
    if(a == 1):
	a = 14
    if(b == 1):
	b = 14
    if(a > b):
        sys.stdout.write("Alice")
    elif(a == b):
        sys.stdout.write("Draw")
    else:
        sys.stdout.write("Bob")

Submission status: Runtime Error

Solution code:
import sys
if __name__=="__main__":
    a, b = list(map(int, input().split(" ")))
    if(a > b):
	sys.stdout.write("Alice")
    elif(a == b):
	sys.stdout.write("Draw")
    else:
	sys.stdout.write("Bob")

Submission status: Runtime Error

Solution code:
import sys
if __name__=="__main__":
    a, b = list(map(int, input().replace("\n","").split(" ")))
    if(a > b):
	sys.stdout.write("Alice")
    elif(a == b):
	sys.stdout.write("Draw")
    else:
	sys.stdout.write("Bob")

Submission status: Runtime Error

Solution code:
def read():
    return int(input())

def reads(sep=None):
    return list(map(int, input().split(sep)))

def main():
    a, b = input()
    if a == 1:
        a = 14
    if b == 1:
        b = 14

    if a == b:
        print('Draw')
    elif a > b:
        print('Alice')
    else:
        print('Bob')
 
main()

Submission status: Runtime Error

Solution code:
n = input().split()

ar = int(n[0])
br = int(n[1])

a = []
b = []
for i in range(0, ar):
    a.append(input())

for j in range(0, br):
    b.append(input())

find = False
for i in range(0, ar - br):
    idx = a[i].find(b[0])
    if idx != -1:
        match = True
        for j in range(1, br):
            idx2 = a[i + j].find(b[j])
            if idx != idx2:
                match = False
        if match:
            find = True
            break
if find:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
n,m = map(int, raw_input().split())
n_list = [] #row major format
m_list = []
for i in range(0, n):
	n_list.append(raw_input())

for x in range(0, m):
	m_list.append(raw_input())

def match_first_rows(n_start):
	result = (-1,-1)
	first_m = m_list[0] # first row
	for x in range(n_start, n):
		n_row = n_list[x]
		if first_m in n_row: # substring matching of first m_row
			j = n_row.index(first_m)
			return (x, j)
	return (-1,-1) #return -1,-1 if none found

# given the leftmost corner of matching in matrix n, start matching each row to see if there is a potential match
# only guranteed first row match
def begin_matching(i,j):
	nx_start = i
	ny_start = j
	for x in range(0,m):
		n_row_string = n_list[nx_start+x]
		n_string = n_row_string[j:j+m] # align window
		m_string = m_list[x]
		if n_string!=m_string:
			return False
	return True

def find_m():

	found_m = False
	counter = 0
	while(counter<=n-m and not(found_m)):

		i,j = match_first_rows(counter)
		if i==-1: 
			#goes through entirety, not returning things at all
			print("No")
			found_m = True
		# found a potential starting point
		else:
			result = begin_matching(i,j)
			if result:
				print("Yes")
				found_m = True
			else:
				#do it again, but one row lower
				counter +=1 

find_m()

Submission status: Runtime Error

Solution code:
from itertools import product


n, m = [int(i) for i in input().rstrip().split()]
AA = [[0 if i == '.' else 1 for i in input().rstrip()] for _ in range(n)]
BB = [[0 if i == '.' else 1 for i in input().rstrip()] for _ in range(m)]

for i_r, i_c in product(range(n - m + 1), range(n - m + 1)):
    i_r -= 1
    i_c -= 1
    for k_r, k_c in product(range(m), range(m)):
        if AA[i_r + k_r][i_c + k_c] == BB[k_r][k_c]:
            continue
        else:
            break
    else:
        print('Yes')
        break
else:
    print('No')

Submission status: Runtime Error

Solution code:
import sys

input_num = input().split()
N = int(input_num[0])
M = int(input_num[1])

A = [input() for i in range(0, N-1)]
B = [input() for n in range(0, M-1)]

if M > N:
    print("No")
elif M == N:
    for a, b in zip(A, B):
        if b not in a:
            print("No")
    else:
        print("Yes")
else:
    diff = N - M
    breaked = False
    for i in range(0, len(A)-1):
        l = i
        while l <= i + diff and l < len(B):
            if A[i] == B[l]:
                breaked = True
                break
            else:
                if breaked:
                    print("No")
                    sys.exit()
                l += 1
    if breaked:
        print("Yes")
    else:
        print("No")