Problem:


Score : 100 points

Problem Statement

Given are three integers A_1, A_2, and A_3.

If A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.

Constraints

1 \leq A_i \leq 13 \ \ (i=1,2,3)

All values in input are integers.

Input

Input is given from Standard Input in the following format:

A_1 A_2 A_3

Output

If A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.

Sample Input 1

5 7 9

Sample Output 1

win

5+7+9=21, so print win.

Sample Input 2

13 7 2

Sample Output 2

bust

13+7+2=22, so print bust.



Sample input:
5 7 9


Sample output:
win

Submission status: Runtime Error

Solution code:
n = int(input())
ret = {}
for i in range(0, n):
    a = int(input())
    ret[i] = [[], []]
    for j in range(a):
        x, y = map(int, input().split())
        x -= 1
        if y == 1:
            ret[i][0].append(x)
        elif y == 0:
            ret[i][1].append(x)
ans = 0
for u in ret:
    i = ret[u]
    num = 1 + len(i[0])
    honest = [u] + i[0]
    not_honest = i[1]
    for p in i[0]:
        # print(p, ret[p])
        for h in ret[p][0]:
            honest.append(h)
        for d in ret[p][1]:
            not_honest.append(d)
    honest = list(set(honest))
    not_honest = list(set(not_honest))
    # print(honest, not_honest)
    if list(set(honest) & set(not_honest)) == []:
        ans = max(ans, len(honest))
    for i in range(0, n):
        if i not in honest and i not in not_honest:
            t_honest, t_not_honest = [], []
            for h in ret[i][0]:
                t_honest.append(h)
            for d in ret[i][1]:
                t_not_honest.append(d)
            t_honest = list(set(t_honest))
            t_not_honest = list(set(t_not_honest))
            if list(set(honest) & set(t_not_honest)) == []:
                honest = list(set(honest + t_honest))
                ans = max(ans, len(honest))
print(ans)

Submission status: Runtime Error

Solution code:
A1=input("Enter Number A1: ")
A2=input("Enter Number A2: ")
A3=input("Enter Number A3: ")
Num=22
My_Num=int(A1)+int(A2)+int(A3)
print(My_Num)
if My_Num >= Num:
    print("bust")
else:
    print("Win")

Submission status: Runtime Error

Solution code:
a=input()
sumInput=0
for num in a:
  sumInput=sumInput+num
print sumInput

Submission status: Runtime Error

Solution code:
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "a,b,c = map(int,input().split())\n",
    "if a+b+c >= 22:\n",
    "    print('bust')\n",
    "else:\n",
    "    print('win')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())

lst = np.array([int(i) for i in input().split()])

sum = 0
for i in range(N):
    for j in range(i+1, N):
        sum += (lst[i] ^ lst[j]) 

print(int(sum % (1e9+7)))

Submission status: Runtime Error

Solution code:
l=list(map(int,input().split()))
s=sum(l)
if(l<=21):
  print("win")
else:
  print("bust")

Submission status: Runtime Error

Solution code:
A = int(input())
A_array = map(int, input().split())
A_sum = A_array[0] + A_array[1] + A_array[2]
if(A_sum < 22):
    print('win')
else:
    print('bust')

Submission status: Runtime Error

Solution code:
A1,A2,A3 = list(map(int, input().split()))

if A1+A2+A3 => 22:
    print('bust')
else:
    print('win')

Submission status: Runtime Error

Solution code:
input = input()

a = int(input[0])
b = int(input[1])
c = int(input[2])

if (a+b+c < 22): print("bust")
else: print("win")

Submission status: Runtime Error

Solution code:
a,b,c = int(input().split(" "))
if (a+b+c < 22): print("bust")
else: print("win")

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
def inpl(): return list(map(int, input().split()))

H, W = inpl()
A = [inpl() for _ in range(H)]
B = [inpl() for _ in range(W)]

DP = [[0 for _ in range(W+1)] for _ in range(H+1)]
DP[0][0] = 1 << 12800

