Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
print(int(6 - int(input()) - int(input()))

Fixed submission:
print(int(6 - int(input()) - int(input())))
Buggy python submission (verdict: Runtime Error):
input()
p = list(map(int, input().split()))
for i, p_ in enumerate(p):
  a += (p_ != (i + 1))
print('YNEOS'[a > 2 :: 2])


Fixed submission:
input()
p = list(map(int, input().split()))
a = 0
for i, p_ in enumerate(p):
  a += (p_ != (i + 1))
print('YNEOS'[a > 2 :: 2])
Buggy python submission (verdict: Runtime Error):
n=int(input());d=[0]*20001;a=1;b=-1
for i in range(n):
    c=int(input())
    if b!=c:
        a+=d[c]
        d[c]=a
    b=c
print(a%(10**9+7))

Fixed submission:
n=int(input());d=[0]*200001;a=1;b=0
for i in range(n):
    c=int(input())
    if b!=c:
        a+=d[c]
        d[c]=a
    b=c
print(a%(10**9+7))

Buggy python submission (verdict: Runtime Error):
n=int(input());d=[0]*20001;a=1;b=-1
for i in range(n):
    c=int(input())
    if b!=c:
        a+=d[c]
        d[c]=a
    b=c
print(a%(10**9+9))

Fixed submission:
n=int(input());d=[0]*200001;a=1;b=0
for i in range(n):
    c=int(input())
    if b!=c:
        a+=d[c]
        d[c]=a
    b=c
print(a%(10**9+7))

Buggy python submission (verdict: Runtime Error):
n=int(input());d=[0]*(n+1);l=[int(input()) for i in range(n)];a=1;b=-1
for i in range(n):
    c=l[i]
    if b!=c:
        a+=d[c]
        d[c]=a
    b=c
print(a%(10**9+9))

Fixed submission:
n=int(input());d=[0]*200001;a=1;b=0
for i in range(n):
    c=int(input())
    if b!=c:
        a+=d[c]
        d[c]=a
    b=c
print(a%(10**9+7))
Buggy python submission (verdict: Runtime Error):
import math
n,m = map(int, input().split(' '))
s = input()
t = input()
g = math.gcd(n,m)
Flag = True
for i in range(n):
    if (m*i)%n == 0:
        if s[i] != t[int((i*m)/n)]:
            Flag = False
if Flag:
    print(int((n*m)/g))
else:
    print(-1)

Fixed submission:
import fractions
n,m = map(int, input().split(' '))
s = input()
t = input()
g = fractions.gcd(n, m)
Flag = True
for i in range(n):
    if (m*i)%n == 0:
        if s[i] != t[int((i*m)/n)]:
            Flag = False
if Flag:
    print(int((n*m)/g))
else:
    print('-1')
Buggy python submission (verdict: Runtime Error):
S=input()
flag=True
if S[0]=="A":
    if S[2:-1].count("C")==1:
        S=S.replace('A','').replace('C','')
        if S==S.lower():
            flag=True
        else:
            flag=False
    else:
        flag=false
else:
    flag=False
if flag:
    print('AC')
else:
    print('WA')

Fixed submission:
S=input()
flag=True
if S[0]=="A":
    if S[2:-1].count("C")==1:
        S=S.replace('A','').replace('C','')
        if S==S.lower():
            flag=True
        else:
            flag=False
    else:
        flag=False
else:
    flag=False
if flag:
    print('AC')
else:
    print('WA')
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input.split())
if a + b == 15:
    print('+')
elif a*b == 15:
    print('*')
else:
    print('x')

Fixed submission:
a, b = map(int, input().split())
if a + b == 15:
    print('+')
elif a*b == 15:
    print('*')
else:
    print('x')

Buggy python submission (verdict: Runtime Error):
s=input()
l=input()
x=''
for i in range(len(s)):
        if i%l==0:
                x+=s[i]
print(x)


Fixed submission:
a, b = map(int, input().split())
if a + b == 15:
    print('+')
elif a*b == 15:
    print('*')
else:
    print('x')
Buggy python submission (verdict: Runtime Error):
if a > 0:
    print('Positive')
if a <= 0 and b >= 0:
    print('Zero')
else:
    if (b - a + 1) % 2 == 0:
        print('Positive')
    else:
        print('Negative')

Fixed submission:
a, b = (int(x) for x in input().split())
if a > 0:
    print('Positive')
elif a <= 0 and b >= 0:
    print('Zero')
