Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import numpy as np
n, m, q = input().split()
n, m, q = int(n), int(m), int(q)
s = np.zeros((501, 501))

for _ in range(m):
    l, r = input().split()
    l, r = int(l), int(r)
    s[l, r] += 1
    
"""
     1 2 3
    --------
1 | 1 2 3
2 | 1 0 1
"""
    
for i in range(1, n+1):
    for j in range(1, n+1):
        s[i, j] += s[i, j-1]
        
"""
     1 2 3
    --------
1 | 1 3 6
2 | 1 1 2
"""
        
for j in range(1, n+1):
    for i in range(1, n+1):
        s[i, j] += s[i-1, j]
        
"""
     1 2 3
    --------
1 | 1 3 6
2 | 2 4 8
"""

for _ in range(q):
    l, r = input().split()
    l, r = int(l), int(r)
    print(int(s[r, r] - s[r, l-1] - s[l-1, r] + s[l-1, l-1]))

Fixed submission:
import numpy as np
n, m, q = input().split()
n, m, q = int(n), int(m), int(q)
s = np.zeros((501, 501))
 
for _ in range(m):
    l, r = input().split()
    l, r = int(l), int(r)
    s[l, r] += 1
    
"""
     1 2 3
    --------
1 | 1 2 3
2 | 1 0 1
"""
    
for i in range(1, n+1):
    for j in range(1, n+1):
        s[i, j] += s[i, j-1]
        
"""
     1 2 3
    --------
1 | 1 3 6
2 | 1 1 2
"""
        
for j in range(1, n+1):
    for i in range(1, n+1):
        s[i, j] += s[i-1, j]
        
"""
     1 2 3
    --------
1 | 1 3 6
2 | 2 4 8
"""
 
for _ in range(q):
    l, r = input().split()
    l, r = int(l), int(r)
    print(int(s[r, r] - s[r, l-1] - s[l-1, r] + s[l-1, l-1]))
Buggy python submission (verdict: Runtime Error):
R = int(input())

if R >= 2800:
    peint("AGC")
elif R >= 1200:
    print("ARC")
else:
    print("ABC")

Fixed submission:
R = int(input())

if R >= 2800:
    print("AGC")
elif R >= 1200:
    print("ARC")
else:
    print("ABC")

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

if R >= 2800:
    peint("AGC")
elif R >= 1200:
    print("ARC")
else:
    print("ABC")

Fixed submission:
R = int(input())

if R >= 2800:
    print("AGC")
elif R >= 1200:
    print("ARC")
else:
    print("ABC")
Buggy python submission (verdict: Time Limit Exceeded):
N = input()
N = int(N)

for i in range(1,1000000000):
    if i%2 == 0 and i%N == 0:
        number = i
        print(number)
        break

Fixed submission:
N = input()
N = int(N)

if N%2 == 0:
    print(N)
else:
    N = N*2
    print(N)
Buggy python submission (verdict: Runtime Error):
A,B,C,D = map(int, input().split())

AB = abs(A-B)
BC = abs(B-C)
ans = 0

if AB <= D and BC <= D or AC <= D:
    ans = "Yes"
else:
    ans = "No"
        
print(ans)
    

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

AB = abs(A-B)
BC = abs(B-C)
AC = abs(A-C) 
ans = 0

if AB <= D and BC <= D or AC <= D:
    ans = "Yes"
else:
    ans = "No"
        
print(ans)

Buggy python submission (verdict: Runtime Error):
A,B,C,D = map(int, input().split())

AB = abs(A-B)
BC = abs(B-C)
ans = 0

if AB <= D and BC <= D or AC <= D:
    ans = "Yes"
else:
        ans = "No"
        
print(ans)

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

AB = abs(A-B)
BC = abs(B-C)
AC = abs(A-C) 
ans = 0

if AB <= D and BC <= D or AC <= D:
    ans = "Yes"
else:
    ans = "No"
        
print(ans)
Buggy python submission (verdict: Runtime Error):
X = input()
X = int(X)
num=0