for h in range(H):
    for w in range(W):
        d = abs(A[h][w] - B[h][w])
        DP[h+1][w] |= DP[h][w] >> d
        DP[h+1][w] |= DP[h][w] << d
        DP[h][w+1] |= DP[h][w] >> d
        DP[h][w+1] |= DP[h][w] << d
l = 1 << 12800
r = 1 << 12800
for i in range(12801):
    if (DP[-1][-2]& l) | (DP[-1][-2] & r):
        print(i)
        break
    l = l << 1
    r = r >> 1

Submission status: Runtime Error

Solution code:

#O(nm) = O(60n)で解けるはず・・・！
n = int(input())
*l, = map(int,input().split())
#2進数の桁の出現数をカウントする。
lone = [0]*60
for i in range(n):
  m = l[i]
  for j in range(60):
    lone[j] += m%2
    m=m>>1
    if m==0:
      continue
ans = 0
for i in range(len(lone)):
  ans += 2**i*lone[i]*(n-lone[i])
print(ans%(10**9+7))

Submission status: Runtime Error

Solution code:
n = int(input())
lst = [[-1 for _ in range(n)] for _ in range(n)]
for _ in range(n):
    c = int(input())
    for c1 in range(c):
        x, y = map(int, input().split())
        x -= 1
        lst[_][x] = y
        
ans = 0
for bit in range(2**n):
    flg = True
    for a in range(n):
        if (bit >> a) & 1:
            for x in range(n):
                if lst[a][x] != -1 and ((bit >> x) & 1) != lst[a][x]:
                  flg = False
                  break
    if flg:
        ans = max(ans, bin(bit).count('1'))
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
lst = [[-1 for _ in range(n)] for _ in range(n)]
for _ in range(n):
    c = int(input())
    for c1 in range(c):
        x, y = map(int, input().split())
        x -= 1
        lst[_][x] = y
        
ans = 0
for bit in range(2**n):
    flg = True
    for a in range(n):
        if (bit >> a) & 1:
            for x in range(n):
                if lst[a][x] != -1 and ((bit >> x) & 1) != lst[a][x]:
                	flg = False
                    break
    if flg:
        ans = max(ans, bin(bit).count('1'))
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
lst = [[-1 for _ in range(n)] for _ in range(n)]
for _ in range(n):
    c = int(input())
    for c1 in range(c):
        x, y = map(int, input().split())
        x -= 1
        lst[_][x] = y

ans = 0
for bit in range(n**2 - 1):
    flg = True
    for a in range(n):
        if (bit >> a) & 1:
            for x in range(n):
                if lst[a][x] != -1 and ((bit >> x) & 1) != lst[a][x]:
                    flg = False
                    break
if flg:
  ans = max(ans, bin(bit).count('1'))
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())

a = []
xys = [[] for i in range(n)]

for j in range(n):
    a.append(int(input()))
    for i in range(a[j]):
        xys[j].append(list(map(int,input().split())))

ps = []
p = [0 for i in range(n)]
for i in range(n+1):
    for combi in itertools.combinations(range(n),i):
        p = [0 for i in range(n)]
        combi = list(combi)
        for i in combi:
            p[i] = 1
        ps.append(p)

for l in range(2**n):
    for i in range(n):
        if  (ps[l])[i] == 1:
            for j in range(a[i]):
                if ps[l][xys[i][j][0] - 1] != xys[i][j][1]:
                    ps[l] = [0,0,0]

print(max(sum(ps[l]) for l in range(2**n)))

Submission status: Runtime Error

Solution code:
n = int(input())
x = []
y = []

for i in range(n):
    a = int(input())
    x.append([])
    y.append([])
    for j in range(a):
        u, v = map(int, input().split())
        x[i].append(u)
        y[i].append(v)
ans = 0
for i in range(2 ** n):
    jdg = [False] * n
    used = [False] * n
    end = False
    for j in range(n):
        if ((i >> j) & 1):
            jdg[j] = True
    for j in range(n):
        for k in range(n):
            if ((not jdg[k]) or used[k]):
                continue
            used[k] = True
            for l in range(len(x[k])):
                if (y[k][l] == 1):
                    jdg[x[k][l] - 1] = True
                elif (jdg[x[k][l] - 1]):
                    end = True
                    break
            if (end):
                break
        if (end):
            break
    if (end):
        continue
    ans = max(sum(jdg), ans)