else:
    if (b - a + 1) % 2 == 0:
        print('Positive')
    else:
        print('Negative')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

l = []
count = 0
for i in A:
    if i not in l:
        l.append(i)
    else:
        count += 1

if count == 0:
    print("YES")
else:
    print("NO")

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = set(a)

if len(a) == len(b):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())

if a >= b and a >= c:
    print(b + c)
elif b >= a and b >= c:
    print(a + c)
elif c >= a and c >= b:
    print(a + b)
elif a == b == c:
    print(a + b

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

print(a[0]+a[1])

Buggy python submission (verdict: Runtime Error):
def total_cost(num1, num2, num3):
    if num1 >= num2 and num1 >= num3:
        return num2 + num3
    elif num2 >= num1 and num2 >= num3:
        return num1 + num3
    elif num3 >= num1 and num3 >= num2:
        return num1 + num2
    elif num1 == num2 == num3:
        return num1 + num2

print(total_cost(int(input()), int(input()), int(input())))

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

print(a[0]+a[1])
Buggy python submission (verdict: Runtime Error):
A = input()
B = input()
C = input()
D = input()

volume1 = A * B
volume2 = C * D

if volume1 > volume2:
    print(volume1)
else:
    print(volume2)

Fixed submission:
A, B, C, D = map(int,input().split())

volume1 = A * B
volume2 = C * D

if volume1 > volume2:
    print(volume1)
else:
    print(volume2)
Buggy python submission (verdict: Runtime Error):
num1 = float(input())
op = input()
num2 = float(input())

if op == "+":
    print(num1 + num2)
elif op == "-":
    print(num1 - num2)

Fixed submission:
num1, op, num2 = input().split()

if op == "+":
    print(int(num1) + int(num2))
elif op == "-":
    print(int(num1) - int(num2))
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())

1 < a, b, c < 100
if a == b == c:
    print(1)
else:
    if a != b != c:
        print(3)
    else:
        print(2)

Fixed submission:
a, b, c = map(int, input().split())
print(len(set([a, b, c])))
Buggy python submission (verdict: Runtime Error):
a, b, h = map(int, input().split())
print(int((a + b) * h / 2))

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print(int((a + b) * h / 2))

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

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print(int((a + b) * h / 2))

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

print((a + b) * h / 2)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print(int((a + b) * h / 2))

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

print((a + b) * h / 2)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print(int((a + b) * h / 2))
Buggy python submission (verdict: Time Limit Exceeded):
from functools import cmp_to_key
import heapq
N = int(input())
A = list(map(int,input().split()))
B = [(A[i],i+1) for i in range(0,len(A))]
B.sort()
st = ""
for i in B:
    st = st + " " + str(i[1])
print(st[1:])

Fixed submission:
from functools import cmp_to_key
import heapq
N = int(input())
A = list(map(int,input().split()))
B = [(A[i],i+1) for i in range(0,len(A))]
B.sort()
print(' '.join([str(n[1]) for n in B]))

Buggy python submission (verdict: Time Limit Exceeded):
from functools import cmp_to_key
import heapq
N = int(input())
A = list(map(int,input().split()))
B = []
for i in range(0,len(A)):
    B.append((A[i],i+1))
B.sort()
st = ""
for i in B:
    st = st + " " + str(i[1])
print(st[1:])

Fixed submission:
from functools import cmp_to_key
import heapq
N = int(input())
A = list(map(int,input().split()))
B = [(A[i],i+1) for i in range(0,len(A))]
B.sort()
print(' '.join([str(n[1]) for n in B]))
Buggy python submission (verdict: Runtime Error):
d = int(input())
if d == 3 or d== 5 or d==7:
	print("YES")
else
	print("NO")	

Fixed submission:
d = int(input())
if d == 3 or d== 5 or d==7:
 print("YES")
else:
 print("NO")
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
pi = list(map(int, input().split()))

max = 0
maxi = 0
for i in range(N - K):
    tmp = sum(pi[i : i + K - 1])
    if tmp > max:
        max = tmp
        maxi = i

out = 0
for j in range(K)
    exp = (pi[j + maxi] + 1) / 2
    out = out + exp

print(out)

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

tmp = sum(pi[0 : K])
max = tmp

if N == K:
    print((max + K) / 2)
else:
    for i in range(N - K):
        tmp = tmp - pi[i] + pi[i + K]
        if tmp > max:
            max = tmp
    print((max + K) / 2)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
