Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
x, y = map(int, input().split())
n = len(s)
#dp_x: +, -に向いてて行けるかどうか
dp_x = [[False, False] for i in range(2*n+2)]
dp_y = [[False, False] for i in range(2*n+2)]
dp_x[0][0] = True
dp_y[0][0] = True
dp_y[0][1] = True

flag = 0
for i in range(len(s)):
    if s[i] == "T":
        if flag == 0:
            flag = 2
            for j in range(-n, n+1):
                if dp_x[j][0]:
                    dp_x[j][1] = True

        elif flag == 2:
            flag = 1
            for j in range(-n, n+1):
                dp_x[j][0] = dp_x[j][1] or dp_x[j][0]
                dp_x[j][1] = dp_x[j][1] or dp_x[j][0]

        else:
            flag = 2
            for j in range(-n, n+1):
                dp_y[j][0] = dp_y[j][1] or dp_y[j][0]
                dp_y[j][1] = dp_y[j][1] or dp_y[j][0]


    else:
        if flag == 0:
            for j in range(n, -n-1, -1):
                dp_x[j][0] = dp_x[j-1][0]

        elif flag == 1:
            for j in range(n, -n-1, -1):
                dp_x[j][0] = dp_x[j-1][0]
                dp_x[-j][1] = dp_x[-j+1][1]
        else:
            for j in range(n, -n-1, -1):
                dp_y[j][0] = dp_y[j-1][0]
                dp_y[-j][1] = dp_y[-j+1][1]


if dp_x[x][0] or dp_x[x][1]:
    if dp_y[y][0] or dp_y[y][1]:
        print("Yes")
    else:
        print("No")
else:
    print("No")


Fixed submission:
s = input()
x, y = map(int, input().split())
n = len(s)
#dp_x: +, -に向いてて行けるかどうか
dp_x = [[False, False] for i in range(2*n+2)]
dp_y = [[False, False] for i in range(2*n+2)]
dp_x[0][0] = True
dp_y[0][0] = True
dp_y[0][1] = True

flag = 0
for i in range(len(s)):
    if s[i] == "T":
        if flag == 0:
            flag = 2
            for j in range(-i-1, i+2):
                if dp_x[j][0]:
                    dp_x[j][1] = True

        elif flag == 2:
            flag = 1
            for j in range(-i-1, i+2):
                dp_x[j][0] = dp_x[j][1] or dp_x[j][0]
                dp_x[j][1] = dp_x[j][1] or dp_x[j][0]

        else:
            flag = 2
            for j in range(-i-1, i+2):
                dp_y[j][0] = dp_y[j][1] or dp_y[j][0]
                dp_y[j][1] = dp_y[j][1] or dp_y[j][0]


    else:
        if flag == 0:
            for j in range(i+1, -i-2, -1):
                dp_x[j][0] = dp_x[j-1][0]

        elif flag == 1:
            for j in range(i+1, -i-2, -1):
                dp_x[j][0] = dp_x[j-1][0]
                dp_x[-j][1] = dp_x[-j+1][1]
        else:
            for j in range(i+1, -i-2, -1):
                dp_y[j][0] = dp_y[j-1][0]
                dp_y[-j][1] = dp_y[-j+1][1]


if dp_x[x][0] or dp_x[x][1]:
    if dp_y[y][0] or dp_y[y][1]:
        print("Yes")
    else:
        print("No")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
seisuu = [0 for i in range(N+1)]
for i in range(N):
    for j in range(N+1):
        if A[i] == j:
            seisuu[j] += 1

seisuu.sort()
seisuu.reverse()
for i in range(K, N):
    ans += seisuu[i]
print(ans)


Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
seisuu = [0 for i in range(N+1)]
for i in range(N):
    seisuu[A[i]] += 1
        

seisuu.sort()
seisuu.reverse()
for i in range(K, N):
    ans += seisuu[i]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
seisuu = [0 for i in range(N+1)]
for i in range(N):
    for j in range(N+1):
        if A[i] == j:
            seisuu[j] += 1

seisuu.sort()
seisuu.reverse()
for i in range(K, N):
    ans += seisuu[i]
print(ans)


Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
seisuu = [0 for i in range(N+1)]
for i in range(N):
    seisuu[A[i]] += 1
        