print(ans)

Submission status: Runtime Error

Solution code:
print "bust" if sum([int(x) for x in input().split()]) > 21 else "win"

Submission status: Runtime Error

Solution code:
a, b, c = [int(x) for x in input().split()]
print(a+b+c > 21 ? 'bust' : 'win')

Submission status: Runtime Error

Solution code:
print(sum([int(x) for x in input().split()]) > 21 ? "bust":"win")

Submission status: Runtime Error

Solution code:
def counter(x):
        if x == 0:
                return 0
        return counter(x >> 1) + int(bin(x & 1), 2)

N = int(input())
A = []
x = [0] * N 
for i in range(N):
        A.append(int(input()))
        x[i] = [list(map(int, input().split())) for j in range(A[i])]

ans = 0 
for bits in range(1, 1 << N): 
        flag = 1 
        for i in range(N):
                if not int(bin(bits & (1 << i)), 2): 
                        continue
                for j in range(A[i]):
                        if int(bin((bits >> (x[i][j][0] - 1) & 1) ^ x[i][j][1]), 2): 
                                flag = 0 
        if flag:
                ans = max(ans, counter(bits))
print(ans)

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input())
t=a+b+c
if t<=21:
  print('win')
else:
  print('bust')

Submission status: Runtime Error

Solution code:
n = int(input())

testimony_dict = {}
for i in range(n):
    a = int(input())
    testimony_dict[i + 1] = []
    for j in range(a):
        xy = input().split(' ')
        testimony_dict[i + 1].append(xy)

max_valid_bin = ''
for i in range(2 ** n - 1, 0, -1):
    is_valid = True
    bin_i = format(i, '0{}b'.format(n))
    for j in range(1, len(bin_i) + 1):
        if bin_i[j - 1] == '1':
            for xy_list in testimony_dict[j]:
                if bin_i[int(xy_list[0]) - 1] != xy_list[1]:
                    is_valid = False
    if is_valid:
        max_valid_bin = bin_i
        break

print(len([i for i in max_valid_bin if i == '1']))

Submission status: Runtime Error

Solution code:
n = int(input())

testimony_dict = {}
for i in range(n):
    a = int(input())
    testimony_dict[i + 1] = []
    for j in range(a):
        xy = input().split(' ')
        testimony_dict[i + 1].append(xy)

