Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from operator import mul
from functools import reduce

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

n, k = map(int, input().split())
mod = pow(10, 9) + 7

for i in range(k):
    b = cmb(k-1, i)
    r = cmb(n-k+1, i+1)
    print(int((b*r)%(mod)))


Fixed submission:
from operator import mul
from functools import reduce

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

n, k = map(int, input().split())
mod = pow(10, 9) + 7

for i in range(k):
    if i > n-k:
        print(0)
    else:
        b = cmb(k-1, i)
        r = cmb(n-k+1, i+1)
        print(int((b*r)%mod))

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

n, k = map(int, input().split())
mod = pow(10, 9)+7

for i in range(k):
    b = comb(k-1, i)
    r = comb(n-k+1, i+1)
    # print(n-k+1, i+1)
    print(int((b*r)%(mod)))


Fixed submission:
from operator import mul
from functools import reduce

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

n, k = map(int, input().split())
mod = pow(10, 9) + 7

for i in range(k):
    if i > n-k:
        print(0)
    else:
        b = cmb(k-1, i)
        r = cmb(n-k+1, i+1)
        print(int((b*r)%mod))
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict
n, m = map(int, input().split())
switch = defaultdict(list)
for i in range(m):
    s = list(map(int, input().split()))[1:]
    switch[i] = s
p = list(map(int, input().split()))

output = 0
for h in range(2**n):
    flag = 1
    padding = f'0{n}b'
    bit = format(h, padding)
    for i, v in enumerate(p):
        cnt = 0
        for j in switch[i]:
            if bit[j-1] == '1':
                cnt += 1
        if cnt % 2 != v:
            flag = 0
    if flag == 1:
        output += 1
print(output)


Fixed submission:
from collections import defaultdict
n, m = map(int, input().split())
switch = defaultdict(list)
for i in range(m):
    s = list(map(int, input().split()))[1:]
    switch[i] = s
p = list(map(int, input().split()))

output = 0
for h in range(2**n):
    flag = 1
    padding = '0{}b'.format(n)
    bit = format(h, padding)
    for i, v in enumerate(p):
        cnt = 0
        for j in switch[i]:
            if bit[j-1] == '1':
                cnt += 1
        if cnt % 2 != v:
            flag = 0
    if flag == 1:
        output += 1
print(output)

Buggy python submission (verdict: Runtime Error):
from itertools import combinations
from collections import defaultdict
n, m = map(int, input().split())
switch = defaultdict(list)
for i in range(m):
    s = list(map(int, input().split()))[1:]
    switch[i] = s
p = list(map(int, input().split()))

output = 0
for h in range(2**n):
    flag = 1
    padding = f'0{n}b'
    bit = format(h, padding)
    for i, v in enumerate(p):
        cnt = 0
        for j in switch[i]:
            if bit[j-1] == '1':
                cnt += 1
        if cnt % 2 != v:
            flag = 0
    if flag == 1:
        output += 1
print(output)


Fixed submission:
from collections import defaultdict
n, m = map(int, input().split())
switch = defaultdict(list)
for i in range(m):
    s = list(map(int, input().split()))[1:]
    switch[i] = s
p = list(map(int, input().split()))

output = 0
for h in range(2**n):
    flag = 1
    padding = '0{}b'.format(n)
    bit = format(h, padding)
    for i, v in enumerate(p):
        cnt = 0
        for j in switch[i]:
            if bit[j-1] == '1':
                cnt += 1
        if cnt % 2 != v:
            flag = 0
    if flag == 1:
        output += 1
print(output)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
n, m = map(int, input().split())
card = defaultdict(int)
for i in range(m):
    l, r = map(int, input().split())
    for j in range(l, r+1):
        card[j] += 1
cnt = 0
for i, v in card.items():
    if v == m:
        cnt += 1
print(cnt)


Fixed submission:
from collections import defaultdict
n, m = map(int, input().split())
left = []
right = []
for i in range(m):
    l, r = map(int, input().split())
    left.append(l)
    right.append(r)

if min(right) >= max(left):
    print(min(right) - max(left) + 1)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict
n, m = map(int, input().split())
a = list(map(int, input().split()))
add = defaultdict(int)
for i in range(m):
    b, c = map(int, input().split())
    add[c] += b