for i in range(X):
    i = int(i)
    num = i*i 
    if num > X:
        if ans < i:
            ans = i
print(ans) 

Fixed submission:

n=int(input())
ans=1
for i in range(1,32):
  for j in range(2,10):
    if i**j <=n and i**j >ans:
      ans=i**j
print(ans)
Buggy python submission (verdict: Runtime Error):
from sys import setrecursionlimit
import numpy as np


setrecursionlimit(10**6)

N, M = tuple(map(int, input().split()))
Ls = np.zeros((M,), dtype=int)
Rs = np.zeros((M,), dtype=int)
Ds = np.zeros((M,), dtype=int)

for i in range(M):
    Ls[i], Rs[i], Ds[i] = tuple(map(int, input().split()))

Ls = Ls - 1
Rs = Rs - 1

adjacency_list = []
for i in range(N):
    adjacency_list.append([])

for i in range(M):
    adjacency_list[Ls[i]].append((Rs[i], Ds[i]))
    adjacency_list[Rs[i]].append((Ls[i], -Ds[i]))

visited = np.zeros(N, dtype=bool)
weights = np.zeros(N, dtype=int)
to_be_visited = []


def DFS(node_index):
    global adjacency_list, visited, weights, to_be_visited
    adjacent_node_information = adjacency_list[node_index]
    for adjacent_node_index, adjacent_edge_weight in adjacent_node_information:
        if not visited[adjacent_node_index]:
            visited[adjacent_node_index] = True
            to_be_visited.append(adjacent_node_index)
            weights[adjacent_node_index] = weights[node_index] + adjacent_edge_weight

    if len(to_be_visited) == 0:
        return 0
    else:
        DFS(to_be_visited.pop())

pointer = 0
for pointer in range(N):
    if not visited[pointer]:
        to_be_visited.append(pointer)
        DFS(pointer)

for i in range(M):
    if weights[Rs[i]] - weights[Ls[i]] != Ds[i]:
        print("No")
        exit()

print("Yes")

Fixed submission:
X = int(input())
A = int(input())
B = int(input())
count = (X - A) // B

print(X - A - B * count)
Buggy python submission (verdict: Runtime Error):
import numpy as np

N = int(input())
upper = tuple(map(int,input().split()))
lower = tuple(map(int,input().split()))
upper_sum = np.cumsum(upper)
lower_sum = np.cumsum(np.flip(lower, 0))

s = np.zeros((N,), dtype=np.int32)

for i in range(N):
    s[i] = lower_sum[-1-i] + upper_sum[i]
print(np.max(s))



Fixed submission:
import numpy as np

N = int(input())
upper = tuple(map(int, input().split()))
lower = tuple(map(int, input().split()))
upper_sum = np.cumsum(upper)
lower_sum = np.cumsum(np.flipud(lower))

s = np.zeros((N,), dtype=np.int32)

for i in range(N):
    s[i] = lower_sum[-1 - i] + upper_sum[i]
print(np.max(s))

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

N = int(input())
upper = tuple(map(int,input().split()))
lower = tuple(map(int,input().split()))
upper_sum = np.cumsum(upper)
lower_sum = np.cumsum(np.flip(lower, 0))

s = np.zeros((N,), dtype=np.int32)

for i in range(N):
    s[i] = lower_sum[-1-i] + upper_sum[i]
print(np.max(s))


Fixed submission:
import numpy as np

N = int(input())
upper = tuple(map(int, input().split()))
lower = tuple(map(int, input().split()))
upper_sum = np.cumsum(upper)
lower_sum = np.cumsum(np.flipud(lower))

s = np.zeros((N,), dtype=np.int32)

for i in range(N):
    s[i] = lower_sum[-1 - i] + upper_sum[i]
print(np.max(s))

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

N = int(input())
upper = tuple(map(int,input().split()))
lower = tuple(map(int,input().split()))
upper_sum = np.cumsum(upper)
lower_sum = np.cumsum(np.flip(lower, 0))