max_valid_bin = ''
for i in range(2 ** n - 1, 0, -1):
    is_valid = True
    bin_i = format(i, '0{}b'.format(n)
    for j in range(1, len(bin_i) + 1):
        if bin_i[j - 1] == '1':
            for xy_list in testimony_dict[j]:
                if bin_i[int(xy_list[0]) - 1] != xy_list[1]:
                    is_valid = False
    if is_valid:
        max_valid_bin = bin_i
        break

print(len([i for i in max_valid_bin if i == '1']))

Submission status: Runtime Error

Solution code:
from itertools import product

N = int(input())
A = [[] for i in range(N)]

for i in range(N):
    ai = int(input())
    for j in range(ai): 
        x, y = map(int, input().split())
        x = x - 1
        A[i].append([x, y])
        
# ここから判定
ans = 0
for pattern in product([0, 1], repeat=N):
    num = pattern.count(1)
    contradictions = False
    for i, testimony in enumerate(A):
        if pattern[i] == 0:
            continue
        for t in testimony:
            x, y = t
            if pattern[x] != Y ^ (1- pattern[i]):
                contradictions  = True
                break
        if contradictions:
            break
    if contradictions:
        continue
    ans = max(ans, num)
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
MOD = 10 **9 + 7
 
ni = [0 for _ in range(60)]
for i in range(N):
    tmp = A[i]
    count = 0
    while(True):
        if tmp % 2 == 1:
            ni[count] += 1
        count += 1
        tmp = tmp // 2
        if tmp == 0:
            break
ans = 0
for j in range(60):
    ans += (ni[j] * (N-ni[j])) * 2 ** j 
 
print(ans%MOD)

Submission status: Runtime Error

Solution code:
import sys
import math
import bisect
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


# A
def A():
    a, b, c = LI()
    if a + b + c >= 22:
        print("bust")
    else:
        print("win")
    return


# B
def B():
    s = S()
    ans = 0
    for i in range(len(s) // 2):
        if s[i] != s[-i - 1]:
            ans += 1
    print(ans)
    return


# C
def C():
    n = I()
    res = [[0] * n for i in range(n)]
    ans = 0
    for i in range(n):
        a = I()
        for j in range(a):
            x, y = LI()
            if y == 0:
                res[i][x - 1] = 1
    while (1):
        max_num = 0
        max_ind = -1
        for i in range(n):
            num = 0
            for j in range(n):
                if i == j:
                    num += sum(res[i])
                else:
                    if res[j][i] == 1:
                        num += 1
            if num > max_num:
                max_num = num
                max_ind = i
        if max_ind == -1:
            print(n - ans)
            return
        else:
            ans += 1
            res[max_ind] = [0] * n
            for i in range(n):
                res[i][max_ind] = 0
    return


# D
def D():
    return


# E
def E():
    h, w = LI()
    a = [LI() for i in range(h)]
    b = [LI() for i in range(h)]
    max_num = 80 ** 3 + 10
    dp = [[[0] * max_num for i in range(w)] for i in range(h)]
    dp[0][0][abs(a[0][0] - b[0][0])] = 1
    for i in range(1, h):
        for num in range(max_num):
            if dp[i - 1][0][num] == 1:
                dp[i][0][abs(num + abs(a[i][0] - b[i][0]))] = 1
                dp[i][0][abs(num - abs(a[i][0] - b[i][0]))] = 1
    for i in range(1, w):
        for num in range(max_num):
            if dp[0][i - 1][num] == 1:
                dp[0][i][abs(num + abs(a[0][i] - b[0][i]))] = 1
                dp[0][i][abs(num - abs(a[0][i] - b[0][i]))] = 1
    for i in range(1, h):
        for j in range(1, w):
            for num in range(max_num):
                if dp[i - 1][j][num] == 1:
                    dp[i][j][abs(num + abs(a[i][j] - b[i][j]))] = 1
                    dp[i][j][abs(num - abs(a[i][j] - b[i][j]))] = 1
                if dp[i][j - 1][num] == 1:
                    dp[i][j][abs(num + abs(a[i][j] - b[i][j]))] = 1
                    dp[i][j][abs(num - abs(a[i][j] - b[i][j]))] = 1
    for i in range(100):
        if dp[h - 1][w - 1][i] == 1:
            print(i)
            break
    return


# F
def F():
    return


# Solve
if __name__ == "__main__":
    E()

Submission status: Runtime Error

Solution code:
k=int(input())
l=[int(x) for x in input().rstrip().split()]
a=[]
 
for i in l:
    for j in l:
        if i<j:
            a.append([i,j])
 
A_1=0
A_2=0
SUM=0
ans=""
ANS=[]
for i in range(len(a)):
    A_1=format(a[i][0],'b')
    A_2=format(a[i][1],'b')
    if len(A_1)<len(A_2):
        A_1='0'*(len(A_2)-len(A_1))+A_1
    elif len(A_2)<len(A_1):
        A_2='0'*(len(A_1)-len(A_2))+A_2
 
 
    for j in range(len(A_1)):
        if A_1[j]==A_2[j]:
            ans=ans+'0'
        else:
            ans=ans+'1'
    ANS.append(ans)
    SUM+=int(ans,2)
    ans=''
SUM=SUM%(10**9+7)
print(SUM)

Submission status: Runtime Error

Solution code:
import numpy as np
mod = 10 ** 9 + 7

if __name__ == "__main__":
	N = int(input())
	L = list(map(int, input().split()))
	L = np.array(L)
	ans = 0
	for i in range(60 + 2):
		A = L % 2
		L = L // 2
		ans += np.sum(A) * (N - np.sum(A)) * (2 ** i) % mod
	print(ans % mod)

Submission status: Runtime Error

Solution code:

####
N = int(input())
A =  list(map(int,input().split()))

ans2 = 0
###
for y in range(N):
  for x in range(y+1,N):
    ans2 += (A[y] ^ A[x]) % 1000000007  
print(ans2%1000000007)
###

Submission status: Runtime Error

Solution code:
a1, a2, a3 = int(input()).split()
total = a1+ a2+ a3
if total >= 22:
  print("bust")
else:
  print("win")

Submission status: Runtime Error

Solution code:
a = input()
b = input()
c = input()
 
A = int(a)
B = int(b)
C = int(c)
  
if A+B+C > 21:
    print('bust')
else:
    print('win')

Submission status: Runtime Error

Solution code:
 python
a = input()
b = input()
c = input()
 
A = int(a)
B = int(b)
C = int(c)
  
if A+B+C > 21:
    print('bust')
else:
    print('win')

Submission status: Runtime Error

Solution code:
a = int(input())
b=[]
b=list(map(int,input().split()))
sum1=0
num = []
for i in range(a-1):
  for j in range(i+1,a):
    num.append(b[i]^b[j])
sum1=sum(num)
 
if sum1>=1000000007:
  sum1=sum1%1000000007
print(sum1)

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
h,w=map(int,input().split())
a=[]
for i in range(h):
    a.append(list(map(int,input().split())))
b=[]
for i in range(h):
    b.append(list(map(int,input().split())))
dp=[[set([]) for i in range(w)] for j in range(h)]
dp[0][0].add(a[0][0]-b[0][0])
dp[0][0].add(b[0][0]-a[0][0])
for i in range(h):
    for j in range(w):
        if i==j==0:
            continue
        if i==0:
            for k in dp[i][j-1]:
                dp[i][j].add(abs(k+a[i][j]-b[i][j]))
                dp[i][j].add(abs(k+b[i][j]-a[i][j]))
        elif j==0:
            for k in dp[i-1][j]:
                dp[i][j].add(abs(k+a[i][j]-b[i][j]))
                dp[i][j].add(abs(k+b[i][j]-a[i][j]))
        else:
            for k in (dp[i][j-1]|dp[i-1][j]):
                if k<=100:
                    dp[i][j].add(abs(k+a[i][j]-b[i][j]))
                    dp[i][j].add(abs(k+b[i][j]-a[i][j]))             
#dp[h-1][w-1]
ans=10**10
for i in dp[h-1][w-1]:
    ans=min(ans,abs(i))
print(ans)

Submission status: Runtime Error

Solution code:
a1, a2, a3 = input().split()
total = a1+ a2+ a3
if total >= 22:
  print("bust")
else:
  print("win")

Submission status: Runtime Error

Solution code:
a = input()
b = input()
c = input()
 
A = int(a)
B = int(b)
C = int(c)
  
if A+B+C > 21:
	print(`bust`)
else:
	print(`win`)

Submission status: Runtime Error

Solution code:
a1 = int(input())
a2 = int(input())
a3 = int(input())

total = a1+ a2+ a3
if total >= 22:
  print("bust")
else:
  print("win")

Submission status: Runtime Error

Solution code:
a1,a2,a3=map(intinput().split())
if a1+a2+a3>=22:
  print("bust")
else:
  print("win")

Submission status: Runtime Error

Solution code:
a=input()
b=input()
c=input()
 
A=int(a)
B=int(b)
C=int(c)
D=A+B+C

if D>21:
	print('bust')
else:
	print('win')

Submission status: Runtime Error

Solution code:
a1 = int(input())
a2 = int(input())
a3 = int(input())
total = a1+ a2+ a3
if total >= 22:
  print("bust")
else:
  print("win")

Submission status: Runtime Error

Solution code:

def blackjack(a, b, c):
    if (a+b+c) >= 22:
        return "bust"
    else:
        return "win"

A1 = int(input('Input A1:'))
A2 = int(input('Input A2:'))
A3 = int(input('Input A3:'))
print(blackjack(A1, A2, A3))

Submission status: Runtime Error

Solution code:
a1,a2,a3=map(int(input().split()))
if a1+a2+a3>=22:
  print("bust")
else:
  print("win")

Submission status: Runtime Error

Solution code:
a = input()
b = input()
c = input()
 
A = int(a)
B = int(b)
C = int(c)
  
if A+B+C > 21:
	print('bust')
else:
	print('win')

Submission status: Runtime Error

Solution code:
def blackjack(A1, A2, A3):
    if (A1+A2+A3) >= 22:
        return "bust"
    else:
        return "win"

A1 = int(input('Input A1:'))
A2 = int(input('Input A2:'))
A3 = int(input('Input A3:'))
print(blackjack(A1, A2, A3))

Submission status: Runtime Error

Solution code:
import itertools
def main():
    S = int(input())
    a = [int(i) for i in input().split()]
    x = 10**9
    
    xor = 0
    patern = list(itertools.combinations(a, 2))
    for p in patern:
        xor += p[0] ^ p[1]
    if xor >= x:
        print(xor % (x + 7))
    else:
        print(xor)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input())
if a+b+c<=21:
  print('win')
else:
  print('bust')

Submission status: Runtime Error

Solution code:
a = input()
b = input()
c = input()
 
A = int(a)
B = int(b)
C = int(c)
  
if A+B+C >= 22:
	print('bust')
else:
	print('win')

Submission status: Runtime Error

Solution code:
a = input()
b = input()
c = input()
 
A = int(a)
B = int(b)
C = int(c)
  
if A+B+C >= 22:
	print "bust"
else:
	print "win"

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
h,w=map(int,input().split())
a=[]
for i in range(h):
    a.append(list(map(int,input().split())))
b=[]
for i in range(h):
    b.append(list(map(int,input().split())))
dp=[[set([]) for i in range(w)] for j in range(h)]
dp[0][0].add(a[0][0]-b[0][0])
dp[0][0].add(b[0][0]-a[0][0])
for i in range(h):
    for j in range(w):
        if i==j==0:
            continue
        if i==0:
            for k in dp[i][j-1]:
                dp[i][j].add(k+a[i][j]-b[i][j])
                dp[i][j].add(k+b[i][j]-a[i][j])
        elif j==0:
            for k in dp[i-1][j]:
                dp[i][j].add(k+a[i][j]-b[i][j])
                dp[i][j].add(k+b[i][j]-a[i][j])
        else:
            for k in (dp[i][j-1]|dp[i-1][j]):
                dp[i][j].add(k+a[i][j]-b[i][j])
                dp[i][j].add(k+b[i][j]-a[i][j])             
#dp[h-1][w-1]
ans=10**10
for i in dp[h-1][w-1]:
    ans=min(ans,abs(i))
print(ans)

Submission status: Runtime Error

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

if A+B+C >= 22:
	print "bust"
else:
	print "win"

Submission status: Runtime Error

Solution code:
def resolve():
    li = input().split()

    if li[0]+li[1] < 8:
        print("win")
    else if [0]+li[1];li[2] <= 22:
        print("win")
    else:
        print("bust")

Submission status: Runtime Error

Solution code:
a,b,c=0,0,0
while((a or b or c)<1 or 13<(a or b or c)):
    print("Please input a integral number from 1 to 13")
    a=int(input("Please input a integral number A1:"))
    b=int(input("Please input a integral number A2:"))
    c=int(input("Please input a integral number A3:"))
ans=a+b+c
if(ans<=21):
    print("win")
else:
    print("bust")

Submission status: Runtime Error

Solution code:
a, b, c = input().split()

if a + b + c >= 22:
  print('bust')
else:
  print('win')

Submission status: Runtime Error

Solution code:
import numpy as np

N = int(input())
Nloop = N + 1
A = np.zeros((Nloop, Nloop), dtype="int")
Acount = np.zeros(Nloop, dtype="int")

for i in range(1, Nloop):
    Acount[i] = int(input())
    for _ in range(Acount[i]):
        x, y = map(int, input().split())
        A[i, x] = 1 if y == 1 else -1

honest_loop = 2 ** N
honest_num = np.zeros(Nloop, dtype="int")

ans = 0

for i in range(1, honest_loop):
    for l in range(1, Nloop):
        honest_num[l] = 1 if i >> (l - 1) & 1 == 1 else -1

    check = np.dot(A, honest_num)

    honest_check = True
    for l in range(1, Nloop):
        # lの人が正直者のとき
        if honest_num[l] == 1 and Acount[l] != check[l]:
            honest_check = False

    if honest_check:
        ans = max(sum(honest_num == 1), ans)

print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
n = int(input())
arr = np.full((n,n),9)
for i in range(n):
  nn = int(input())
  for j in range(nn):
    a,b = map(int,input().split())
    arr[i][a-1] = b

arr2 = arr.T
cnt = 0
for i in range(n):
  for j in range(n):
    if arr[i][j]==0 and arr2[i][j]==0:
      cnt += 1
    elif arr[i][j]==1 and arr2[i][j]==1:
      cnt+=1

print(cnt)

Submission status: Runtime Error

Solution code:
a1, a2, a3 = map(int, input().split())
return 'bust' if a1+a2+a3 >= 22 else 'win'

Submission status: Runtime Error

Solution code:
inputs = []
for x in range 3:
    inputs.append(input("Input: "))
indices = [0,2]
if(a[indices].sum() >= 22):
    print("bust")
    else print("win")

Submission status: Runtime Error

Solution code:
a1 = int(input())
a2 = int(input())
a3 = int(input())
if a1+ a2+ a3 >= 22:
  print("bust")
print("win")

Submission status: Runtime Error

Solution code:
def main():
    num = input()
    num_list = list(map(int, input().split(" ")))
    # result = sum([sum([num_list[i]^num_list[j] for j in range(i)]) for i in range(int(num))])
    result = 0
    for i in range(int(num)):
        for j in range(i):
            result += num_list[i]^num_list[j]
    print(result%(10**9+7))    

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
from itertools import combinations
n = int(input())
arr = list(map(int, input().split()))
ans = 0
arr = list(combinations(arr, 2))
for i, j in arr:
    ans += i ^ j
print(ans % (10 ** 9 + 7))

Submission status: Runtime Error

Solution code:
a1 = input()
a2 = input()
a3 = input()
total = a1+ a2+ a3
if total >= 22:
  print("bust")
print("win")

Submission status: Runtime Error

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

num = 0

for i in range(N-1):
    for j in range(i+1,N):
        b3 = A[i]^A[j]
        num += b3

print(num%(10**9+7))

Submission status: Runtime Error

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

MOD = 10**9+7

sum_num = 0
for i in range(60):
    o = 0
    for a in A:
        o += (a>>i)%2
    z = N - o
    sum_num = (sum_num + (o*z)*(1<<i)) % MOD

print(sum_num)

Submission status: Runtime Error

Solution code:
from itertools import combinations
n = int(input())
ans = 0
for i, j in list(combinations(list(map(int, input().split())), 2)):
    ans += i ^ j
print(ans % (10 ** 9 + 7))

Submission status: Runtime Error

Solution code:
a = input()
b = input()
c = input()

x = int(a)+int(b)+int(c)

print(x)

if int(x) <= 21:
    print('win')

else:
    print('bust')

Submission status: Runtime Error

Solution code:
A1 = int(input())
A2 = int(input())
A3 = int(input())
if(A1+A2+A3==22):
	print("bust")
else:
  print("win")

Submission status: Runtime Error

Solution code:
arr = []
n = 3
for i in range(0,n):
    arr.append(int(input('Enter the three number:')))
ans = sum(arr)
print(ans)
if ans >= 22:
    print('bust')
else:
    print('win')

Submission status: Runtime Error

Solution code:
a1 = int(input())
a2 = int(input())
a3 = int(input())
total = a1+ a2+ a3
if total >= 22:
  print("bust")
print("win")

Submission status: Runtime Error

Solution code:
def main():
    num = input()
    num_list = list(map(int, input().split(" ")))
    result = sum([sum([num_list[i]^num_list[j] for j in range(i)]) for i in range(int(num))])
    print(result%(10**9+7))    

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
(A1+A2+A3==22)?print("bust"):print("win")

Submission status: Runtime Error

Solution code:
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
  	int a1, a2, a3;
    Scanner scanner = new Scanner(System.in);
    a1 = scanner.nextInt();
    a2 = scanner.nextInt();
    a3 = scanner.nextInt();
    
    int sum = a1 + a2 + a3;
    
    if (sum >= 22) {
    	System.out.println("bust");
    } else {
    	System.out.println("win");
    }
  }
}