add = sorted(add)
for i, v in add.items():
    a += [i]*v
    a.sort(reverse=True)
    if a[n] >= i:
        break
print(sum(a[:n]))


Fixed submission:
from collections import defaultdict
n, m = map(int, input().split())
a = list(map(int, input().split()))
add = defaultdict(int)
for i in a:
    add[i] += 1
for i in range(m):
    b, c = map(int, input().split())
    add[c] += b

output = 0
cnt = 0
print()
for i, v in sorted(add.items(), reverse=True):
    if cnt+v >= n:
        output += i*(n-cnt)
        break
    else:
        output += i*v
        cnt += v
print(output)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
a = list(map(int, input().split()))
for i in range(m):
    b, c = map(int, input().split())
    a += [c]*b
a.sort(reverse=True)
print(sum(a[:n]))


Fixed submission:
from collections import defaultdict
n, m = map(int, input().split())
a = list(map(int, input().split()))
add = defaultdict(int)
for i in a:
    add[i] += 1
for i in range(m):
    b, c = map(int, input().split())
    add[c] += b

output = 0
cnt = 0
print()
for i, v in sorted(add.items(), reverse=True):
    if cnt+v >= n:
        output += i*(n-cnt)
        break
    else:
        output += i*v
        cnt += v
print(output)
Buggy python submission (verdict: Runtime Error):
s = input()
k = int(input())

def ones(s):
    ss = s[0]
    idx = 0
    while ss=="1":
        idx += 1
        ss = s[idx]
    return idx

if s[0]!="1":
    print(s[0])
else:
    idx = ones(s)
    if idx>=k:
        print("1")
    # else:
        # print(s[idx])


Fixed submission:
s = input()
k = int(input())

def ones(s):
    ss = s[0]
    idx = 0
    while ss=="1" and idx+1 < len(s):
        idx += 1
        ss = s[idx]
    return idx

if s[0]!="1":
    print(s[0])
else:
    idx = ones(s)
    if idx>=k:
        print("1")
    else:
        print(s[idx])

Buggy python submission (verdict: Runtime Error):
s = input()
k = int(input())

def ones(s):
    ss = s[0]
    idx = 0
    while ss=="1":
        idx += 1
        ss = s[idx]
    return idx

if s[0]!="1":
    print(s[0])
else:
    idx = ones(s)
    if idx>=k:
        print("1")
    else:
        print(s[idx])


Fixed submission:
s = input()
k = int(input())

def ones(s):
    ss = s[0]
    idx = 0
    while ss=="1" and idx+1 < len(s):
        idx += 1
        ss = s[idx]
    return idx

if s[0]!="1":
    print(s[0])
else:
    idx = ones(s)
    if idx>=k:
        print("1")
    else:
        print(s[idx])

Buggy python submission (verdict: Runtime Error):
s = input()
k = int(input())

def ones(s):
    ss = s[0]
    idx = 0
    while ss=="1":
        idx += 1
        ss = s[idx]
    return idx

if s[0]!="1":
    print(s[0])
else:
    idx = ones(s)
    if idx>k:
        print("1")
    else:
        print(s[idx])


Fixed submission:
s = input()
k = int(input())

def ones(s):
    ss = s[0]
    idx = 0
    while ss=="1" and idx+1 < len(s):
        idx += 1
        ss = s[idx]
    return idx

if s[0]!="1":
    print(s[0])
else:
    idx = ones(s)
    if idx>=k:
        print("1")
    else:
        print(s[idx])
Buggy python submission (verdict: Runtime Error):
import numpy as np
n, m, q = map(int, input().split())
kukan = np.zeros((N+1, N+1))
for _ in range(m):
    l, r = map(int, input().split())
    kukan[r][l] += 1

# まず終点の側から考える
# iまでに終わる線分の数はi-1までの累積和
for i in range(1, n+1):
    kukan[i] += kukan[i-1]
# 次に始点の側から考える
# i以降に始まる線分の数はi-1までの総和
for i in range(1, n+1):
    kukan[:, i] += kukan[i-1]

for i in range(q):
    p, q = list(map(int, input().split()))
    print(int(kukan[q][q] - kukan[q][p-1] - kukan[p-1][q] + kukan[p-1][p-1]))


