Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02729 (python)

Fixed submission:
num = input("")
num = num.split(" ")
N = int(num[0])
M = int(num[1])
a = int(N*(N-1)/2) if N*(N-1) >= 0 else 0
b = int(M*(M-1)/2) if M*(M-1) >= 0 else 0
print(a + b)

Buggy submission (verdict: Runtime Error):
n,m = input("")
N = int(n)
M = int(m)
a = N*(N-1) if N*(N-1) >= 0 else 0
b = M*(M-1) if M*(M-1) >= 0 else 0
print(a + b)

Buggy submission (verdict: Runtime Error):
n = input("")
m = input("")
N = int(n)
M = int(m)
a = N*(N-1) if N*(N-1) >= 0 else 0
b = M*(M-1) if M*(M-1) >= 0 else 0
print(a + b)

Buggy submission (verdict: Runtime Error):
N = int(input(""))
M = int(input(""))
ans = 0
if N == 1 :
  if M != 1 :
    ans = M * (M - 1)
else :
  if M == 1 :
    ans = N * (N - 1)
  else :
    ans = M * (M - 1) + N * (N - 1)
print(ans)
Problem p02729 (python)

Fixed submission:
N, M = list(map(int, input().split()))

sum = 0

if N > 0:
    sum += N*(N-1)/2

if M > 0:
    sum += M*(M-1)/2

print(int(sum))

Buggy submission (verdict: Runtime Error):
N, M = input().split()


print(N*(N-1)/2 + M*(M-1)/2)
Problem p02753 (python)

Fixed submission:
S = input()

if S == 'AAA' or S == 'BBB':
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
n,a,b = map(int, input().split())
m = 0
ans = 0
c = 0

while m < n:
    if c == 0:
        if m + a <= n:
            ans = ans + a
        else:
            ans = ans + n - m
        c = 1
        m = m + a
    else:
        c = 0
        m = m + b
    
print(ans)
Problem p02759 (python)

Fixed submission:
N = int(input())