Submission status: Runtime Error

Solution code:
import itertools
N = int(input())
A = list(map(int, input().split()))
ans = 0

for v in itertools.combinations(A, 2):
    ans += v[0] ^ v[1]
    
print(ans % (10**9 + 7))

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = a + b + c
if (d >= 22):
    print('bust')
else:
    print('win')

Submission status: Runtime Error

Solution code:
ans = A1+A2+A3

if ans >= 22:
     print ("bust")

else:
     print ("win")

Submission status: Runtime Error

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

jack = list[0] + list[1] + list[2]

if jack >= 22:
  print("bust")
else:
  print("win")

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())
A = list(map(int, input().split()))

s = 0
b = 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 + 7
m = []
for i in range(1 - 1, N - 1):
    for j in range(i + 1 - 1, N + 1 - 1):
        s += A[i] ^ A[j]
        while s >= b:
            s -= b

print(s)

Submission status: Runtime Error

Solution code:
A1 = int(input())
A2 = int(input())
A3 = int(input())
total = A1+ A2+ A3
if total >= 22:
  print("bust")
else:
  print("win")

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = a + b + c

if (d >= 22):
    print('bust')
else:
    print('win')

Submission status: Runtime Error

Solution code:
A1=int(input())
A2= int(input())
A3= int(input())
if(A1+A2+A3>=22):
    print("bust")