Fixed submission:
import numpy as np
n, m, q = map(int, input().split())
kukan = np.zeros((n+1, n+1))
for _ in range(m):
    l, r = map(int, input().split())
    kukan[r][l] += 1

# まず終点の側から考える
# iまでに終わる線分の数はi-1までの累積和
for i in range(1, n+1):
    kukan[i] += kukan[i-1]
# 次に始点の側から考える
# i以降に始まる線分の数はi-1までの総和
for i in range(1, n+1):
    kukan[:, i] += kukan[:, i-1]
# print(kukan)
for i in range(1, q+1):
    p, q = list(map(int, input().split()))
    print(int(kukan[q][q] - kukan[q][p-1] - kukan[p-1][q] + kukan[p-1][p-1]))
Buggy python submission (verdict: Runtime Error):
n = int(input())
bin_n = bin(n)
ranges = []

def base_minus2(m, i, s):
    tmp = s
    if i == 1:
        return tmp + str(m%2)
    for j in range(i-1, -1, -1):
        if m >= ranges[j-1][0] and m <= ranges[j-1][1]:
            tmp += "1"
            return base_minus2(m-(-2)**j, j, tmp)
        else:
            tmp += "0"

if n == 0:
    print("0")
elif n == 1:
    print("1")
else:
    for i in range(1, 30):
        min_r = sum([(-2)**j for j in range(1, i, 2)]) + (-2)**i
        max_r = sum([(-2)**j for j in range(0, i, 2)]) + (-2)**i
        ranges.append([min_r, max_r])

    result = base_minus2(n, 30, "")
    print(result.lstrip("0"))


Fixed submission:
n = int(input())
bin_n = bin(n)
ranges = []

def base_minus2(m, i, s):
    tmp = s
    if i == 1:
        return tmp + str(m%2)
    for j in range(i-1, -1, -1):

        if m >= ranges[j-1][0] and m <= ranges[j-1][1]:
            tmp += "1"
            return base_minus2(m-(-2)**j, j, tmp)
        else:
            if j == 0:
                return tmp + str(m%2)
            else:
                tmp += "0"


if n == 0:
    print("0")
elif n == 1:
    print("1")
else:
    for i in range(1, 60):
        min_r = sum([(-2)**j for j in range(1, i, 2)]) + (-2)**i
        max_r = sum([(-2)**j for j in range(0, i, 2)]) + (-2)**i
        ranges.append([min_r, max_r])

    result = base_minus2(n, 60, "")
    print(result.lstrip("0"))

Buggy python submission (verdict: Runtime Error):
n = int(input())
bin_n = bin(n)
ranges = []

def base_minus2(m, i, s):
    tmp = s
    if i == 1:
        return tmp + str(m%2)
    for j in range(i-1, -1, -1):
        if m >= ranges[j-1][0] and m <= ranges[j-1][1]:
            print(ranges[j-1], j)
            tmp += "1"
            print(tmp)
            return base_minus2(m-(-2)**j, j, tmp)
        else:
            tmp += "0"

if n == 0:
    print("0")
elif n == 1:
    print("1")
else:
    for i in range(1, 30):
        min_r = sum([(-2)**j for j in range(1, i, 2)]) + (-2)**i
        max_r = sum([(-2)**j for j in range(0, i, 2)]) + (-2)**i
        ranges.append([min_r, max_r])

    result = base_minus2(n, 30, "")
    print(result.lstrip("0"))


Fixed submission:
n = int(input())
bin_n = bin(n)
ranges = []

def base_minus2(m, i, s):
    tmp = s
    if i == 1:
        return tmp + str(m%2)
    for j in range(i-1, -1, -1):

        if m >= ranges[j-1][0] and m <= ranges[j-1][1]:
            tmp += "1"
            return base_minus2(m-(-2)**j, j, tmp)
        else:
            if j == 0:
                return tmp + str(m%2)
            else:
                tmp += "0"


if n == 0:
    print("0")
elif n == 1:
    print("1")
else:
    for i in range(1, 60):
        min_r = sum([(-2)**j for j in range(1, i, 2)]) + (-2)**i
        max_r = sum([(-2)**j for j in range(0, i, 2)]) + (-2)**i
        ranges.append([min_r, max_r])

    result = base_minus2(n, 60, "")
    print(result.lstrip("0"))
Buggy python submission (verdict: Runtime Error):
n = int(input())