pi = list(map(int, input().split()))

max = 0
maxi = 0
for i range(N - K):
    sum = pi(i) + pi(i + 1) + pi(i + 2)
    if sum >= max:
        max = sum
        maxi = i

out = 1 + (pi(maxi) - 1) * 0.5 + 1 + (pi(maxi + 1) - 1) * 0.5 + 1 + (pi(maxi + 2) - 1) * 0.5
print(out)

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

tmp = sum(pi[0 : K])
max = tmp

if N == K:
    print((max + K) / 2)
else:
    for i in range(N - K):
        tmp = tmp - pi[i] + pi[i + K]
        if tmp > max:
            max = tmp
    print((max + K) / 2)

Buggy python submission (verdict: Runtime Error):
N, K = map(int(input().split()))
pi = list(map(int(x) for x in input().split()))

max = 0
maxi = 0
i = 0
for j range(N - K):
    sum = pi(j) + pi(j + 1) + pi(j + 2)
    if sum >= max:
        max = sum
        maxi = j

out = 1 + (pi(i) - 1) * 0.5 + 1 + (pi(i + 1) - 1) * 0.5 + 1 + (pi(i + 2) - 1) * 0.5
print(out)

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

tmp = sum(pi[0 : K])
max = tmp

if N == K:
    print((max + K) / 2)
else:
    for i in range(N - K):
        tmp = tmp - pi[i] + pi[i + K]
        if tmp > max:
            max = tmp
    print((max + K) / 2)

Buggy python submission (verdict: Runtime Error):
N = int(input())
K = int(input())
pi = list(int(x) for x in input().split())

max = 0
maxi = 0
for i range(N - K):
    sum = pi(i) + pi(i + 1) + pi(i + 2)
    if sum >= max:
        max = sum
        maxi = i

out = 1 + (pi(i) - 1) * 0.5 + 1 + (pi(i + 1) - 1) * 0.5 + 1 + (pi(i + 2) - 1) * 0.5
print(out)

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

tmp = sum(pi[0 : K])
max = tmp

if N == K:
    print((max + K) / 2)
else:
    for i in range(N - K):
        tmp = tmp - pi[i] + pi[i + K]
        if tmp > max:
            max = tmp
    print((max + K) / 2)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N, M = map(int, input().split())
ls = np.empty(M)
rs = np.empty(M)


for i in range(M):
    l, r = map(int, input().split())
    ls[i] = l
    rs[i] = r

min_diff_arg = np.argmin(rs - ls)
candidate = np.arange(ls[min_diff_arg], rs[min_diff_arg]+1, 1)

valid_counter = 0
for c in candidate:
    if ((ls <= c) * (c <= rs)).all():
        valid_counter += 1

print(valid_counter)


Fixed submission:
import numpy as np

N, M = map(int, input().split())
ls = np.empty(M)
rs = np.empty(M)


for i in range(M):
    l, r = map(int, input().split())
    ls[i] = l
    rs[i] = r

if 0 <= (np.min(rs) - np.max(ls)):
    print(int(np.min(rs) - np.max(ls) + 1))
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
#!user/bin/env python
# coding:utf-8

n = int(input())
info = []

for i in range(n):
    ai = int(input())
    bi = int(input())
    info.append([ai, bi])

info = sorted(info, key=lambda inf: inf[1])

imp = info[0][0] + info[0][1]
print(imp)

Fixed submission:
#!user/bin/env python
# coding:utf-8

n = int(input())
info = []

for i in range(n):
    # ai = int(input())
    # bi = int(input())
    abi = input()
    ai, bi = int(abi.split(' ')[0]), int(abi.split(' ')[1])
    
    info.append([ai, bi])

info = sorted(info, key=lambda inf: inf[1])

imp = info[0][0] + info[0][1]
print(imp)
Buggy python submission (verdict: Time Limit Exceeded):
n  = int(input())
m  = 10 ** 9 + 7
xs = [int(x) for x in input().split()]
bs = [0] * 60
b  = 1

for x in xs:
	e = 0
	
	while 0 < x:
		if x % 2 == 1:
			bs[e] += 1
			
		e  += 1
		x //= 2

b = 1
r = 0

for i in range(0, 60):
	r  += ((n - bs[i]) * bs[i]) * b
	b <<= 1
	
print(r % m)


Fixed submission:
n  = int(input())
m  = 10 ** 9 + 7
xs = [int(x) for x in input().split()]
bs = [0] * 60
b  = 1