s = np.zeros((N,), dtype=np.int32)

for i in range(N):
    s[i] = lower_sum[-1-i] + upper_sum[i]
print(np.max(s))

Fixed submission:
import numpy as np

N = int(input())
upper = tuple(map(int, input().split()))
lower = tuple(map(int, input().split()))
upper_sum = np.cumsum(upper)
lower_sum = np.cumsum(np.flipud(lower))

s = np.zeros((N,), dtype=np.int32)

for i in range(N):
    s[i] = lower_sum[-1 - i] + upper_sum[i]
print(np.max(s))
Buggy python submission (verdict: Runtime Error):
N, M = input().split()
A=[]
for i in range(0,N):
    A.append(input())
B=[]
for j in range(0,M):
    B.append(input())

ref_tuple = zip(range(0,N-M+1),range(0,N-M+1))
t=False
for ref_row_a, ref_col_a in ref_tuple:
    for row_b, col_b in zip(range(0,M),range(0,M)):
        if not A[ref_row_a+row_b][ref_col_a+col_b]==B[row_b][col_b]:
            break
        if (row_b, col_b)==(M-1,M-1):
            t=True
            break
    if t:
        break

if t:
    print('Yes')
else:
    print('No')



Fixed submission:
import itertools

_N, _M = input().split()
N=int(_N)
M=int(_M)
A=[]
for i in range(0,N):
    A.append(input())
B=[]
for j in range(0,M):
    B.append(input())

ref_tuple = itertools.product(range(0,N-M+1),range(0,N-M+1))
t=False
for ref_row_a, ref_col_a in ref_tuple:
    for row_b, col_b in itertools.product(range(0,M),range(0,M)):
        if not A[ref_row_a+row_b][ref_col_a+col_b]==B[row_b][col_b]:
            break
        if (row_b, col_b)==(M-1,M-1):
            t=True
            break
    if t:
        break

if t:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def main():
    c = tuple(tuple(map(int, line.split())) for line in sys.stdin.readlines())
    for i in range(101):
        b = [c[0][0] - i]
        for j in range(101):
            b.append(c[1][1] - j)
            for k in range(101):
                b.append(c[2][2] - k)
                a = (i, j, k)
                flg = False
                for l in range(3):
                    for m in range(3):
                        if a[l] + b[m] != c[l][m]:
                            flg = True
                            break
                    if flg == True:
                        break
                else:
                    print('Yes')
                    sys.exit()
    else:
        print('No')

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def main():
    n = int(input())
    a = int(input())
    if (n % 500) > a:
        print('No')
    else:
        print('Yes')

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def main():
    c = tuple(tuple(map(int, line.split())) for line in sys.stdin.readlines())
    for i in range(-100, 101):
        b = [c[0][0] - i]
        for j in range(-100, 101):
            b.append(c[1][1] - j)
            for k in range(-100, 101):
                b.append(c[2][2] - k)
                a = (i, j, k)
                flg = False
                for l in range(3):
                    for m in range(3):
                        if l != m and a[l] + b[m] != c[l][m]:
                            flg = True
                            break
                    if flg == True:
                        break
                else:
                    print('Yes')
                    sys.exit()
    else:
        print('No')

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def main():
    c = tuple(tuple(map(int, line.split())) for line in sys.stdin.readlines())
    csum = sum((sum(ci) for ci in c))
    trace = sum((cij for i, ci in enumerate(c) for j, cij in enumerate(ci) if i == j))
    if csum == 3 * trace:
        print('Yes')
    else:
        print('No')
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-

def main():
    n = int(input())
    a = tuple(tuple(e for e in map(int, input().split())) for _ in range(2))
    dp = [[None] * n for _ in range(2)]
    dp[0][0] = 0
    for i in range(2):
        for j in range(n):
            if i == 0:
                dp[0][j] = dp[0][max(0, j - 1)] + a[0][j]
            else:
                dp[1][j] = max(dp[0][j], dp[1][max(0, j - 1)]) + a[1][j]
    print(dp[1][n - 1])

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