def digits(n):
    if n < 10:
        return n
    else:
        return n%10 + digits(int(n/10))

sn = digits(n)
if n % sn == 0:
    print('Yes')
else:
    print('No')


Fixed submission:
s = input()
output = 0
for o in s:
    if o == '+':
        output += 1
    elif o == '-':
        output -= 1
    else:
        pass
print(output)

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

def digits(n):
    if n < 10:
        return n
    else:
        return n%10 + digits(int(n/10))

sn = digits(n)
if n % sn == 0:
    print('Yes')
else:
    print('No')


Fixed submission:
s = input()
output = 0
for o in s:
    if o == '+':
        output += 1
    elif o == '-':
        output -= 1
    else:
        pass
print(output)

Buggy python submission (verdict: Runtime Error):
s = input()
output = 0
for o in s:
    if o == '+':
        output += 1
    else if o == '-':
        output -= 1
    else:
        pass
print(output)

Fixed submission:
s = input()
output = 0
for o in s:
    if o == '+':
        output += 1
    elif o == '-':
        output -= 1
    else:
        pass
print(output)
Buggy python submission (verdict: Runtime Error):
sum=0
i = 1
while i < 4:
  val = int(input(""))
  sum+=val
  i += 1

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

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

Buggy python submission (verdict: Runtime Error):
sum=0
i = 1
while i < 4:
  val = int(input(""))
  sum+=val
  i += 1

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

Fixed submission:
a, b, c = map(int, input().split())
sum = a + b + c
if sum>=22:
    print('bust') 
else:
    print('win')
Buggy python submission (verdict: Runtime Error):
import sys

args = sys.argv

a = int(args[1])
b = int(args[2])
c = int(args[3])

zan = 0
if a >= b:
  zan = a - b
res = c - zan
if res <= 0:
  res = 0
print(res)


Fixed submission:
A = [int(x) for x in input().split()]
a = A[0]
b = A[1]
c = A[2]
zan = 0
if a >= b:
  zan = a - b
res = c - zan
if res <= 0:
  res = 0
print(res)

Buggy python submission (verdict: Runtime Error):
import sys

args = sys.argv

a = int(args[1])
b = int(args[2])
c = int(args[3])

zan = 0
if a >= b:
    zan = a - b
res = c - zan
if res <= 0:
    res = 0
print(res)


Fixed submission:
A = [int(x) for x in input().split()]
a = A[0]
b = A[1]
c = A[2]
zan = 0
if a >= b:
  zan = a - b
res = c - zan
if res <= 0:
  res = 0
print(res)
Buggy python submission (verdict: Runtime Error):
N = int(input())
l = list(map(int,input().split()))

for T in range(N-1):
    S1 = 0
    S2 = 0
    for i in range(T+1):
        S1 += l[i]
    for i in range(T+1,N):
        S2 += l[i]
    if T == 0:
        min = abs(S1-S2)
    else if abs(S1-S2) < min:
        min = abs(S1-S2)

print(min)


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

for T in range(N-1):
    S1 = 0
    S2 = 0
    for i in range(T+1):
        S1 += l[i]
    for i in range(T+1,N):
        S2 += l[i]
    if T == 0:
        min = abs(S1-S2)
    elif abs(S1-S2) < min:
        min = abs(S1-S2)

print(min)
Buggy python submission (verdict: Runtime Error):
i = str(input())
day = ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN']

if len(day) - day.index(i) == 0:
    print(7)
  else:
    print(len(day) - day.index(i))


Fixed submission:
i = str(input())
day = ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN']

if i == 'SUN':
    print(7)
else:
    print(len(day) - day.index(i) - 1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
Y = int(input())
for i in range(N+1):
    for j in range(N+1):
        if ((N-i-j) >= 0 and i*10000 + j*5000 + (N-(i+j))*1000 == Y):
            print(i, j, N-i-j)
            exit()
print(-1, -1, -1)


Fixed submission:
N, Y = list(map(int, input().split()))
for i in range(N+1):
    for j in range(N+1):
        if ((N-i-j) >= 0 and i*10000 + j*5000 + (N-(i+j))*1000 == Y):
            print(i, j, N-i-j)
            exit()
print(-1, -1, -1)
Buggy python submission (verdict: Runtime Error):
a=input()
sumInput=0
for num in a:
  sumInput=sumInput+num
print sumInput

Fixed submission:
a=input().split(" ")
sumInput=0
for num in a:
  sumInput=sumInput+int(num)
if sumInput>21:
	print("bust")
else:
  	print("win")
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())

