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

Fixed submission:
import itertools

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

if N==1:
    if A==B:
        print(1)
        exit()
    else:
        print(0)
        exit()

if A > B:
    print(0)
    exit()

min = A*(N-1)+B
max = A+B*(N-1)

print(max-min+1)

Buggy submission (verdict: Runtime Error):
import itertools

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

if N==1:
    if A==B:
        print(1)
        exit()
    else:
        print(0)
        exit()


comb = list(itertools.combinations_with_replacement(range(A,B+1),N-2))

lis=[]
for x in comb:
    lis.append(sum(x))

lis = set(lis)
print(len(lis))
Problem p02627 (python)

Fixed submission:
if __name__=="__main__":
    # Problem A
    x = input()
    if x == x.upper():
        print("A")
    else:
        print("a")

Buggy submission (verdict: Runtime Error):
if __name__=="__main__":
    # Problem A
    x = input()
    if x == x.upper()
        print("A")
    else:
        print("a")
Problem p02659 (python)

Fixed submission:
import fractions
import math

A, B = map(fractions.Fraction, input().split())

print(int(math.floor(A*B)))

Buggy submission (verdict: Runtime Error):
import math

A, B = map(float, input().split())
keta = int(math.log10(A))
A /= 10**keta

print(int(A*B*(10**keta)))
Problem p02682 (python)

Fixed submission:
a,b,c,k = map(int,input().split())

if a + b >= k:
  print(min(a,k))
else:
  print(a - (k - a - b))

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

s = [1] * a + [0] * b + [-1] * c
print(sum(s[:k]))
Problem p02754 (python)

Fixed submission:
n,a,b = map(int,input().split())
rest = n%(a+b)
n -= rest
ans = n//(a+b)*a
if rest >= a:
  ans += a
elif rest < a:
  ans += rest

print(ans)

Buggy submission (verdict: Runtime Error):
import math
n,a,b = map(int,input().split())
r = math.ceil(n/(a+b))
retukaioh = ""
for i in range(r):
  retukaioh = retukaioh + "b"*a + "r"*b
print(retukaioh[0:n].count("b"))

Buggy submission (verdict: Runtime Error):
import math
n,a,b = map(int,input().split())
r = math.ceil(n/(a+b))
retukaioh = ""
for i in range(r):
  retukaioh = retukaioh + "b"*a + "r"*b
print(retukaioh[0:n].count("b"))
print(retukaioh)
Problem p02689 (python)

Fixed submission:
N, M = map(int, input().split())
H = list(map(int, input().split()))
ma = [0]*(N+1)
cnt = 0
for _ in range(M):
    a, b = map(int, input().split())
    ma[a] = max(ma[a], H[b-1])
    ma[b] = max(H[a-1], ma[b])
for i in range(1, N+1):
    if H[i-1] > ma[i]:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
H = list(map(int, input().split()))
ma = [0]*(N+1)
cnt = 0
for _ in range(M):
    a, b = map(int, input().split())
    ma[a] = max(ma[a], H[b-1])
    ma[b] = max(H[a-1], ma[b])
for i in range(1, N+1):
    if H[i] > ma[i]:
        cnt += 1
print(cnt)
Problem p02757 (python)

Fixed submission:
n, p = map(int,input().split())
D = input()
out = 0


if 10 % p == 0:
    for i in range(n):
        if int(D[i]) % p == 0:
            out += i + 1
else:
    mod = 0
    count = [0] * p
    ten = 1
    count[mod] += 1
    for i in range(n):
        mod = (mod + int(D[n-i-1]) * ten) % p
        ten = ten * 10 % p
        count[mod] += 1
    for c in count:
        out += (c * (c - 1)) // 2
print(out)

Buggy submission (verdict: Runtime Error):
n, p = map(int,input().split())
D = input()
out = 0


if 10 % p == 0:
    for i in range(n):
        if int(D[i]) % p == 0:
            out += i + 1
else:
    mod = 0
    count = [0] * p
    ten = 1
    count[mod] += 1
    for i in range(n):
        mod = (mod + int(D[n-i-1]) * 10**i) % p
        ten = ten * 10 % p
        count[mod] += 1
        out += (c * (c - 1)) // 2
print(out)
Problem p03767 (python)

Fixed submission:
N = int(input())
a = sorted(map(int, input().split())) [::-1]
ans = 0
cnt = 0
for i in range(0, 3*N, 2):
  ans += a[i+1]
  cnt += 1
  if cnt == N:
    break
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = sorted(map(int, input().split())) [::-1]
ans = 0
for i in range(0, 3*N, 2):
  ans += a[i+1]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = sorted(map(int, input().split())) [::-1]