def main():
    n = int(input())
    a = tuple(tuple(e for e in map(int, input().split())) for _ in range(2))
    dp = [[None] * n] * 2
    dp[0][0] = 0
    for i in range(2):
        for j in range(n):
            if i == 0:
                dp[0][j] = dp[0][max(0, j - 1)] + a[0][j]
            else:
                dp[1][j] = max(dp[0][j], dp[1][max(0, j - 1)]) + a[1][j]
    print(dp[1][n - 1])

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

k = 0
l = 0
acc = None

def count_up(y1, x1, y2, x2):
    global acc, l
    if y1 > y2 or x1 > x2:
        return 0
    y2 += 1
    x2 += 1
    return  acc[y2][x2] - acc[y1][x2] - acc[y2][x1] + acc[y1][x1]

def main():
    global acc, k, l
    n, k = map(int, sys.stdin.readline().split())
    xycs = (map(lambda x: int(x) if x != 'B' and x != 'W' else x,
                 line.split()) for line in sys.stdin.readlines())

    l = k * 2
    yxs = (((y + k) % l, x % l) if c == 'W' else (y % l, x % l) for x, y, c in xycs)

    acc = [[0] * (l + 1) for _ in range(l + 1)]
    for y, x in yxs:
        acc[y + 1][x + 1] += 1
    for j in range(l):
        for i in range(l):
            acc[j + 1][i + 1] += acc[j + 1][i] + acc[j][i + 1] - acc[j][i]

    max_cnt = 0
    for j in range(k):
        for i in range(k):
            cnt = count_up(0, 0, j - 1, i - 1) + count_up(0, i + k, j - 1, l - 1) + count_up(j, i, j + k - 1, i + k - 1) + count_up(j + k, 0, l - 1, i - 1) + count_up(j + k, i + k, l - 1, l - 1)
            max_cnt = max(max_cnt, max(n - cnt, cnt))

    print(max_cnt)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

k = 0
l = 0
acc = None

def count_up(y1, x1, y2, x2):
    global acc, l
    if y1 > y2 or x1 > x2:
        return 0
    y2 += 1
    x2 += 1
    return  acc[y2][x2] - acc[y1][x2] - acc[y2][x1] + acc[y1][x1]