for x in xs:
	e = 0
	
	while 0 < x:
		if x % 2 == 1:
			bs[e] += 1
			
		e  += 1
		x //= 2

b = 1
r = 0

for i in range(0, 60):
	r  += ((n - bs[i]) * bs[i]) * b
	b <<= 1
	
print(r % m)

Buggy python submission (verdict: Time Limit Exceeded):
n  = int(input())
m  = 10 ** 9 + 7
xs = [int(x) for x in input().split()]
bs = [0] * 61
b  = 1

for x in xs:
	e = 0
	
	while 0 < x:
		if x % 2 == 1:
			bs[e] += 1
			
		e  += 1
		x //= 2

b = 1
r = 0

for i in range(0, 61):
	if 0 < bs[i] and bs[i] < n:
		r += ((n - bs[i]) * bs[i]) * b
		
	b <<= 1
	
print(r % m)


Fixed submission:
n  = int(input())
m  = 10 ** 9 + 7
xs = [int(x) for x in input().split()]
bs = [0] * 60
b  = 1

for x in xs:
	e = 0
	
	while 0 < x:
		if x % 2 == 1:
			bs[e] += 1
			
		e  += 1
		x //= 2

b = 1
r = 0

for i in range(0, 60):
	r  += ((n - bs[i]) * bs[i]) * b
	b <<= 1
	
print(r % m)

Buggy python submission (verdict: Time Limit Exceeded):
n  = int(input())
m  = 10 ** 9 + 7
xs = [int(x) for x in input().split()]
bs = [0] * 61
b  = 1

for i in range(0, 61):
	c = 0
	
	for x in xs:
		if (x & b) != 0:
			c += 1
	
	bs[i] = c
	b   <<= 1

b = 1
r = 0

for i in range(0, 61):
	if 0 < bs[i] and bs[i] < n:
		r += ((n - bs[i]) * bs[i]) * b
		
	b <<= 1
	
print(r % m)


Fixed submission:
n  = int(input())
m  = 10 ** 9 + 7
xs = [int(x) for x in input().split()]
bs = [0] * 60
b  = 1

for x in xs:
	e = 0
	
	while 0 < x:
		if x % 2 == 1:
			bs[e] += 1
			
		e  += 1
		x //= 2

b = 1
r = 0

for i in range(0, 60):
	r  += ((n - bs[i]) * bs[i]) * b
	b <<= 1
	
print(r % m)

Buggy python submission (verdict: Time Limit Exceeded):
n  = int(input())
m  = 10 ** 9 + 7
l  = 2 ** 64
xs = [int(x) % l for x in input().split()]
r  = 0

for i in range(0, n - 1):
	for j in range(i + 1, n):
		r = (r + (xs[i] ^ xs[j])) % m

print(r)


Fixed submission:
n  = int(input())
m  = 10 ** 9 + 7
xs = [int(x) for x in input().split()]
bs = [0] * 60
b  = 1

for x in xs:
	e = 0
	
	while 0 < x:
		if x % 2 == 1:
			bs[e] += 1
			
		e  += 1
		x //= 2

b = 1
r = 0

for i in range(0, 60):
	r  += ((n - bs[i]) * bs[i]) * b
	b <<= 1
	
print(r % m)
Buggy python submission (verdict: Time Limit Exceeded):
import math
 
def gcd(x, y):
	while y != 0:
		z = x % y
		x = y
		y = z
	return x
 
a, b = map(int, input().split())
x    = gcd(a, b)
y    = x // 2 + 1
ds   = [1]

if x % 2 == 0:
	ds.append(2)

for i in range(3, y + 1, 2):
	if x % i == 0:
		ds.append(i)

if 2 < x:
	ds.append(x)

fs = [True] * len(ds)

for i in range(1, len(fs)):
	if fs[i] == False:
		continue;
	for j in range(i + 1, len(fs)):
		if ds[j] % ds[i] == 0:
			fs[j] = False

print(sum(1 for f in fs if f == True))


Fixed submission:
import math
 
def gcd(x, y):
	while y != 0:
		z = x % y
		x = y
		y = z
	return x
 
a, b = map(int, input().split())
x    = gcd(a, b)
y    = int(math.sqrt(x))
c    = 1

for i in range(2, y + 1):
	if y < i:
		break;
	if x % i == 0:
		c += 1
		while x % i == 0:
			x //= i
			