result = 0
for x in range(k + 1):
    for y in range(k + 1):
        for z in range(k + 1):
            if x + y + z == s:
                result += 1

                break

print(result)


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

result = 0
for x in range(k + 1):
    for y in range(k + 1):
        z = s - x - y
        if 0 <= z <= k:
            result += 1

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())

result = 0
for x in range(k + 1):
    for y in range(k + 1):
        for z in range(k + 1):
            if x + y + z == s:
                result += 1

print(result)


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

result = 0
for x in range(k + 1):
    for y in range(k + 1):
        z = s - x - y
        if 0 <= z <= k:
            result += 1

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())

count = 0
for i in range(k + 1):
    for j in range(k + 1):
        for l in range(k + 1):
            if i + j + l == s:
                count += 1

print(count)


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

result = 0
for x in range(k + 1):
    for y in range(k + 1):
        z = s - x - y
        if 0 <= z <= k:
            result += 1

print(result)
Buggy python submission (verdict: Runtime Error):
n, l = map(int, input().split())
s = [input() for _ in range(n)]

result = ""
s.sort()
for i in range(l):
    result += s[i]

print(result)


Fixed submission:
n, l = map(int, input().split())
s = sorted([input() for _ in range(n)], key=lambda x: ([x[i] for i in range(l)]))
print("".join(s))
Buggy python submission (verdict: Runtime Error):
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)))

Fixed submission:
A1, A2, A3 = map(int, input().split())
if A1 + A2 + A3 >= 22:
    print('bust')
else:
    print('win')
Buggy python submission (verdict: Runtime Error):
n = int(input().strip())
d = list(map(int, input().split()))
h = [0] * n
for x in d:
  h[x] += 1

ans = 1
mod = 998244353
for i in range(1, n):
  ans = (ans * pow(h[i-1], h[i], mod)) % mod

if h[0] != 1 || d[0] != 0:
  ans = 0

print (ans)


Fixed submission:
n = int(input().strip())
d = list(map(int, input().split()))
h = [0] * n
for x in d:
  h[x] += 1

ans = 1
mod = 998244353
for i in range(1, n):
  ans = (ans * pow(h[i-1], h[i], mod)) % mod

if h[0] != 1 or d[0] != 0:
  ans = 0

print (ans)
Buggy python submission (verdict: Runtime Error):
data = lists(map(int, input().split()))
print (max(data) - min(data))