def main():
    global acc, k, l
    n, k = map(int, sys.stdin.readline().split())
    xycs = (map(lambda x: int(x) if x != 'B' and x != 'W' else x,
                 line.split()) for line in sys.stdin.readlines())

    l = k * 2
    yxs = (((y + k) % l, x % l) if c == 'W' else (y % l, x % l) for x, y, c in xycs)

    acc = [[0] * (l + 1) for _ in range(l + 1)]
    for y, x in yxs:
        acc[y + 1][x + 1] += 1
    for j in range(l):
        for i in range(l):
            acc[j + 1][i + 1] += acc[j + 1][i] + acc[j][i + 1] - acc[j][i]

    max_cnt = 0
    for j in range(k):
        for i in range(k):
            cnt = count_up(0, 0, j - 1, i - 1) + count_up(0, i + k, j - 1, l - 1) + count_up(j, i, j + k - 1, i + k - 1) + count_up(j + k, 0, l - 1, i - 1) + count_up(j + k, i + k, l - 1, l - 1)
            max_cnt = max(max_cnt, max(n - cnt, cnt))

    print(max_cnt)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def main():
    n, y = map(int, sys.stdin.readline().split())

    for i in range(y // 10000):
        for j in range((y - 10000 * i) // 5000):
            if 10000 * i + 5000 * j + 1000 * (n - i - j) == y:
                print(i, j, k)
                sys.exit()
    else:
        print('-1 -1 -1')

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def main():
    n, y = map(int, sys.stdin.readline().split())

    for i in range(y // 10000 + 1):
        for j in range((y - 10000 * i) // 5000 + 1):
            k = n - i - j
            if 10000 * i + 5000 * j + 1000 * k == y:
                print(i, j, k)
                sys.exit()
    else:
        print('-1 -1 -1')

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def main():
    n, y = map(int, sys.stdin.readline().split())

    for i in range(y // 10000):
        for j in range((y - 10000 * i) // 5000):
            if 10000 * i + 5000 * j + 1000 * (n - i - j) == y:
                print(i, j, k)
    else:
        print('-1 -1 -1')

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def main():
    n, y = map(int, sys.stdin.readline().split())

    for i in range(y // 10000 + 1):
        for j in range((y - 10000 * i) // 5000 + 1):
            k = n - i - j
            if 10000 * i + 5000 * j + 1000 * k == y:
                print(i, j, k)
                sys.exit()
    else:
        print('-1 -1 -1')

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def out(i, j, k):
    print(i, j, k)
    print(10000 * i + 5000 * j + 1000 * k)
    sys.exit()

def main():
    n, y = map(int, sys.stdin.readline().split())

    for i in range(y // 10000, -1, -1):
        z = y - 10000 * i
        if i != n:
            continue
        elif z == 0:
            out(i, 0, 0)
        for j in range(z // 5000, -1, -1):
            w = z - 5000 * j
            if i + j != n:
                continue
            elif w == 0:
                out(i, j, 0)
            k = n - i - k
            if w == 1000 * k:
                out(i, j, k)
    else:
        out(-1, -1, -1)


if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def main():
    n, y = map(int, sys.stdin.readline().split())

    for i in range(y // 10000 + 1):
        for j in range((y - 10000 * i) // 5000 + 1):
            k = n - i - j
            if 10000 * i + 5000 * j + 1000 * k == y:
                print(i, j, k)
                sys.exit()
    else:
        print('-1 -1 -1')

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
s = list(input())
k = int(input())
o = 0

while s[0] == "1":
    del s[0]
    o += 1

if o >= k:
    print("1")
else:
    print(s[0])

Fixed submission:
s = list(input())
k = int(input())
o = 0

while s[0] == "1" and len(s) >= 2:
    del s[0]
    o += 1

if o >= k:
    print("1")
else:
    print(s[0])
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a == b:
    print("Yay!")
else:
    print(":(")

Fixed submission:
a,b = map(int,input().split())
if a <= 8 and b <= 8:
    print("Yay!")
else:
    print(":(")

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a == b:
    print("Yay!")
else:
    print(":(")

Fixed submission:
a,b = map(int,input().split())
if a <= 8 and b <= 8:
    print("Yay!")
else:
    print(":(")
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
print(max(a-b,a+b,a*B))

Fixed submission:
a,b = map(int,input().split())
print(max(a-b,a+b,a*b))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(input())
X = 100000000
for i in range(N):
    x = (P[:i].count("W")+P[i+1:].count("E"))
    if x < X:
        X = x
print(X)

Fixed submission:
N = int(input())
P = list(input())
X = P[1:].count("E")
a = [X]
for i in range(N-1):
    if P[i] == "W":
        X += 1
    if P[i+1] == "E":
        X -= 1
    a.append(X)

print(min(a))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(input())
X = []
for i in range(N):
    X.append(P[:i].count("W")+P[i+1:].count("E"))
print(min(X))

Fixed submission:
N = int(input())
P = list(input())
X = P[1:].count("E")
a = [X]
for i in range(N-1):
    if P[i] == "W":
        X += 1
    if P[i+1] == "E":
        X -= 1
    a.append(X)

print(min(a))
Buggy python submission (verdict: Runtime Error):
a,b = int(input().split())
if a *b%2 == 0:
    print("Even")
else:
    print("Odd")

Fixed submission:
a,b = map(int,input().split())
if a*b%2 == 0:
    print("Even")
else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
if int(input())＊int(input())%2 == 0:
    print("Even")
else:
    print("Odd")

Fixed submission:
a,b = map(int,input().split())
if a*b%2 == 0:
    print("Even")
else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
if int(input())*int(input())%2 == 0:
    print("Even")
else:
    print("Odd")

Fixed submission:
a,b = map(int,input().split())
if a*b%2 == 0:
    print("Even")
else:
    print("Odd")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
C = []
S = []
F = []

for _ in range(n-1):
    c,s,f = map(int,input().split())
    C.append(c)
    S.append(s)
    F.append(f)

for i in range(n-1):
    time = 0
    while i != n-1:
        if i == 0:
            time += S[i]
        elif S[i] <= time and time%F[i] == 0:
            time += 0
        else:
            train = S[i]
            while time >= train:
                train += F[i]
            time = train
        time += C[i]
        i += 1        
    print(time)

print(0)


Fixed submission:
n = int(input())
C = []
S = []
F = []

for _ in range(n-1):
    c,s,f = map(int,input().split())
    C.append(c)
    S.append(s)
    F.append(f)

for i in range(n-1):
    time = 0
    while i != n-1:
        if i == 0:
            time += S[i]
        elif S[i] <= time and time%F[i] == 0:
            time += 0
        else:
            if time > S[i]:
                r = (time-S[i])//F[i]
                time = S[i] + F[i]*(r + 1)
            else:
                time = S[i]
        time += C[i]
        i += 1        
    print(time)

print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
C = []
S = []
F = []

for _ in range(n-1):
    c,s,f = map(int,input().split())
    C.append(c)
    S.append(s)
    F.append(f)

for i in range(n-1):
    time = 0
    while i != n-1:
        if i == 0:
            time += S[i]
        else:
            train = S[i]
            while time > train:
                train += F[i]
            time = train
        time += C[i]
        i += 1        
    print(time)

print(0)


Fixed submission:
n = int(input())
C = []
S = []
F = []

for _ in range(n-1):
    c,s,f = map(int,input().split())
    C.append(c)
    S.append(s)
    F.append(f)

for i in range(n-1):
    time = 0
    while i != n-1:
        if i == 0:
            time += S[i]
        elif S[i] <= time and time%F[i] == 0:
            time += 0
        else:
            if time > S[i]:
                r = (time-S[i])//F[i]
                time = S[i] + F[i]*(r + 1)
            else:
                time = S[i]
        time += C[i]
        i += 1        
    print(time)

print(0)
Buggy python submission (verdict: Runtime Error):
import collections
import sys
l = int(input())
inputs = [int(j) for j in input().split(' ')]
cs = collections.Counter(inputs)
if l % 2 == 0:
  for v,c in cs.items():
    if v % 2 == 0 or c != 2:
      print(0)
      sys.exit()
else:
  for v,c in cs.items():
    if v % 2 != 0 or (c != 2 and v != 0):
      print(0)
      sys.exit()
print(2**int(l/2)%(1e9+7))


Fixed submission:
import collections
import sys
l = int(input())
inputs = [int(j) for j in input().split(' ')]
cs = collections.Counter(inputs)
if l % 2 == 0:
  for v,c in cs.items():
    if v % 2 == 0 or c != 2:
      print(0)
      sys.exit()
else:
  for v,c in cs.items():
    if v % 2 != 0 or (c != 2 and v != 0):
      print(0)
      sys.exit()
print(2**int(l/2)%(10**9+7))
Buggy python submission (verdict: Runtime Error):
l = input.split()
if l.count('5')==2 and '7' in l:
  print('YES')
else:
  print('NO')

Fixed submission:
l = input().split()
if l.count('5')==2 and '7' in l:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())

numList = []

for _ in range(N):
    a, b = map(int, input().split())

    for _ in range(b):
        numList.append(a)

numList.sort()

print(numList[K-1])

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

numList = []
for _ in range(N):
    numList.append(list(map(int, input().split())))

numList.sort(key=lambda x:x[0])

idx = 0
while True:
    K = K - numList[idx][1]
    if K <= 0:
        print(numList[idx][0])
        exit()
    idx = idx + 1