ans = 0
for i in range(0, 3N, 2):
  ans += a[i+1]
print(ans)
Problem p03775 (python)

Fixed submission:
import math
N = int(input())
ans = 10
for A in range(1, int(math.sqrt(N))+1):
  if N % A == 0:
    B = N//A
    F = max(len(str(A)), len(str(B)))
    if ans > F:
      ans = F 
print(ans)

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
ans = 10
for A in range(1, int(math.sqrt(N))):
  if N % A == 0:
    B = N//A
    F = max(len(str(A)), len(str(B)))
    ans = F if ans > F
print(ans)
Problem p03835 (python)

Fixed submission:
k, s = map(int, input().split())
count = 0
for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if 0 <= z and z <= k:
      count += 1
print(count)

Buggy submission (verdict: Runtime Error):
K, S = map(int, input().split())
count = 0
for X in range(K+1):
  for Y in range(K+1):
    Z = S - X - Y:
      if 0 <= Z and Z <= K:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
K, S = map(int, input().split())
count = 0
for X in range(K+1):
  for Y in range(K+1):
    for Z in range(K+1):
      if X + Y + Z = S:
        count += 1
print(count)
Problem p02659 (python)

Fixed submission:
a,b = map(str,input().split())
a = int(a)
b = int(float(b)*100+0.001)
print(a*b//100)

Buggy submission (verdict: Runtime Error):
a,b = map(float,input().split())

x =(a*b,abs_tool =0.001)
print(int(x))
Problem p02773 (python)

Fixed submission:
from collections import Counter
n = int(input())
S = []
for i in range(n):
  S.append(input())
S = sorted(S)
c = Counter(S)
X = c.most_common()
A = []
for i in range(len(X)):
  if X[0][1] == X[i][1]:
    A.append(X[i][0])
  else:
    break
A = sorted(A)
for i in range(len(A)):
  print(A[i])

Buggy submission (verdict: Runtime Error):
n = int(input())
S = []
for i in range(n):
  S.append(input())
T = list(set(S))
for i in range(len(T)):
  count.append(S.count(T[i]))
best = max(count)
ans = []
for i in range(len(T)):
  if count[i] == best:
    ans.append( T[i])
ans = sorted(ans)
for i in range(len(ans)):
  print(ans[i])
Problem p02831 (python)

Fixed submission:
def gcd(a, b):
    while b!=0:
        a,b = b, a%b
    return a

def lcm(a, b):
    return a*b//gcd(a,b)

a, b = map(int, input().split())
print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
a, b = map(int, input().split())
print(lcm(a, b))
Problem p02912 (python)

Fixed submission:
import heapq

def _heappush_max(heap, item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
    
def _heappop_max(heap):
    lastelt = heap.pop()    
    if heap:
        returnitem = heap[0]
        heap[0] = lastelt
        heapq._siftup_max(heap, 0)
        return returnitem
    return lastelt

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

heapq._heapify_max(p)

for i in range(M):
    a = _heappop_max(p)
    a //= 2
    _heappush_max(p, a)

print(sum(p))

Buggy submission (verdict: Runtime Error):
import heapq
def _heappush_max(heap, item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappop_max(heap):
    lastelt = heap.pop()    
    if heap:
        returnitem = heap[0]
        heap[0] = lastelt
        heapq._siftup_max(heap, 0)
        return returnitem
    return lastelt

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

heapq._heapify_max(price)

for i in range(M):
    a = heapq._heappop_max(price)
    a //= 2
    _heappush_max(price, a)

print(sum(price))
Problem p03315 (python)

Fixed submission:
s = input()
print(s.count("+")-s.count("-"))

Buggy submission (verdict: Runtime Error):
import numpy as np
n, k = map(int,input().split())
a = list(map(int,input().split()))
start = [i for i,x in enumerate(a) if x == min(a)]
m = 10000000
for i in start:
    if np.ceil(i/(k-1))+np.ceil(((n-1)-i)/(k-1)) < m:
        m = np.ceil(i/(k-1))+np.ceil(((n-1)-i)/(k-1))
print(m)

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
n, k = map(int,input().split())
a = list(map(int,input().split()))
start = [i for i,x in enumerate(a) if x == min(a)]
m = 10000000
for i in start:
    if math.ceil(i/(k-1))+math.ceil(((n-1)-i)/(k-1)) < m:
        m = math.ceil(i/(k-1))+math.ceil(((n-1)-i)/(k-1))
print(m)
Problem p02862 (python)

Fixed submission:
import math
from operator import mul
from functools import reduce

def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result
xy = list(map(int, input().split()))

if (2*xy[1]-xy[0]) % 3 == 0 and (2*xy[0]-xy[1]) % 3 == 0 and 2*xy[1]-xy[0] > -1 and 2*xy[0]-xy[1] > -1:
    a = (2*xy[1]-xy[0]) // 3
    b = (2*xy[0]-xy[1]) // 3
    print(cmb(a+b, a)%(10**9 + 7))
else:
    print(0)

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

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

xy = list(map(int, input().split()))

if (2*xy[1]-xy[0]) % 3 == 0 and (2*xy[0]-xy[1]) % 3 == 0:
    a = (2*xy[1]-xy[0]) // 3
    b = (2*xy[0]-xy[1]) // 3
    print(cmb(a+b, a))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
import math

xy = list(map(int, input().split()))

if (2*xy[1]-xy[0]) % 3 == 0 and (2*xy[0]-xy[1]) % 3 == 0:
    a = (2*xy[1]-xy[0]) // 3
    b = (2*xy[0]-xy[1]) // 3
    ans = int(math.factorial(a+b)/(math.factorial(a)*math.factorial(b)))
    print(int(ans/(10**9 + 7)))
else:
    print(0)
Problem p02915 (python)

Fixed submission:
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
from copy import deepcopy

# If you use recursive call, uncomment this code
#sys.setrecursionlimit(10**6)

def main():
    N = int(input())
    print(N**3)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
from copy import deepcopy

# If you use recursive call, uncomment this code
#sys.setrecursionlimit(10**6)

def main():
    N = int(input())
	print(N**3)

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

Fixed submission:
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
import math
from copy import deepcopy

# If you use recursive call, uncomment this code
sys.setrecursionlimit(10**6)

def comb(n,r):
    if n < r:
        return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def main():
    n,k = map(int, input().split())
    redn = n-k
    modn = 10**9+7
    for i in range(1,k+1):
        ans = comb(redn+1,i)*comb(k-1,i-1)%modn
        print(ans)
        

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
import math
from copy import deepcopy

# If you use recursive call, uncomment this code
#sys.setrecursionlimit(10**6)

def comb(n,r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def main():
    n,k = map(int, input().split())
    redn = n-k
    modn = 10**9+7
    for i in range(1,k+1):
        ans = comb(redn+1,i)*comb(k-1,i-1)%modn
        print(ans)
        

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
import math
from copy import deepcopy

# If you use recursive call, uncomment this code
#sys.setrecursionlimit(10**6)

def comb(n,r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def main():
    n,k = map(int, input().split())
    redn = n-k
    modn = 10**9+7
    for i in range(1,k+1):
        ans = comb(redn+1,i)%modn
        ans *= comb(k-1,i-1)%modn
        print(ans)
        

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

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

Buggy submission (verdict: Runtime Error):
N,M = map(int, input().split())
if N==1 and M==1:
  r = 0
if 0<=N and N>=1 and 2<=M:
  r = M*(M-1)//2
if 2<=N and 0<=M and M<=1:
  r = N*(N-1)//2
if 2<=N and 2<=M:
  r = (N*(N-1)+M*(M-1))//2

print(r)
Problem p03127 (python)

Fixed submission:
def main():
	N = int(input())
	A = list(map(int, input().split()))
	while(len(A) != 1):
		A.sort()
		mini = A[0]
		i = 1
		while(True):
			if A[i] % mini == 0:
				A.pop(i)
			else:
				A[i] = A[i] % mini
				i += 1
			if i == len(A):
				break
		A = list(set(A))
	print(A[0])

if __name__ == '__main__':
	main()

Buggy submission (verdict: Runtime Error):
def main():
	N = int(input())
	A = list(map(int, input().split()))
	while(len(A) != 1):
		A.sort()
		mini = A[0]
		for i in range(1, len(A)):
			if i >= len(A):
				continue
			if A[i] % mini == 0:
				A.pop(i)
			else:
				A[i] = A[i] % mini
		A = QUICKSORT(A)
		piv = A[0]
		for i in range(1, len(A)):
			if i >= len(A):
				continue
			if A[i] == piv:
				A.pop(i)
	print(A[0])

if __name__ == '__main__':
	main()

Buggy submission (verdict: Runtime Error):
def main():
	N = int(input())
	A = list(map(int, input().split()))
	while(len(A) != 1):
		A = QUICKSORT(A)
		mini = A[0]
		for i in range(1, len(A)):
			if i >= len(A):
				continue
			if A[i] % mini == 0:
				A.pop(i)
			else:
				A[i] = A[i] % mini
		A = list(set(A))
	print(A[0])

def QUICKSORT(A):
	if len(A) < 1:
		return A
	pivot = A[0]
	left = []
	right = []
	for x in range(1, len(A)):
		if A[x] <= pivot:
			left.append(A[x])
		else:
			right.append(A[x])
	left = QUICKSORT(left)
	right = QUICKSORT(right)
	foo = [pivot]
	return left + foo + right

if __name__ == '__main__':
	main()

Buggy submission (verdict: Runtime Error):
def main():
	N = int(input())
	A = list(map(int, input().split()))
	while(len(A) != 1):
		A = QUICKSORT(A)
		mini = A[0]
		for i in range(1, len(A)):
			if i >= len(A):
				continue
			if A[i] % mini == 0:
				A.pop(i)
			else:
				A[i] = A[i] % mini
		A = QUICKSORT(A)
		piv = A[0]
		for i in range(1, len(A)):
			if i >= len(A):
				continue
			if A[i] == piv:
				A.pop(i)
	print(A[0])

def QUICKSORT(A):
	if len(A) < 1:
		return A
	pivot = A[0]
	left = []
	right = []
	for x in range(1, len(A)):
		if A[x] <= pivot:
			left.append(A[x])
		else:
			right.append(A[x])
	left = QUICKSORT(left)
	right = QUICKSORT(right)
	foo = [pivot]
	return left + foo + right

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

Fixed submission:
S, W = map(int, input().split())

if S>W:
    print("safe")
else:
    print("unsafe")

Buggy submission (verdict: Runtime Error):
S = input()

count = 0

for i in range(len(S)):
    for j in range(i + 3,len(S)):
       
        x = int(S[i:j+1])
        

        if x % 2019 == 0:
            count += 1

print(count)
Problem p02729 (python)

Fixed submission:
import math

#入力
N, M = map(int, input().split())


#combination 関数
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

#main
if N <=1 and M <= 1:
  print(0)

elif N <= 1 and M>=2:
  print(combinations_count(M,2))

elif M <=1 and N>=2:
  print(combinations_count(N,2))
  
elif N >=2 and M >=2:
  print(combinations_count(N,2)+combinations_count(M,2))

Buggy submission (verdict: Runtime Error):
import decimal

L=int(input())

#decimal.getcontext().prec = 6
x = decimal.Decimal(L / 3)

V=decimal.Decimal(x*x*x)

print("{:.24f}".format(V))
Problem p02659 (python)

Fixed submission:
import math
 
a_0, b_0 = input().split()
a = int(a_0)

small = str(a*int(b_0[-2:]))


if len(small) >= 3:
  ans = a*int(b_0[0:-3]) +int(small[:-2])
else:
  ans = a*int(b_0[0:-3])
print(ans)

Buggy submission (verdict: Runtime Error):
import math
 
a_0, b_0 = input().split()
a = int(a_0)


small = str(a*int(b_0[-2:]))



ans = a*int(b_0[0:-3]) +int(small[:-2])
print(ans)
Problem p02693 (python)

Fixed submission:
k = int(input())
a = list(map(int, input().split()))

if a[1]//k != a[0]//k:
  print('OK')
elif a[0]%k == 0:
  print('OK')
else:
  print('NG')

Buggy submission (verdict: Runtime Error):
import math
 
a = list(map(int, input().split()))
A = a[0]
B = a[1]
N = a[2]
 
if N%B !=0:
  x_1 = (N//B)*B-1
  if x_1 == -1:
    x_1 = N
  x_2 = N
elif N == 1 or B ==1:
  x_1 =N
  x_2 =N

else:
  x_1 = N-1
  x_2 = N-1
ans_1 = math.floor(A*x_1/B)-A*math.floor(x_1/B)
ans_2 = math.floor(A*x_2/B)-A*math.floor(x_2/B)
if ans_1 >= ans_2:
  print(ans_1)
else:
  print(ans_2)
Problem p02777 (python)

Fixed submission:
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())
u =input()

if s == u:
  print(a-1, b)
else:
  prtin(a, b-1)
Problem p02829 (python)

Fixed submission:
a = int(input())
b = int(input())
print(6-a-b)

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
print(int(6-a-b))
Problem p02835 (python)

Fixed submission:
a = list(map(int, input().split()))
if sum(a) >= 22:
  print('bust')
else:
  print('win')

Buggy submission (verdict: Runtime Error):
a = list(map(int, input().split()))
if sum(a) >= 22:
  print('bust')
else:
  printt('win')
Problem p03775 (python)

Fixed submission:
n = int(input())

def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i ==0:
      divisors.append(i)
  return divisors

def digit(n):
  for i in range(15):
    if n>=10**i and n<10**(i+1):
      return i+1
      break

list = make_divisors(n)

ans = 2345

for i in list:
  if max(digit(i), digit(n/i)) < ans:
    ans = max(digit(i), digit(n/i))

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())

def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i ==0:
      divisors.append(i)
  return divisors

def digit(n):
  for i in range(10):
    if n>=10**i and n<10**(i+1):
      return i+1
      break

list = make_divisors(n)

ans = 12

for i in list:
  if max(digit(i), digit(n/i)) < ans:
    ans = max(digit(i), digit(n/i))

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())

def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i ==0:
      divisors.append(i)
      if i != n//i:
        divisors.append(n//i)
  return divisors

def digit(n):
  for i in range(10):
    if n>=10**i and n<10**(i+1):
      return i+1
      break

list = make_divisors(n)

ans = 12

for i in list:
  if max(digit(i), digit(n/i)) < ans:
    ans = max(digit(i), digit(n/i))

print(ans)
Problem p02726 (python)

Fixed submission:
n,x,y=[int(i) for i in input().split()]
l=[0 for i in range(n-1)]
for i in range(1,n):
    for j in range(i+1,n+1):
        #print(i,j)
        index=min(abs(y-j)+abs(x-i)+1,j-i)-1
        #print(index+1)
        l[index]=l[index]+1
for i in range(len(l)):
    print(l[i])

Buggy submission (verdict: Runtime Error):
l=[0] * (n-1)
for i in range(1,n):
    for j in range(i+1,n+1):
        #print(i,j)
        index=min(abs(y-j)+abs(x-i)+1,j-i)-1
        #print(index+1)
        l[index]=l[index]+1
for i in range(len(l)):
    print(l[i])
Problem p02835 (python)

Fixed submission:
list = input().split()
 
jack = int(list[0]) + int(list[1]) + int(list[2])
 
if jack >= 22:
  print("bust")
else:
  print("win")

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

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

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

Fixed submission:
N = input()

if N[0] == "7":
  print("Yes")
elif N[1] == "7":
  print("Yes")
elif N[2] == "7":
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = input()

if N[0] == 7:
  print("Yes")
else if N[1] == 7:
  print("Yes")
else if N[2] == 7:
  print("Yes")
else:
  print("No")
Problem p02659 (python)

Fixed submission:
A,B=input().split()
A = int(A)
B = B.replace('.','')
B = int(B)
ans = int(A*B//100)
print(ans)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
print((A*B*100)//100)
Problem p02699 (python)

Fixed submission:
s , w =map(int , input() . split())
if s <= w:
    print("unsafe")
else:
    print("safe")

Buggy submission (verdict: Runtime Error):
s = input()
w = input()
if s <= w:
    print("unsafe")
else:
    print("safe")
Problem p02860 (python)

Fixed submission:
# ABC145b


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)

    # map(int,input().split())
    n = int(input())
    s = input()[:-1]
    print('Yes' if s[:n//2] == s[n//2:] else 'No')


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
if n%2==1:
  print(No)
  exit(0)
if s[:n//2]==s[n//2:]:
  print('Yes')
  exit(0)
print('No')

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
if n%2==1:
  print(No)
  exit(0)
if s[:i//2]==s[i//2:]:
  print('Yes')
  exit(0)
print('No')
Problem p03013 (python)

Fixed submission:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n, m = map(int, input().split())
a = []
for _ in range(m):
    a.append(int(input()))
a=set(a)

memo = [0]*(n+1)
memo[0]=1
if not(1 in a):
    memo[1]=1

for i in range(2,n+1):
    #print(i)
    if i in a:
        continue
    #print(memo[i-1],memo[i-2])
    memo[i]=memo[i-2]+memo[i-1]
            

#print(memo)
print(memo[n]% 1000000007)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

n, m = map(int, input().split())
a = []
for _ in range(m):
    a.append(int(input()))

memo = {}


def step(now):
    if now in a:
        return 0
    # print(now)
    if now == n:
        return 1
    if now > n:
        return 0
    if now in memo.keys():
        return memo[now]
    memo[now] = step(now+1)+step(now+2)
    return memo[now]


print(step(0) % 1000000007)
# print(memo)