Fixed submission:
data = list(map(int, input().split()))
print (max(data) - min(data))
Buggy python submission (verdict: Runtime Error):
s = input().strip()
t = input().strip()
print ("Yes" if any(s[i:] + s[:i]  == t for i in range(len(s)) else "No")

Fixed submission:
s = input().strip()
t = input().strip()
print ("Yes" if any(s[i:] + s[:i]  == t for i in range(len(s))) else "No")
Buggy python submission (verdict: Runtime Error):
n = int(input().strip())
data = list(map(int, input().split())
print (sum(data) - n)

Fixed submission:
n = int(input().strip())
data = list(map(int, input().split()))

print (sum(data) - n)
Buggy python submission (verdict: Runtime Error):
inp = input().strip()
print len( [ i for i in range( len(inp)-1 ) if inp[i] != inp[i+1] ] )

Fixed submission:
inp = raw_input().strip()
print len( [ i for i in range( len(inp)-1 ) if inp[i] != inp[i+1] ] )

Buggy python submission (verdict: Runtime Error):
inp = input().strip()
print len( [ for i in range( len(inp)-1 ) if inp[i] != inp[i+1] ] )

Fixed submission:
inp = raw_input().strip()
print len( [ i for i in range( len(inp)-1 ) if inp[i] != inp[i+1] ] )
Buggy python submission (verdict: Runtime Error):
kaibun = input()
count = 0
lenstr = len(kaibun)

if lenstr%2 ==0:
  left = kaibun[:int(lenstr/2)]
  right = kaibun[int(lenstr/2):]
else:
  left = kaibun[:math.floor(lenstr/2)]
  right = kaibun[math.floor(lenstr/2):]

for i in range(len(left)):
  back = -1 * i -1
  if left[i] != right[back]:
    count+=1
print(count)

Fixed submission:
import math
kaibun = input()
count = 0
lenstr = len(kaibun)

if lenstr%2 ==0:
  left = kaibun[:int(lenstr/2)]
  right = kaibun[int(lenstr/2):]
else:
  left = kaibun[:math.floor(lenstr/2)]
  right = kaibun[math.floor(lenstr/2):]

for i in range(len(left)):
  back = -1 * i -1
  if left[i] != right[back]:
    count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=(list(map(int,input().split()))
cut==1
for i in range(n):
   ans=sum(l[:i])
   if ans<=x :
      cut+=1
   else:
      cut+=0
print(cut)

Fixed submission:
n,x=map(int,input().split())
l=(list(map(int,input().split())))
ans=0
cut=1
for i in range(n):
    ans+=l[i]
    if ans<=x:
        cut+=1
print(cut)
Buggy python submission (verdict: Runtime Error):
x, y, z = int(input().split())
if (x + y + z >= 22):
  print('bust)
else:
  print('win')

Fixed submission:
A1, A2, A3 = map(int, input().split())
if A1 + A2 + A3 >= 22:
    print('bust')
else:
    print('win')
Buggy python submission (verdict: Runtime Error):
from functools import reduce

def judge(S):
    kingaku = [int(x) for x in list(S)]
    maxkosuul = kingaku[:-2]
    keta = kingaku[-2:]
    maxkosuu = int(reduce(lambda x, y: x + y, [str(x) for x in maxkosuul]))
    simo = int(reduce(lambda x, y: x + y, [str(x) for x in keta]))
    simo1 = simo - simo//5*5
    simo2 = simo1 - simo1//4*4
    simo3 = simo2 - simo2//3*3
    simo4 = simo3 - simo3//2*2
    if simo//5+simo1//4+simo2//3+simo3//2+simo4 <= maxkosuu :
        print(1)
    else:
        print(0)

S = input()
judge(S)

Fixed submission:
from functools import reduce

def judge(S):
    if int(S) < 100:
        print(0)
        return

    kingaku = [int(x) for x in list(S)]
    maxkosuul = kingaku[:-2]
    keta = kingaku[-2:]
    maxkosuu = int(reduce(lambda x, y: x + y, [str(x) for x in maxkosuul]))
    simo = int(reduce(lambda x, y: x + y, [str(x) for x in keta]))
    simo1 = simo - simo//5*5
    simo2 = simo1 - simo1//4*4
    simo3 = simo2 - simo2//3*3
    simo4 = simo3 - simo3//2*2
    if simo//5+simo1//4+simo2//3+simo3//2+simo4 <= maxkosuu :
        print(1)
    else:
        print(0)

S = input()
judge(S)
Buggy python submission (verdict: Runtime Error):
def judge(S):
    if S == "SUN":
        print(7)
    if S == "MON"
        print(6)
    if S == "TUE":
        print(5)
    if S == "WED"
        print(4)
    if S == "THU":
        print(3)
    if S == "FRI"
        print(2)
    if S == "SAT":
        print(1)

S = input()
judge(S)

Fixed submission:
def judge(S):
    if S == "SUN":
        print(7)
    if S == "MON":
        print(6)
    if S == "TUE":
        print(5)
    if S == "WED":
        print(4)
    if S == "THU":
        print(3)
    if S == "FRI":
        print(2)
    if S == "SAT":
        print(1)

S = input()
judge(S)
Buggy python submission (verdict: Runtime Error):
def judge(S,N):
    a = [x for x in list(S)]
    lst = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B"]
    mak = []
    llst = lst
    for i in range(len(a)):
        for j in range(25):
            if a[i]==lst[j]:
                mak.append(lst[j+N])
    print("".join(mak))

N = int(input())
S = input()
judge(S,N)

Fixed submission:
def judge(S,N):
    a = [x for x in list(S)]
    lst = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
    mak = []
    llst = lst + lst
    for i in range(len(a)):
        for j in range(26):
            if a[i]==llst[j]:
                mak.append(llst[j+N])
    print("".join(mak))

N = int(input())
S = input()
judge(S,N)