else:
    print("win")

Submission status: Runtime Error

Solution code:
a1, a2, a3 = input(), input(), input()

if a1 + a2 + a3 >= 22:
    print('bust')
else:
    print('win')

Submission status: Runtime Error

Solution code:
def resolve():
    li = input().split()

    if li[0]+li[1]+li[2] => 22:
        print("bust")
    else:
        print("win")

Submission status: Runtime Error

Solution code:
a1 , a2 , a3 = map(int , input.split())
  
A = a1+a2+a3
 
if A >= 22:
  print("bust")
  
else:

Submission status: Runtime Error

Solution code:
a1, a2, a3 = int(input()), int(input()), int(input())

if (a1 + a2 + a3) >= 22:
    print('bust')
else:
    print('win')

Submission status: Runtime Error

Solution code:
s = input()
arr = [int(i) for i in s.split('')]
result = 0
for j in range(arr):
  result += arr[j]
if(result>=22):
  print("bust")
else:
  print("win")

Submission status: Runtime Error

Solution code:
a,b,c = map(int(input().split()))
if a+b+c >= 22:
  print("bust")
else:
  print("win")

Submission status: Runtime Error

Solution code:
A1 = int(input())
A2 = int(input())
A3 = int(input())
if A1 + A2 + A3 >= 22:
    print("burst")
else:
    print("win")

Submission status: Runtime Error

Solution code:
a1, a2, a3 = int(input()), int(input()), int(input())

if (a1 + a2 + a3) >= 22:
    print('bust')
else:
    print('win')

Submission status: Runtime Error

Solution code:
i = input()

l = i.split()

if sum(l) >= 22:
    print('bust')
else:
    print('win')

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline

n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7

cnt = [0]*65

for e in a:
    for i in range(65):
        if (e>>i)&1 == 1:
            cnt[i] += 1

res = 0
p = 1

for e in cnt:
    res = (res+p*e*(n-e)%mod)%mod
    p = p*2%mod

print(res)

Submission status: Runtime Error

Solution code:
a,b,c= map(int, input())
if(a+b+c)>=22:
    print("bust")
else:
    print("win")

Submission status: Runtime Error

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

if li[0]+li[1]+li[2] => 22:
    print("bust")
else:
    print("win")