if 1 < x:
	c += 1

print(c)

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

a, b = map(int, input().split())
x    = math.gcd(a, b)
y    = int(math.sqrt(x))
ps   = [1, 2, 3, 5, 7, 11, 13]
p    = ps[-1]

def check(p):
	q = int(math.sqrt(p))
	
	for i in range(2, len(ps)):
		if p % ps[i] == 0:
			return False
		if q < ps[i]:
			break
	
	return True

while p <= y:
	p += 2
	while check(p) == False:
		p += 2
	ps.append(p)

print(sum(1 for p in ps if x % p == 0))


Fixed submission:
import math
 
def gcd(x, y):
	while y != 0:
		z = x % y
		x = y
		y = z
	return x
 
a, b = map(int, input().split())
x    = gcd(a, b)
y    = int(math.sqrt(x))
c    = 1

for i in range(2, y + 1):
	if y < i:
		break;
	if x % i == 0:
		c += 1
		while x % i == 0:
			x //= i
			
if 1 < x:
	c += 1

print(c)
Buggy python submission (verdict: Time Limit Exceeded):
def calc(n, k, x):
    c = 0

    while x <= n:
        y = z = x

        while 0 < y:
            z = y

            while 0 < z:
                if x == y and y == z:
                    c += 1
                elif x == y or y == z:
                    c += 3
                else:
                    c += 6

                z -= k

            y -= k

        x += k

    return c

n, k = map(int, input().split())