seisuu.sort()
seisuu.reverse()
for i in range(K, N):
    ans += seisuu[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
Acount = 0
count = 0
AKIBA = ["K", "I", "H", "B", "R"]
AKIBAcount = [1, 0, 0, 1, 1]
flag = 1
for i in range(len(S)):
    if count == 5:
        if S[i] == "A":
            Acount += 1
        if Acount >= 2:
            flag = 0
    if S[i] == "A":
        Acount += 1
    else:
        if S[i] == AKIBA[count] and Acount <= AKIBAcount[count]:
            count += 1
            Acount = 0
        else:
            flag = 0
            break

if flag == 1 and count == 5:
    print("YES")
else:
    print("NO")


Fixed submission:
S = input()
Acount = 0
count = 0
AKIBA = ["K", "I", "H", "B", "R"]
AKIBAcount = [1, 0, 0, 1, 1]
flag = 1
for i in range(len(S)):
    if count == 5:
        if S[i] == "A":
            Acount += 1
        else:
            flag = 0
        if Acount >= 2:
            flag = 0

    if S[i] == "A":
        Acount += 1
    else:
        if count <= 4:
            if S[i] == AKIBA[count] and Acount <= AKIBAcount[count]:
                count += 1
                Acount = 0
            else:
                flag = 0
                break

if flag == 1 and count == 5:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()
ans = 0
for i in range(N):
    for j in range(N):
        if A[i] < B[j]:
            for k in range(N):
                if B[j] < C[N-1-k]:
                    ans += 1
                else:
                    break
print(ans)

Fixed submission:
N = int(input())
ans = 0
for i in range(100000):
    if i**2 <= N:
        ans = i**2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()
ans = 0
for i in range(N):
    for j in range(N):
        if A[i] < B[j]:
            for k in range(N):
                if B[j] < C[N-1-k]:
                    ans += 1
                else:
                    break
print(ans)

Fixed submission:
import bisect
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()
ans = 0
for i in range(N):
    a = bisect.bisect_left(A, B[i])
    c = bisect.bisect_right(C, B[i])
    ans += a*(N-c)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()
ans = 0
for i in range(N):
    for j in range(N):
        if A[i] < B[j]:
            for k in range(N):
                if B[j] < C[N-1-k]:
                    ans += 1
                else:
                    break
print(ans)


Fixed submission:
import bisect
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()
ans = 0
for i in range(N):
    a = bisect.bisect_left(A, B[i])
    c = bisect.bisect_right(C, B[i])
    ans += a*(N-c)

print(ans)
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = ["..................................................."]
for i in range(H):
    S.append(input())
for i in range(H+1):
    S[i] = '.' + S[i] + '.'
S.append("...................................................")
ans = [[0] * W for i in range(H)]

for i in range(1,H+1):
    for j in range(1,W+1):
        if S[i][j] == '#':
            ans[i-1][j-1] = '#'
        else:
            count = []
            for a in range(i-1, i+2):
                for b in range(j-1, j+2):
                    count.append(S[a][b])
            ans[i-1][j-1] = count.count('#')

for i in range(H):
    yoko = ''
    for j in range(W):
        yoko += str(ans[i][j])
    print(yoko)

Fixed submission:
H, W = map(int, input().split())
S = ["........................................................"]
for i in range(H):
    S.append(input())
for i in range(H+1):
    S[i] = '.' + S[i] + '.'
S.append("........................................................")
ans = [[0] * W for i in range(H)]

for i in range(1,H+1):
    for j in range(1,W+1):
        if S[i][j] == '#':
            ans[i-1][j-1] = '#'
        else:
            count = []
            for a in range(i-1, i+2):
                for b in range(j-1, j+2):
                    count.append(S[a][b])
            ans[i-1][j-1] = count.count('#')

for i in range(H):
    yoko = ''
    for j in range(W):
        yoko += str(ans[i][j])
    print(yoko)
Buggy python submission (verdict: Runtime Error):
s = input()
print(s[:(len(s)-8)]

Fixed submission:
s = input()
print(s[:(len(s)-8)])

Buggy python submission (verdict: Runtime Error):
s = input()
print(s[:len(s)-8]

Fixed submission:
s = input()
print(s[:(len(s)-8)])
Buggy python submission (verdict: Runtime Error):
N, M, K = map(int, inpu().split())
flag = 0
for i in range(N+1):
  for j in range(M+1):
    if (N-i)*(M-j) == K:
      flag = 1
if flag == 1:
  print("Yes")
else:
  print("No")

Fixed submission:
N, M, K = map(int, input().split())
flag = 0
for i in range(N+1):
  for j in range(M+1):
    if (N-i)*j + i*(M-j) == K:
      flag = 1
if flag == 1:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
from heapq import *
H, W = map(int, input().split())

strings = [0] * 26
for i in range(H):
    s = list(map(int, input().split()))
    for j in range(W):
        strings[ord(s[j])-97] -= 1

one = 0
two = 0
four = 0
s = H * W
if H % 2 == 1 and W % 2 == 1:
    one = 1
    two = H // 2 + W // 2
    four = (s-1-2*two)//4
elif H % 2 == 1:
    two = W // 2
    four = (s - two*2)//4
elif W % 2 == 1:
    two = H // 2
    four = (s - two*2)//4
else:
    four = s // 4

flag = 1
while True:
    if four > 0:
        a = heappop(strings)
        if a <= -4:
            a += 4
            heappush(strings, a)
        else:
            flag = 0
            break

    elif two > 0:
        a = heappop(strings)
        if a <= -2:
            a += 2
            heappush(strings, a)
        else:
            flag = 0
            break
    elif one > 0:
        a = heappop(strings)
        if a <= -1:
            a += 1
            heappush(strings, a)
        else:
            flag = 0
            break
    else:
        break

if flag == 1:
    print("Yes")
else:
    print("No")
    


Fixed submission:
from heapq import *
h, w = map(int, input().split())

char = [0]*26
for i in range(h):
    a = input()
    for j in range(w):
        char[ord(a[j])-97] -= 1

heapify(char)

q = []
if h % 2 == 1 and w % 2 == 1:
    for i in range((h//2)*(w//2)):
        q.append(4)
    for i in range((h+w-2)//2):
        q.append(2)
    q.append(1)

elif h % 2 == 1:
    for i in range((h//2)*(w//2)):
        q.append(4)
    for i in range(w//2):
        q.append(2)

elif w % 2 == 1:
    for i in range((h//2)*(w//2)):
        q.append(4)
    for i in range(h//2):
        q.append(2)

else:
    for i in range((h//2)*(w//2)):
        q.append(4)

flag = 1
for i in q:
    a = heappop(char)
    if -a >= i:
        a += i
        heappush(char, a)
    else:
        flag = 0
        break

if flag == 1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N, M, R = map(int, input().split())
INF = 2 ** 63 - 1
d = [[INF for i in range(N+1)] for j in range(N+1)]
r = list(map(int, input().split()))
r = list(itertools.permutations(r))
for i in range(M):
    a, b, c = map(int, input().split())
    d[a][b] = c
    d[b][a] = c
for i in range(N+1):
    d[i][i] = 0


for k in range(N+1):
    for i in range(N+1):
        for j in range(N+1):
            d[i][j] = min(d[i][j], d[i][k] + d[k][j])

ans = INF
for path in r:
    anstemp = 0
    for i in range(R-1):
        anstemp += d[path[i]][path[i+1]]
    ans = min(anstemp, ans)
print(ans)


Fixed submission:
import itertools
N, M, R = map(int, input().split())
INF = 2 ** 63 - 1
d = [[INF for i in range(N+1)] for j in range(N+1)]
r = list(map(int, input().split()))
r = list(itertools.permutations(r))
for i in range(M):
    a, b, c = map(int, input().split())
    d[a][b] = c
    d[b][a] = c
for i in range(N+1):
    d[i][i] = 0


for k in range(N+1):
    for i in range(N+1):
        for j in range(N+1):
            d[i][j] = min(d[i][j], d[i][k] + d[k][j])

ans = INF
for path in r:
    anstemp = 0
    for i in range(R-1):
        anstemp += d[path[i]][path[i+1]]
    ans = min(anstemp, ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
ans = ""
for i in range(len(s)//2 + 1):
    ans += str(s[2*i])
print(ans)


Fixed submission:
s = input()
ans = ""
for i in range((len(s)+1)//2):
    ans += str(s[2*i])
print(ans)
Buggy python submission (verdict: Runtime Error):
from fractions import gcd
N = int(input())
a = int(input())
for i in range(N-1):
    b = int(input())
    c = a * b / gcd(a, b)
    a = b
    b = c
print(int(c))


Fixed submission:
from fractions import gcd
from functools import reduce

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
def lcm_base(x, y):
    return(x*y)//gcd(x,y)
def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm(T))

Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
    A = min([a, b])
    B = max([a, b])
    while b:
        a, b = b, a % b
    return a
N = int(input())
a = int(input())
for i in range(N-1):
    b = int(input())
    c = a * b / gcd(a, b)
    a = b
    b = c
print(int(c))


Fixed submission:
from fractions import gcd
from functools import reduce

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
def lcm_base(x, y):
    return(x*y)//gcd(x,y)
def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm(T))

Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
N = int(input())
a = int(input())
for i in range(N-1):
    b = int(input())
    c = a * b / gcd(a, b)
    a = b
    b = c
print(int(c))


Fixed submission:
from fractions import gcd
from functools import reduce

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
def lcm_base(x, y):
    return(x*y)//gcd(x,y)
def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm(T))

Buggy python submission (verdict: Runtime Error):
from math import gcd
N = int(input())
a = int(input())
for i in range(N-1):
    b = int(input())
    c = a * b / gcd(a, b)
    a = b
    b = c
print(int(c))


Fixed submission:
from fractions import gcd
from functools import reduce

N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
def lcm_base(x, y):
    return(x*y)//gcd(x,y)
def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm(T))
Buggy python submission (verdict: Runtime Error):
import bisect
N, M = map(int, input().split())
a = [None for i in range(2 * M)]
number = [None for i in range(2 * M)]
flag = 0
for i in range(M):
    A, B = map(int, input().split())
    a[2*i] = [A, B]
    a[2*i+1] = [B, A]
    number[2*i]
    number[2*i+1]
a.sort()
b = a[:]
b.reverse()
one = []
two = []
for i in range(M):
    if a[i][0] == 1:
        one.append(a[i][1])
    else:
        break

for i in range(M):
    if b[i][0] == N:
        two.append(b[i][1])
    else:
        break
def intersect_list(lst1, lst2):
    arr = []
    lst = lst1.copy()
    for element in lst2:
        try:
            lst.remove(element)
        except ValueError:
            pass
        else:
            arr.append(element)
    return arr
if len(intersect_list(one, two)) != 0:
    print("POSSIBLE")

else:
    print("IMPOSSIBLE")


Fixed submission:
N = input()
print("ABC" + N)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
for i in range(n):
    a[i].reverse()

ans = n
used = set()
for i in range(m):
    count = [0]*(m+1)
    for j in range(n):
        count[a[j][-1]] += 1

    ans = min(max(count), ans)
    num = count.index(max(count))
    used.add(num)
    for j in range(n):
        while True:
            if a[j][-1] in used:
                a[j].pop()
            else:
                break

print(ans)


Fixed submission:
n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
for i in range(n):
    a[i].reverse()

ans = n
used = set()
for i in range(m):
    count = [0]*(m+1)
    for j in range(n):
        count[a[j][-1]] += 1

    ans = min(max(count), ans)
    num = count.index(max(count))
    used.add(num)
    for j in range(n):
        while len(a[j]) > 0:
            if a[j][-1] in used:
                a[j].pop()
            else:
                break

print(ans)

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
for i in range(n):
    a[i].reverse()

ans = n
used = set()
for i in range(m):
    count = [0]*(m+1)
    for j in range(n):
        count[a[j][-1]] += 1

    ans = min(max(count), ans)
    num = count.index(max(count))
    used.add(num)
    for j in range(n):
        if a[j][-1] in num:
            a[j].pop()

print(ans)


Fixed submission:
n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
for i in range(n):
    a[i].reverse()

ans = n
used = set()
for i in range(m):
    count = [0]*(m+1)
    for j in range(n):
        count[a[j][-1]] += 1

    ans = min(max(count), ans)
    num = count.index(max(count))
    used.add(num)
    for j in range(n):
        while len(a[j]) > 0:
            if a[j][-1] in used:
                a[j].pop()
            else:
                break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int, input().split()))
ans = 10000000000
total = sum(a)
for i in range(1, N):
    sunuke = a[:i]
    Sum = sum(sunuke)
    if abs(Sum - (total - Sum)) <= ans:
        ans = abs(Sum - (total - Sum))
print(ans)


Fixed submission:
N = int(input())
a = list(map(int, input().split()))
ans = 10000000000
total = sum(a)
sunuke = 0
for i in range(N-1):
    sunuke += a[i]
    dif = abs(2 * sunuke - total)
    if dif <= ans:
        ans = dif
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int, input().split()))
ans = 10000000000
total = sum(a)
for i in range(1, N):
    sunuke = a[:i]
    Sum = sum(sunuke)
    if abs(Sum - (total - Sum)) <= ans:
        ans = abs(Sum - (total - Sum))
print(ans)


Fixed submission:
N = int(input())
a = list(map(int, input().split()))
ans = 10000000000
total = sum(a)
sunuke = 0
for i in range(N-1):
    sunuke += a[i]
    dif = abs(2 * sunuke - total)
    if dif <= ans:
        ans = dif
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
N = int(input())
tree = [[] for i in range(N+1)]

for i in range(N-1):
    a, b = map(int, input().split())
    tree[a].append(b)
    tree[b].append(a)

dist_fennec = [100001] * (N+1)
dist_snuke = [100001] * (N+1)
q = [1]
dist[1] = 0
while q:
    now = q.pop()
    for next in tree[now]:
        if dist_fennec[next] == 100001:
            dist_fennec[next] = dist_fennec[now] + 1
            q.append(next)

q = [N]
dist[N] = 0
while q:
    now = q.pop()
    for next in tree[now]:
        if dist_snuke[next] == 100001:
            dist_snuke[next] = dist_snuke[now] + 1
            q.append(next)

fennec, snuke = 0, 0
for i in range(1, N+1):
    if dist_snuke[i] <= dist_fennec[i]:
        fennec += 1
    else:
        snuke += 1

if fennec > snuke:
    print("Fennec")
else:
    print("Snuke")


Fixed submission:
import sys
input = sys.stdin.readline
N = int(input())
tree = [[] for i in range(N+1)]

for i in range(N-1):
    a, b = map(int, input().split())
    tree[a].append(b)
    tree[b].append(a)

dist_fennec = [100001] * (N+1)
dist_snuke = [100001] * (N+1)
q = [1]
dist_fennec[1] = 0
while q:
    now = q.pop()
    for next in tree[now]:
        if dist_fennec[next] == 100001:
            dist_fennec[next] = dist_fennec[now] + 1
            q.append(next)

q = [N]
dist_snuke[N] = 0
while q:
    now = q.pop()
    for next in tree[now]:
        if dist_snuke[next] == 100001:
            dist_snuke[next] = dist_snuke[now] + 1
            q.append(next)

fennec, snuke = 0, 0
for i in range(1, N+1):
    if dist_snuke[i] >= dist_fennec[i]:
        fennec += 1
    else:
        snuke += 1

if fennec > snuke:
    print("Fennec")
else:
    print("Snuke")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = [0]*(n+1)
for i in range(n):
    if b[a[i]] == 0:
        b[a[i]] += 1
    else:
        d = a[i]

l = 0
r = 0
c = 0
for i in range(n+1):
    if a[i] != d and c == 0:
        l += 1
    elif a[i] != d and c == 2:
        r += 1
    if a[i] == d:
        c += 1


def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9 + 7
N = 100001
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


print(n)
for i in range(2, n+2):
    print(cmb(n+1, i, mod)-max(0, r-i+2)-max(0, l-i+2))


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = [0]*(n+1)
for i in range(n+1):
    if b[a[i]] == 0:
        b[a[i]] += 1
    else:
        d = a[i]

l = 0
r = 0
c = 0
for i in range(n+1):
    if a[i] != d and c == 0:
        l += 1
    elif a[i] != d and c == 2:
        r += 1
    elif a[i] == d:
        c += 1


def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9 + 7
N = 100011
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

for i in range(1, n+2):
    print((cmb(n+1, i, mod)-cmb(r+l, i-1, mod))%mod)
Buggy python submission (verdict: Runtime Error):
N = int(input())
s = []
for i in range(N):
    s.append(int(input()))
stot = sum(s)
#i個のうちいくつか使ってjにできるか
dp = [[False for i in range(stot+101)] for j in range(N+1)]
dp[0][0] = True
for i in range(N):
    for j in range(stot):
        dp[i+1][j+s[i]] = dp[i][j] or dp[i+1][j+s[i]]
        dp[i+1][j] = dp[i][j] or dp[i+1][j]


for i in range(stot+1):
    if dp[N][i] and i % 10 != 0:
        ans = i
print(ans)


Fixed submission:
N = int(input())
s = []
for i in range(N):
    s.append(int(input()))
stot = sum(s)
#i個のうちいくつか使ってjにできるか
dp = [[False for i in range(stot+101)] for j in range(N+1)]
dp[0][0] = True
for i in range(N):
    for j in range(stot):
        dp[i+1][j+s[i]] = dp[i][j] or dp[i+1][j+s[i]]
        dp[i+1][j] = dp[i][j] or dp[i+1][j]

ans = 0
for i in range(stot+1):
    if dp[N][i] and i % 10 != 0:
        ans = i
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B, C = int(input().split())
if A <= C and C <= B:
    print("Yes")
else:
    print("No")


Fixed submission:
A, B, C = map(int, input().split())
if A <= C and C <= B:
    print("Yes")
else:
    print("No")