if N % 2 == 0:
  print(N // 2)
else:
  print(N // 2 + 1)

Buggy submission (verdict: Runtime Error):
import sys

sys.setrecursionlimit(10 ** 6)

def friends(friend, array, i, label, t):
    for j in range(len(friend[i])):
        if label[friend[i][j] - 1] == 0:
            label[friend[i][j] - 1] = label[i]
            array.append(friend[i][j] - 1)
            return friends(friend, array, friend[i][j] - 1, label, t + 1)
    
    if t != 1:
        array.pop(-1)
        return friends(friend, array, array[t - 1], label, t - 1)
    else:
        return label   
        
n, m, k = map(int, input().split())
a = [0] * m
b = [0] * m
c = [0] * k
d = [0] * k

label = [0] * n
kosu_label = 1

block = [0] * n

ans = [0] * n

for i in range(m):
    a[i], b[i] = map(int, input().split())
    
for i in range(k):
    c[i], d[i] = map(int, input().split())
    
friend = [[] for i in range(n)]
    
for i in range(m):
    friend[a[i] - 1].append(b[i])
    friend[b[i] - 1].append(a[i])

for i in range(n):
    if label[i] == 0:
        label[i] = kosu_label
        label = friends(friend, [-1, i], i, label, 1)
            
    kosu_label = kosu_label + 1

label_s = [0] * kosu_label

for i in range(n):
    label_s[label[i]] = label_s[label[i]] + 1
    
for w in range(k):
    if label[c[w] - 1] == label[d[w] - 1]:
        block[c[w] - 1] = block[c[w] - 1] + 1
        block[d[w] - 1] = block[d[w] - 1] + 1
            
for i in range(n):
    ans[i] = label_s[label[i]] - len(friend[i]) - block[i] - 1
    print(ans[i], end = ' ')

Buggy submission (verdict: Runtime Error):
def make_label(x, y, a, b, label, m):
    h = False
    g = []
    for i in range(m):
        if a[i] == x and label[b[i] - 1] == 0:
            label[b[i] - 1] = y
            g.append(b[i])
            h = True
        elif b[i] == x and label[a[i] - 1] == 0:
            label[a[i] - 1] = y
            h = True
            g.append(a[i])
        
    if h:
        for i in range(len(g)):
            return make_label(g[i], y, a, b, label, m)
    else:
        return label  
        


n, m, k = map(int, input().split())
a = [0] * m
b = [0] * m
c = [0] * k
d = [0] * k

label = [0] * n
kosu_label = 1

friend = [0] * n
block = [0] * n

ans = [0] * n

for i in range(m):
    a[i], b[i] = map(int, input().split())
    
for i in range(k):
    c[i], d[i] = map(int, input().split())
    
for i in range(n):
    if label[i] == 0:
        label[i] = kosu_label
        label = make_label(i + 1, kosu_label, a, b, label, m)
        kosu_label = kosu_label + 1

label_s = [0] * kosu_label

for i in range(n):
    label_s[label[i]] = label_s[label[i]] + 1
    
for i in range(n):
    for j in range(m):
        if a[j] == i + 1 or b[j] == i + 1:
            friend[i] = friend[i] + 1
    for w in range(k):
        if (c[w] == i + 1 or d[w] == i + 1) and label[c[w] - 1] == label[d[w] - 1]:
            block[i] = block[i] + 1
    ans[i] = label_s[label[i]] - friend[i] - block[i] - 1

for i in range(n):
    print(ans[i], end = '')
Problem p02753 (python)

Fixed submission:
S=input()
count=0
for i in range(2):
  if S[i]==S[i+1]:
    count+=1
if count==2:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
S=input()
if S == AAA or BBB:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
S=input()
if S = AAA or BBB:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
S=input()
count=0
for i in range(2):
  S[i]==S[i+1]
  count+=1
  bleak
if count==2:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
S=input()
count=0
for i in range(2):
  S[i]==S[i+1]
  count+=1
  bleak
if count==2:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
S=input()
count=0
for i in range(2):
  S[i]==S[i+1]
  count+=1
  bleak
if count==2:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
S=input()
count=0
for i in range(3):
  S[i]==S[i+1]
  count+=1
if count==2:
  print("No")
else:
  print("Yes")
Problem p02777 (python)

Fixed submission:
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U==S:
  print(str(A-1),str(B))
else:
  print(str(A),str(B-1))

Buggy submission (verdict: Runtime Error):
S,T=input().split()
A,B=map(int,input().split())
U=input()
if S==U:
  print(A-1 B)
else:
  print(A B-1)

Buggy submission (verdict: Runtime Error):
S,T=input().split()
A,B=map(int,input().split())
if S==U:
  print(A-1+" "+B)
Problem p02829 (python)

Fixed submission:
A=int(input())
B=int(input())
if A==1 and B==2:
  print(3)
elif A==2 and B==3:
  print(1)
elif A==3 and B==1:
  print(2)
elif A==1 and B==3:
  print(2)
elif A==2 and B==1:
  print(3)
elif A==3 and B==2:
  print(1)

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
list[1,2,3]
list.remove(A)
list.remove(B)
print(list[0])

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
list["1","2","3"]
list.remove(A)
list.remove(B)
print(list[0])

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
list["1","2","3"]
list.remove(A)
list.remove(B)
print(list(0))
Problem p02897 (python)

Fixed submission:
N=int(input())
x=(N+1)//2
print(x/N)

Buggy submission (verdict: Runtime Error):
N=int(input())
x=N//2
print(X/N)

Buggy submission (verdict: Runtime Error):
N=int(input())
x=a//2
print(X/a)
Problem p02970 (python)

Fixed submission:
N,D=list(map(int,input().split()))
if N%(1+2*D)==0:
  print(N//(1+2*D))
else:
  print(N//(1+2*D)+1)

Buggy submission (verdict: Runtime Error):
N,D=list(map(int,input().split()))
print(N//(1+2D))

Buggy submission (verdict: Runtime Error):
N,D=list(map(int,input().split()))
print(N//(1+2D))
Problem p02729 (python)

Fixed submission:
n,m=map(int,input().split())
print(n*(n-1)//2+m*(m-1)//2)

Buggy submission (verdict: Runtime Error):
n,m=map(int, input().split())
print(n*(n-1)//2+m(m-1)//2)
Problem p02729 (python)

Fixed submission:
li = input().split()
li[0] = int(li[0])  
li[1] = int(li[1])  
  
print( int(li[0]*(li[0]-1)/2 + li[1]*(li[1]-1)/2 ))

Buggy submission (verdict: Runtime Error):
list = input().split()
n = len(list)

mae = [list[m] for m < n/2 ]

ushiro = [list[m] for m > n/2 ]

ema = [mae[n/2 - p] for p < n/2 ]

oroshi = [ushiro[-n/2 + p] for p > n/2 ]

if mae = ema and ushiro = oroshi:
  print(Yes)
  
else:
  print(No)

Buggy submission (verdict: Runtime Error):
li = input().split()
 
print( li[0](li[0]-1)/2 + li[1](li[1]-1)/2 )

Buggy submission (verdict: Runtime Error):
li = input().split()

li[0](li[0]-1)/2 + li[1](li[1]-1)/2
Problem p02753 (python)

Fixed submission:
s = input()
vis_a = 0
vis_b = 0

for i in s:
  if i == 'A':
    vis_a = 1
  if i == 'B':
    vis_b = 1

if vis_a and vis_b:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = input()
vis_a = 0
vis_b = 0

for i in s:
  if i == 'A':
    vis_a = 1
  if i == 'B':
    vis_b = 1

if vis_a and vis_b:
  print("Yes")
else
  print("No")

Buggy submission (verdict: Runtime Error):
s = input()
vis_a = 0
vis_b = 0

for i in s:
  if s == 'A':
    vis_a = 1
  if s == 'B':
    vis_b = 1

if vis_a and vis_b:
  print("Yes")
else
  print("No")
Problem p02771 (python)

Fixed submission:
s = input().split()
a = int(s[0])
b = int(s[1])
c = int(s[2])

if a == b and b != c:
  print("Yes")
  exit()
if a == c and b != c:
  print("Yes")
  exit()
if c == b and a != c:
  print("Yes")
  exit()

print("No")

Buggy submission (verdict: Runtime Error):
s = input().split()
a = int(s[0])
b = int(s[1])
c = int(s[2])

if a == b && b != c:
  print("Yes")
  exit()
if a == c && b != c:
  print("Yes")
  exit()
if c == b && a != c:
  print("Yes")
  exit()

print("No")

Buggy submission (verdict: Runtime Error):
a, b, c = input().split()
a = int(a)
b = int(b)
c = int(c)

if a == b && b != c:
  print("Yes")
  exit()
if a == c && b != c:
  print("Yes")
  exit()
if c == b && a != c:
  print("Yes")
  exit()

print("No")
Problem p02729 (python)

Fixed submission:
n,m = map(int,input().split())
 
print(n*(n-1)//2+m*(m-1)//2)

Buggy submission (verdict: Runtime Error):
inp = str(input())
n, m = tuple(inp.split())
m_calculation = math.factorial(m)/2**(m/2)*math.factorial(m/2)
n_calculation = math.factorial(n)/2**(n/2)*math.factorial(n/2)
print(n_calculation + m_calculation)
Problem p02729 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
import math
 
N, M = map(int, input().split())
 
def comb(n, r):
    if n < r:
        return 0
    else:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
print(comb(N, 2)+comb(M, 2))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np
import math
 
N, M = map(int, input().split())
 
def comb(n, r):
    return int(math.factorial(n) / (math.factorial(n - r) * math.factorial(r)))
  
print(comb(N, 2)+comb(M, 2))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np
import math

N, M = map(int, input().split())

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
print(comb(N, 2)+comb(M, 2))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np
import math

N, M = map(int, input().split())

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
print(comb(N, M))
Problem p02729 (python)

Fixed submission:
from scipy.misc import comb
import numpy as np
A,B=map(int,input().split())
print(int(np.round(comb(A,2))+np.round(comb(B,2))))

Buggy submission (verdict: Runtime Error):
from scipy.misc import comb
A,B=map(int,input().split())
print(int(round(comb(A,2))+round(comb(B,2))))
Problem p02935 (python)

Fixed submission:
N=int(input())
v=list(map(int, input().split()))
v.sort()
for i in range(N-2):
  v1=v
  v=[(v1[0]+v1[1])/2]
  v.extend(v1[2:])
print(sum(v)/2)

Buggy submission (verdict: Runtime Error):
N=int(input())
v=list(map(int, input().split()))
v.sort()
for i in range(N-2):
  v1=v
  v=[(v1[0]+v1[1])/2]
  v.extend(v[2:])
print(sum(v)/2)

Buggy submission (verdict: Runtime Error):
N=int(input())
v=list(map(int, input().split()))
v.sort()
for i in range(N-2):
  v1=[(v[0]+v[1])/2]
  v1.extend(v[2:])
  v=v1
print(sum(v1)/2)

Buggy submission (verdict: Runtime Error):
N=int(input())
v=list(map(int, input().split()))
v.sort()
for i in range(N-2):
  v1=[(v[0]+v[1])/2]
  v1.extend(v[2:])
  v=v1
print(sum(v1)/2)
Problem p02729 (python)

Fixed submission:
n, m = map(int, input().split())
print(int(n*(n-1)//2 + m*(m-1)//2))

Buggy submission (verdict: Runtime Error):
def comb(n, r):
    if r >= n:
        return 0
    else:        
        return math.factorial(n) // (math.factorial(r)*math.factorial(n - r))
  
n, m = map(int, input().split())
print(int(comb(n,2) + comb(m,2)))

Buggy submission (verdict: Runtime Error):
def comb(n, r):
    if r > n:
        return 0
    else:        
        return math.factorial(n)*math.factorial(r) // math.factorial(n - r)
  
m, n = map(int, input().split())
print(int(comb(m,2) + comb(n,2)))

Buggy submission (verdict: Runtime Error):
import math
def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)
  
m, n = map(int, input().split())
print(permutations_count(m,2)+permutations_count(n,2))
Problem p02729 (python)

Fixed submission:
m, n = list(map(int, input().split()))
print(int(m * (m - 1) / 2 + n * (n - 1) / 2))

Buggy submission (verdict: Runtime Error):
while True:
    m, n = list(map(int, input().split()))
    print(m * (m - 1) / 2 + n * (n - 1) / 2)
Problem p03127 (python)

Fixed submission:
from sys import stdin
input = stdin.readline
lmi = lambda: list(map(int, input().split()))
mi = lambda: map(int, input().split())
si = lambda: input().strip('\n')
ssi = lambda: input().strip('\n').split()


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)


n = int(input())
arr = lmi()
for i in range(1, n):
    arr[i] = gcd(arr[i], arr[i-1])
print(arr[n-1])

Buggy submission (verdict: Runtime Error):
from sys import stdin
from math import gcd
input = stdin.readline
lmi = lambda: list(map(int, input().split()))
mi = lambda: map(int, input().split())
si = lambda: input().strip('\n')
ssi = lambda: input().strip('\n').split()

n = int(input())
arr = lmi()
for i in range(1, n):
    arr[i] = gcd(arr[i], arr[i-1])
print(arr[n-1])

Buggy submission (verdict: Runtime Error):
from sys import stdin, exit
from math import factorial, gcd
input = stdin.readline
lmi = lambda: list(map(int, input().split()))
mi = lambda: map(int, input().split())
si = lambda: input().strip('\n')
ssi = lambda: input().strip('\n').split()

n = int(input())
arr = lmi()
for i in range(1, n):
    arr[i] = gcd(arr[i], arr[i-1])
print(arr[n-1])

Buggy submission (verdict: Runtime Error):
from sys import stdin, exit
from math import factorial, gcd
input = stdin.readline
lmi = lambda: list(map(int, input().split()))
mi = lambda: map(int, input().split())
si = lambda: input().strip('\n')
ssi = lambda: input().strip('\n').split()

n = int(input())
arr = lmi()
for i in range(1, n):
    arr[i] = gcd(arr[i], arr[i-1])
print(arr[-1])
Problem p02729 (python)

Fixed submission:
N, M = map(int, input().split())
print((N*(N-1))//2 + (M*(M-1))//2)

Buggy submission (verdict: Runtime Error):
M,N = map(int,input().split())
print((M*(M-1))//2 + ((N*(N-1))//2)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
print(((a*(a-1)) // 2 + ((b*(b-1))// 2)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
print((a*(a-1)) // 2 + ((b*(b-1))// 2 )

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
c = ((a*(a-1)) / 2 + ((b * (b-1)) / 2 )
print(int(c))
Problem p02759 (python)

Fixed submission:
N = int(input())
print((N+1)//2)

Buggy submission (verdict: Runtime Error):
N = input()
print((N+1)//2)

Buggy submission (verdict: Runtime Error):
N = input()
print(N+1//2)
Problem p02935 (python)

Fixed submission:
import numpy as np

N = int(input())
vn_list = input().split()

vn = np.sort(np.array(vn_list, dtype="float"))[::-1]
w = np.logspace(1, N, base=1/2, num = N)
w[N-1] = w[N-2]
result = np.dot(vn, w)
print(result)

Buggy submission (verdict: Runtime Error):
import numpy as np

N = int(input())
vn_list = input().split()

vn = np.array(vn_list, dtype="float")
w = np.geomspace(1/2, 1/(2**N), num=N)
w[N-1] = w[N-2]
result = np.dot(vn, w)
print(result)
Problem p02729 (python)

Fixed submission:
from scipy.misc import comb

a,b = map(int,input().split()) #a even b odd
x = 0

x = comb(a, 2, exact=True) + comb(b, 2, exact=True)
    

print(x)

Buggy submission (verdict: Runtime Error):
print(int(input())//3**3)

Buggy submission (verdict: Runtime Error):
from scipy.special import comb

a,b = map(int,input().split()) #a even b odd
x = 0

x = comb(a, 2, exact=True) + comb(b, 2, exact=True)
    

print(x)
Problem p02880 (python)

Fixed submission:
a = int(input())
found = False
for i in range(1, 10):
  for j in range(1, 10):
    if i*j == a:
      found = True
if found:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = int(input())
found = False
for i in range(1, 10):
  for j in range(1, 10):
    if i*j == a:
	  found = True
if found:
  print("Yes")
else:
  print("No")
Problem p02836 (python)

Fixed submission:
S = input()
if S.islower():
  S1 = S[:int(len(S)/2)]
  S2 = S[int(len(S)/2):]
  count = 0
  for i,x in enumerate(S1):
    if x != S2[(i+1)*-1]:
      count += 1
  print(count)

Buggy submission (verdict: Runtime Error):
S = input()
if S.islower():
	S1 = S[:int(len(S)/2)]
    S2 = S[int(len(S)/2):]
    count = 0
    for i,x in enumerate(S1):
        if x != S2[(i+1)*-1]:
            count += 1
    print(count)
Problem p02831 (python)

Fixed submission:
a, b = map(int, input().split())
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a
def lcm(a, b):
    return a * b // gcd(a, b)
print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
from math import gcd
a, b = map(int, input().split())
g = gcd(a, b)
print(a * b // g)
Problem p02729 (python)

Fixed submission:
a,b=list(map(int, input().split()))
print((a*(a-1))//2+(b*(b-1))//2)

Buggy submission (verdict: Runtime Error):
a,b=int(input().split())
print((a*(a-1))//2+(b*(b-1))//2)
Problem p02729 (python)

Fixed submission:
inp = input().split(' ')

n = int(inp[0])
m = int(inp[1])

ncount = 0 if n < 2 else n*(n-1)//2
mcount = 0 if m < 2 else m*(m-1)//2

print(str(ncount + mcount))

Buggy submission (verdict: Runtime Error):
n,m = input().split(' ')

ncount = 0 if n < 2 else n*(n-1)/2
mcount = 0 if m < 2 else m*(m-1)/2

print(str(ncount + mcount))
Problem p02990 (python)

Fixed submission:
from math import factorial


def main():
    MOD = 1000000007
    inp = input().split()
    n = int(inp[0])
    k = int(inp[1])
    r = n - k
    for i in range(1, k + 1):
        if r + 1 < i:
            print(0)
            continue
        elif r + 1 == i:
            rr = 1
        else:
            rr = cmb(r + 1, i)

        if i == 1:
            bb = 1
        elif i == k:
            bb = 1
        else:
            bb = cmb(k - 1, i - 1)
        print(((rr % MOD) * (bb % MOD)) % MOD)


def cmb(n, r):
    return factorial(n) // (factorial(r) * factorial(n - r))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
from math import factorial


def main():
    MOD = 1000000007
    inp = input().split()
    n = int(inp[0])
    k = int(inp[1])
    r = n - k
    for i in range(1, k + 1):
        if r + 1 < i:
            return
        else:
            rr = cmb(r + 1, i)

        if i == 1:
            bb = 1
        elif i == k:
            bb = 1
        else:
            bb = cmb(k - 1, i - 1)
        print((rr % MOD) * (bb % MOD) % MOD)


def cmb(n, r):
    return factorial(n) / (factorial(r) * factorial(n - r))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import itertools
from operator import mul
from functools import reduce


def main():
    MOD = 1000000007
    inp = input().split()
    n = int(inp[0])
    k = int(inp[1])
    r = n - k
    for i in range(1, k + 1):
        rr = cmb(r + 1, i)
        if i == 1:
            bb = 1
        elif i == k:
            bb = 1
        else:
            bb = cmb(k - 1, i - 1)
        print((rr % MOD) * (bb % MOD) % MOD)


def cmb(n, r):
    r = min(n-r, r)
    if r == 0:
        return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under


if __name__ == '__main__':
    main()
Problem p02759 (python)

Fixed submission:
n = int(input())
if n % 2 == 0:
    print(n//2)
else:
    print(n//2+1)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n % 2 == 0:
    print(n//2)
else:
    print(n//2)+1
Problem p02754 (python)

Fixed submission:
N, A, B = map(int, input().split())
ans = N // (A + B) * A
rem = N % (A + B)
ans += min(rem, A)
print(ans)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
2 ans = N // (A + B) * A
3 rem = N % (A + B)
4 ans += min(rem, A)
5 print(ans)
Problem p02835 (python)

Fixed submission:
A,B,C=map(int,input().split())
if A+B+C>=22:
  print("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
A.B.C=map(int,input().split())
if A+B+C>=22:
  print("bust")
else:
  print("win")
Problem p02897 (python)

Fixed submission:
import math

N = float(raw_input())
print math.ceil(N/2)/N

Buggy submission (verdict: Runtime Error):
import math
N = int(raw_input())
(float)avg = ((float)math.ceil(N/2)/N
print avg
Problem p02912 (python)

Fixed submission:
import heapq

N,M = map(int, raw_input().split())
A = list(map(lambda x: int(x)*(-1), raw_input().split()))

heapq.heapify(A)

for i in range(0,M):
  max_A = heapq.heappop(A)*(-1) / 2*(-1)
  heapq.heappush(A,max_A)

print sum(A)*(-1)

Buggy submission (verdict: Runtime Error):
N,M = map(int, raw_input().split())
A = list(map(int,raw_input().split()))	
ans = 0
for i in range(0,M):
  max_A_index = A.index(max(A))
  A[max_A_index] = max_A/2
print sum(A)
Problem p03104 (python)

Fixed submission:
A,B = map(long,raw_input().split())

sum = B-A+1

if sum % 2 == 0:
  if A % 2 == 0:
    if sum/2%2 == 0:
      print "0"
    else:
      print "1"
  else:
    if sum/2%2 == 1:
      print A^B^0
    else:
      print A^B^1
else:
  if A % 2 == 0:
    if sum/2%2 == 0:
      print 0^B
    else:
      print 1^B
  else:
    if sum/2%2 == 1:
      print 1^A
    else:
      print 0^A

Buggy submission (verdict: Runtime Error):
A,B = map(int,raw_input().split())
ans = long(A)
for i in range(A+1,B+1):
  ans = ans^i
print ans

Buggy submission (verdict: Runtime Error):
A,B = map(int,raw_input().split())
float(ans) = A
for i in range(A+1,B+1):
  ans = ans^i
print ans

Buggy submission (verdict: Runtime Error):
A,B = map(int,raw_input().split())
ans = A
for i in range(A+1,B+1):
  ans = ans^i
print ans
Problem p03775 (python)

Fixed submission:
N = long(raw_input())
def dig(A,B):
        if A > B:
                return A
        else:
                return B
A = 0
B = 0 
X = []
i = long(1)
while N >= A*A:
        A = long(i)
        if N%i == 0:
                B = long(N/i)
                X.append(dig(A,B))
        if A in X:
                break
        i+=1
print len(str(min(X)))

Buggy submission (verdict: Runtime Error):
N = long(raw_input())
def dig(A,B):
        if A > B:
                return A
        else:
                return B
A = 0
B = 0 
X = []
i = long(1)
while N > i:
        if N%i == 0:
                A = long(i)
                B = long(N/i)
                X.append(dig(A,B))
        if A in X:
                break
        i+=1
print len(str(min(X)))

Buggy submission (verdict: Runtime Error):
N = long(raw_input())
def dig(A,B):
        if A > B:
                return A
        else:
                return B
A = 0
B = 0 
X = []
i = long(1)
print N
while N > i:
        if N%i == 0:
                A = long(i)
                B = long(N/i)
                X.append(dig(A,B))
        if A in X:
                break
        i+=1
print len(str(min(X)))

Buggy submission (verdict: Runtime Error):
N = int(raw_input())
a = []
t = []
for i in range(1,N+1):
        for j in range(1,N+1):
                if i*j == N:
                        a.append(i)
                        a.append(j)
                        a.sort() 
                        if a in t:
                                break       
                        else:
                                t.append(a)
                        a = []
        else:
                continue
        break
ans = []
for i in range(0,len(t)):
        x = t[i][0]
        y = t[i][1]
        if x > y:
                ans.append(len(str(x)))
        else:
                ans.append(len(str(y)))
        
print min(ans)