if k % 2 == 0:
    print(calc(n, k, k) + calc(n, k, k // 2))
else:
    print(calc(n, k, k))

Fixed submission:
def calc(n, k, x):
    c = 0

    while x <= n:
        a  = (x - 1) // k
        c += 1 + 6 * (1 + a) * a // 2
        x += k

    return c

n, k = map(int, input().split())

if k % 2 == 0:
    print(calc(n, k, k) + calc(n, k, k // 2))
else:
    print(calc(n, k, k))
Buggy python submission (verdict: Runtime Error):
n = int(input())
c = 0

for x in range(2, n // 2 + 1)
  if n % x == 0:
    c += 1

print(c)

Fixed submission:
n = int(input())
c = 0

for x in range(1, n + 1, 2):
    if sum(1 for y in range(1, x // 2) if x % y == 0) == 7:
        c += 1

print(c)
Buggy python submission (verdict: Runtime Error):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

res, height = 0, 100001
for i in range(N) :
    if height > abs(A - tmp) :
        height = abs(A - tmp)
        res = i + 1

print(res)

Fixed submission:
N = int(input())
T, A = list(map(int, input().split()))
H = list(map(int, input().split()))

res, height = 0, 100001
for i in range(N) :
    tmp = T - H[i] * 0.006
    if height > abs(A - tmp) :
        height = abs(A - tmp)
        res = i + 1

print(res)
Buggy python submission (verdict: Runtime Error):
import sys, os
import collections

MOD = 10 ** 9 + 7

def solve(input_stream):
  pass

def read_ints(input_stream):
  return [i for i in map(int, input_stream.readline().strip().split())]

def read_int(input_stream):
  return int(input_stream.readline().strip())


if __name__ == "__main__":
    outputs = solve(sys.stdin)
    for line in outputs:
      print(line)

Fixed submission:
import sys, os
import collections

MOD = 10 ** 9 + 7

def solve(input_stream):
  table = {
    "SUN": 7,
    "MON": 6,
    "TUE": 5,
    "WED": 4,
    "THU": 3,
    "FRI": 2,
    "SAT": 1
  }

  target = input_stream.readline().strip()
  return [str(table[target])]

def read_ints(input_stream):
  return [i for i in map(int, input_stream.readline().strip().split())]

def read_int(input_stream):
  return int(input_stream.readline().strip())


if __name__ == "__main__":
    outputs = solve(sys.stdin)
    for line in outputs:
      print(line)
Buggy python submission (verdict: Time Limit Exceeded):

import sys
from operator import attrgetter

def main():
    N,M = [int(i) for i in sys.stdin.readline().strip().split()]
    works = [[] for i in range(10**5+1)]
    ans = 0
    for i in range(N):
        A,B = [int(i) for i in sys.stdin.readline().strip().split()]
        works[A].append(B)
    
    avaiable_works = []
    for i in range(M+1):
        avaiable_works.extend(works[i])
        if len(avaiable_works) > 0:
            revenue = max(avaiable_works)
        else:
            continue
        ans += revenue
        avaiable_works.remove(revenue)
    
    print("%d" % ans)



def solve(N, M, works):
    ans = 0

    return 0



if __name__ == "__main__":
    main()

Fixed submission:

import sys
from operator import attrgetter
import heapq

def main():
    N,M = [int(i) for i in sys.stdin.readline().strip().split()]
    works = [[] for i in range(10**5+1)]
    ans = 0
    for i in range(N):
        A,B = [int(i) for i in sys.stdin.readline().strip().split()]
        heapq.heappush(works[A], -B)
    
    avaiable_works = []
    for i in range(1, M+1):
        for item in works[i]:
            heapq.heappush(avaiable_works, item)
        if len(avaiable_works) > 0:
            revenue = abs(heapq.heappop(avaiable_works))
        else:
            continue
        ans += revenue
    
    print("%d" % ans)

def solve(N, M, works):
    ans = 0

    return 0

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import sys, os
import collections

def solve(input_stream):
  table = {
    "A": "T",
    "T": "A",
    "C": "G",
    "G": "C"
  }
  ans = ""
  for i in input_stream.readline():
    ans += table[i]
  return [ans]

if __name__ == "__main__":
    outputs = solve(sys.stdin)
    for line in outputs:
      print(line)

Fixed submission:
import sys, os
import collections

def solve(input_stream):
  table = {
    "A": "T",
    "T": "A",
    "C": "G",
    "G": "C"
  }
  ans = ""
  for i in input_stream.readline().strip():
    ans += table[i]
  return [ans]

if __name__ == "__main__":
    outputs = solve(sys.stdin)
    for line in outputs:
      print(line)
Buggy python submission (verdict: Runtime Error):
import sys
from datetime import datetime

def main():
    line = sys.stdin.readline()
    today = datetime.strptime(line, "%Y/%m/%d")
    TBD = datetime(2019, 5, 1)
    if today < TBD:
        print("HEISEI")
    else:
        print("TBD")

if __name__ == "__main__":
    main()

Fixed submission:
import sys
from datetime import datetime

def main():
    line = sys.stdin.readline().strip()
    today = datetime.strptime(line, "%Y/%m/%d")
    TBD = datetime(2019, 5, 1)
    if today < TBD:
        print("Heisei")
    else:
        print("TBD")

if __name__ == "__main__":
    main()

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

def main():
    line = sys.stdin.readline()
    today = datetime.strptime(line, "%Y/%m/%d")
    TBD = datetime(2019, 5, 1)
    if today < TBD:
        print("HEISEI")
    else:
        print("TBD")
if __name__ == "__main__":
    main()

Fixed submission:
import sys
from datetime import datetime

def main():
    line = sys.stdin.readline().strip()
    today = datetime.strptime(line, "%Y/%m/%d")
    TBD = datetime(2019, 5, 1)
    if today < TBD:
        print("Heisei")
    else:
        print("TBD")

if __name__ == "__main__":
    main()

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

def main():
    line_num = 0
    for line in sys.stdin.readlines():
        today = datetime.strptime(line, "%Y/%m/%d")
        TBD = datetime(2019, 5, 1)
        if today < TBD:
            print("HEISEI")
        else:
            print("TBD")
if __name__ == "__main__":
    main()

Fixed submission:
import sys
from datetime import datetime

def main():
    line = sys.stdin.readline().strip()
    today = datetime.strptime(line, "%Y/%m/%d")
    TBD = datetime(2019, 5, 1)
    if today < TBD:
        print("Heisei")
    else:
        print("TBD")

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import sys
 
def main():
	x = sys.stdin.read()
    if x == 7 or x == 5 or x == 3:
        print("YES")
    else:
        print("NO")
 
if __name__ == "__main__":
    main()

Fixed submission:
import sys
 
def main():
    x = int(sys.stdin.readline().strip())
    
    if x == 7 or x == 5 or x == 3:
        print("YES")
    else:
        print("NO")
 
if __name__ == "__main__":
    main()

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

def main():
	x = sys.stdin.read()
    if x == 7 or x == 5 or x == 3:
      print("YES")
    else:
      print("NO")

if __name__ == "__main__":
  main()

Fixed submission:
import sys
 
def main():
    x = int(sys.stdin.readline().strip())
    
    if x == 7 or x == 5 or x == 3:
        print("YES")
    else:
        print("NO")
 
if __name__ == "__main__":
    main()