Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
cost = []
key = []
inf = int(1e9)
for i in range(m):
    a,b = map(int,input().split())
    c = list(map(int,input().split()))
    cost.append(a)
    cnt = 0
    for j in range(1,n+1):
        if j in c:
           cnt += 2**(n-j)
    key.append(bin(cnt))
dp = [inf]*(2**n)
for i in range(m):
    dp[int(key[i],0)] = min(cost[i],dp[int(key[i],0)])
for i in range(2**n):
    if dp[i] != inf:
        for j in range(m):
            tar = int(key[j], 0) | i
            dp[tar] = min(dp[tar], dp[i] + cost[j])
if dp[-1] == inf:
    print(-1)
else:
    print(dp[-1])





Fixed submission:
n,m = map(int,input().split())
cost = []
key = []
inf = int(1e9)
for i in range(m):
    a,b = map(int,input().split())
    c = list(map(int,input().split()))
    cost.append(a)
    cnt = 0
    for j in range(1,n+1):
        if j in c:
           cnt += 2**(n-j)
    key.append(bin(cnt))
dp = [inf]*(2**n)
for i in range(m):
    dp[int(key[i],0)] = min(cost[i],dp[int(key[i],0)])
for i in range(2**n):
    if dp[i] != inf:
        for j in range(m):
            k = int(key[j], 0)
            tar = k | i
            dp[tar] = min(dp[tar], dp[i] + cost[j])
if dp[-1] == inf:
    print(-1)
else:
    print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
cost = []
key = []
inf = int(1e9)
for i in range(m):
    a,b = map(int,input().split())
    c = list(map(int,input().split()))
    cost.append(a)
    cnt = 0
    for j in range(1,n+1):
        if j in c:
           cnt += 2**(n-j)
    key.append(bin(cnt))
dp = [inf]*(2**n)
for i in range(m):
    dp[int(key[i],0)] = min(cost[i],dp[int(key[i],0)])
for i in range(2**n):
    if dp[i] != inf:
        for j in range(m):
            k = int(key[j], 0)
            tar = k | i
            dp[tar] = min(dp[tar], dp[i] + cost[j])
if dp[-1] == inf:
    print(-1)
else:
    print(dp[-1])





Fixed submission:
n,m = map(int,input().split())
cost = []
key = []
inf = int(1e9)
for i in range(m):
    a,b = map(int,input().split())
    c = list(map(int,input().split()))
    cost.append(a)
    cnt = 0
    for j in range(1,n+1):
        if j in c:
           cnt += 2**(n-j)
    key.append(bin(cnt))
dp = [inf]*(2**n)
for i in range(m):
    dp[int(key[i],0)] = min(cost[i],dp[int(key[i],0)])
for i in range(2**n):
    if dp[i] != inf:
        for j in range(m):
            k = int(key[j], 0)
            tar = k | i
            dp[tar] = min(dp[tar], dp[i] + cost[j])
if dp[-1] == inf:
    print(-1)
else:
    print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
import numpy
h, w, a, b = map(int,input().split())
s = numpy.zeros([h,w],int)
for i in range(b):
    for j in range(a):
        s[i,j] = 1
for i in range(b, h):
    for j in range(a, w):
        s[i,j] = 1
for i in range(h):
    ans = []
    for j in range(w):
        ans.append(str(s[i,j]))
    print("".join(ans))




Fixed submission:
import numpy
h, w, a, b = map(int,input().split())
s = numpy.zeros([h,w],int)
for i in range(h):
    ans = []
    for j in range(w):
        if i < b and j < a:
            ans.append("1")
        elif i < b and a <= j:
            ans.append("0")
        elif b <= i and j < a:
            ans.append("0")
        else:
            ans.append("1")
    print("".join(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
answerer = []
for i in range(q):
    answerer.append(int(input()))
for i in range(1,n+1):
    count_ans = answerer.count(i)
    last_point = count_ans + k - q
    if last_point > 0:
        print("Yes")
    else:
        print("No")


Fixed submission:
n, k, q = map(int, input().split())
point = [k-q]*n
for i in range(q):
    answerer = int(input())-1
    point[answerer] += 1
for i in range(n):
    if point[i] > 0:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
ini_point = [k] * n
dec_point = [-q] * n
answerer = []
count_ans = []
for i in range(q):
    answerer.append(int(input()))
for i in range(1,n+1):
    count_ans.append(answerer.count(i))
for i in range(n):
    last_point = dec_point[i] + count_ans[i] + ini_point[i]
    if last_point > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
n, k, q = map(int, input().split())
point = [k-q]*n
for i in range(q):
    answerer = int(input())-1
    point[answerer] += 1
for i in range(n):
    if point[i] > 0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int,input().split())
price = list(map(int, input().split()))
price.sort(reverse=True)

while m != 0:
    price[0] //= 2
    for i in range(1,n):
        if price[0] > price[i]:
            price_buf = price[1:i]
            price[i-1] = price[0]
            price[0:i-1] = price_buf
            break
    m -= 1
print(sum(price))


Fixed submission:
import heapq

n, m = map(int,input().split())
price = list(map(int, input().split()))
price = list(map(lambda x: x*(-1), price))
heapq.heapify(price)
while m != 0:
    maxv = heapq.heappop(price)
    heapq.heappush(price, (maxv+1) // 2)
    m -= 1
print(sum(price) * (-1))

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int,input().split())
price = list(map(int, input().split()))
price.sort(reverse=True)

while m != 0:
    price[0] //= 2
    price.sort(reverse=True)
    m -= 1
print(sum(price))


Fixed submission:
import heapq

n, m = map(int,input().split())
price = list(map(int, input().split()))
price = list(map(lambda x: x*(-1), price))
heapq.heapify(price)
while m != 0:
    maxv = heapq.heappop(price)
    heapq.heappush(price, (maxv+1) // 2)
    m -= 1
print(sum(price) * (-1))
Buggy python submission (verdict: Runtime Error):
from math import factorial
n = int(input())
ans_list = []
num_list = []
for i in range(n):
    s = list(input())
    s.sort()
    ans_list.append("".join(s))
ans_list.sort()
count = 1
for i in range(n-1):
    if ans_list[i] == ans_list[i+1]:
        count += 1
    else:
        num_list.append(count)
        count = 1
num_list.append(count)
ans = 0
for i in range(len(num_list)):
    if num_list[i] != 1:
        ans += factorial(num_list[i]) / factorial(2) / factorial(num_list[i]-2)
print(int(ans))


Fixed submission:
from math import factorial
n = int(input())
ans_list = []
num_list = []
for i in range(n):
    s = list(input())
    s.sort()
    ans_list.append("".join(s))
ans_list.sort()
count = 1
for i in range(n-1):
    if ans_list[i] == ans_list[i+1]:
        count += 1
    else:
        num_list.append(count)
        count = 1
num_list.append(count)
ans = 0
for i in range(len(num_list)):
    if num_list[i] != 1:
        ans += factorial(num_list[i]) // factorial(2) // factorial(num_list[i]-2)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n = int(input())
color = [int(input())]
for i in range(1,n):
    num = int(input())
    if min(color) >= num:
        color.append(num)
    else:
        color = sorted(color)
        bis = bisect.bisect_left(color, num)
        color[bis-1] = num
print(len(color))


Fixed submission:
import bisect
from collections import deque
n = int(input())
color = deque([int(input())])
for i in range(1,n):
    num = int(input())
    if color[0] >= num:
        color.appendleft(num)
    else:
        bis = bisect.bisect_left(color, num)
        color[bis-1] = num
print(len(color))
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
stair = []
mod = int(1e9+7)
ans = 1
for i in range(m):
    stair.append(int(input()))
dp = [0] * (n+1)
dp[0] = dp[1] = 1
if 1 in stair:
    dp[1] = 0
if n == 1:
    print(1)
    exit()
for i in range(2, n+1):
    if i in stair:
        dp[i] = 0
    else:
        dp[i] = (dp[i-1] + dp[i-2])%mod
print(dp[-1])





Fixed submission:
n,m = map(int,input().split())
stair = []
mod = int(1e9+7)
ans = 1
for i in range(m):
    stair.append(int(input()))
dp = [0] * (n+1)
dp[0] = dp[1] = 1
stair.append(int(1e10))
if n == 1:
    print(1)
    exit()
k = 0
for i in range(1, n+1):
    if i == stair[k]:
        dp[i] = 0
        k += 1
    elif i == 1:
        dp[1] = 1
    else:
        dp[i] = (dp[i-1] + dp[i-2])%mod
print(dp[-1])
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
coin = [0]*n
for i in range(k-1):
    coin[i] += 1
while k > 1:
    k /= 2
    for i in range(min(int(k),n)):
        coin[i] += 1
ans = 0
for i in range(n):
    ans += (1/2)**coin[i]
print(ans / n)


Fixed submission:
n,k = map(int,input().split())
coin = [0]*n
while k > 1:
    for i in range(min(int(k-1/1e10),n)):
        coin[i] += 1
    k /= 2
ans = 0
for i in range(n):
    ans += 1 / (2**coin[i] * n)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = -1e9
for i in range(2**n):
    conv = str(bin(i))[2:].zfill(n)
    val = 0
    for j in range(n):
        if conv[j] == "1":
            val += v[j] - c[j]
    ans = max(ans, val)
print(ans)


Fixed submission:
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
p = [v[i]-c[i] for i in range(n)]
ans = 0
for i in range(n):
    if p[i] > 0:
        ans += p[i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
tree = [int(input()) for _ in range(n)]
tree.sort()
ans = int(1e15)
for i in range(n-k+1):
    ans = min(max(tree[i:i+k]) - min(tree[i:i+k]), ans)
print(ans)


Fixed submission:
n,k= map(int,input().split())
tree = []
for i in range(n):
    tree.append(int(input()))
tree.sort()
ans = int(1e10)
for i in range(n-k+1):
    a = tree[i+k-1] - tree[i]
    ans = min(ans, a)
print(ans)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
x = list(map(int,input().split()))
x_sei = []
x_hu = []
for i in range(n):
    if x[i] < 0:
        x_hu.append(x[i])
    else:
        x_sei.append(x[i])
x_hu.reverse()
if not x_hu:
    print(x_sei[k-1])
    exit()
if not x_sei:
    print(abs(x_hu[k-1]))
    exit()
cnt = 0
sei_i = 0
hu_i = 0
sei_nax = 0
hu_nax = 0
while sei_i + hu_i != k:
    a = x_sei[sei_i]
    b = x_hu[hu_i]
    if a <= abs(b):
        sei_i += 1
        sei_nax = a
    else:
        hu_i += 1
        hu_nax = b
print(min(sei_nax, abs(hu_nax))*2+max(sei_nax, abs(hu_nax)))



Fixed submission:
n,k = map(int,input().split())
x = list(map(int,input().split()))
l = 0
r = k-1
ans = 0
if x[l] <= 0 and x[r] <= 0:
    ans = abs(x[l])
elif x[l] >= 0 and x[r] >= 0:
    ans = x[r]
else:
    ans = min(abs(x[l]), x[r]) * 2 + max(abs(x[l]), x[r])
for i in range(n-k):
    l += 1
    r += 1
    if x[l] <= 0 and x[r] <= 0:
        ans = min(ans,abs(x[l]))
    elif x[l] >= 0 and x[r] >= 0:
        ans = min(ans, x[r])
    else:
        ans = min(ans, min(abs(x[l]), x[r]) * 2 + max(abs(x[l]), x[r]))

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
bit = [bin(i)[2:].zfill(3) for i in range(2**m)]
ans = -int(1e10)
cake = []
for i in range(n):
    a,b,c = map(int,input().split())
    cake.append((a,b,c))
for i in range(2**m):
    u = []
    cond = bit[i]
    for j in range(n):
        cnt = 0
        for k in range(3):
            if cond[k] == "0":
                cnt += cake[j][k]
            else:
                cnt -= cake[j][k]
        u.append(cnt)
    u.sort(reverse=True)
    ans = max(ans, sum(u[:m]))
print(ans)




Fixed submission:
n,m = map(int,input().split())
bit = [bin(i)[2:].zfill(3) for i in range(2**3)]
ans = -int(1e10)
cake = []
for i in range(n):
    a,b,c = map(int,input().split())
    cake.append((a,b,c))
for i in range(2**3):
    u = []
    cond = bit[i]
    for j in range(n):
        cnt = 0
        for k in range(3):
            if cond[k] == "0":
                cnt += cake[j][k]
            else:
                cnt -= cake[j][k]
        u.append(cnt)
    u.sort(reverse=True)
    ans = max(ans, sum(u[:m]))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
k = int(input())
a =[chr(ord('a') + i) for i in range(26)]

tar = set()
alpha_idx = 0
while len(tar) < k:
    alpha = a[alpha_idx]
    for i in range(len(s)):
        if s[i] == alpha:
            for j in range(i+1, len(s)+1):
                tar.add(s[i:j])
    alpha_idx += 1
tar = list(tar)
tar.sort()
print(tar[k-1])



Fixed submission:
s = input()
k = int(input())
a =[chr(ord('a') + i) for i in range(26)]

tar = set()
alpha_idx = 0
while len(tar) < k:
    alpha = a[alpha_idx]
    for i in range(len(s)):
        if s[i] == alpha:
            for j in range(i+1, min(len(s)+1,i+1+k)):
                tar.add(s[i:j])
    alpha_idx += 1
tar = list(tar)
tar.sort()
print(tar[k-1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [0] * 100000
ans = 0
for i in range(n):
    a[int(input())-1] += 1
for i in range(len(a)):
    if a[i] % 2 == 1:
        ans += 1
print(ans)


Fixed submission:
n = int(input())
ans = 0
d = dict()
for i in range(n):
    a = int(input())
    if a not in d:
        d[a] = 0
    d[a] += 1
da = list(d.values())
for i in range(len(da)):
    if da[i] % 2 == 1:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
ans = 0
for i in range(n):
    if p[i]-1 == i:
        p[i], p[i+1] = p[i+1],p[i]
        ans += 1
print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(n-1):
    if a[i] == i+1:
        a[i], a[i+1] = a[i+1], a[i]
        ans += 1
if a[-1] == n:
    ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(n):
    if a[i] == i+1:
        a[i], a[i+1] = a[i+1], a[i]
        ans += 1
print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(n-1):
    if a[i] == i+1:
        a[i], a[i+1] = a[i+1], a[i]
        ans += 1
if a[-1] == n:
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
import functools
from functools import reduce

def gcd(numbers):
    return reduce(functools.gcd, numbers)

def lcm_base(x, y):
    return x // functools.gcd(x, y) * y

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)


num = []
for i in range(n):
    num.append(int(input()))
print(lcm(num))


Fixed submission:
n = int(input())
def gcd(a,b):
    while b != 0:
        a, b = b, a % b
    return a
# 最小公倍数
def lcm(a,b):
    return a // gcd(a,b) * b

ans = 1
for i in range(n):
    t = int(input())
    ans = lcm(ans,t)
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
import functools
from functools import reduce

def gcd(numbers):
    return reduce(functools.gcd, numbers)

def lcm_base(x, y):
    return x // functools.gcd(x, y) * y

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)


num = []
for i in range(n):
    num.append(int(input()))
print(lcm(num))


Fixed submission:
n = int(input())
def gcd(a,b):
    while b != 0:
        a, b = b, a % b
    return a
# 最小公倍数
def lcm(a,b):
    return a // gcd(a,b) * b

ans = 1
for i in range(n):
    t = int(input())
    ans = lcm(ans,t)
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
import functools
from functools import reduce

def gcd(numbers):
    return reduce(functools.gcd, numbers)

def lcm_base(x, y):
    return x // functools.gcd(x, y) * y

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)


num = []
for i in range(n):
    num.append(int(input()))
print(lcm(num))


Fixed submission:
n = int(input())
def gcd(a,b):
    while b != 0:
        a, b = b, a % b
    return a
# 最小公倍数
def lcm(a,b):
    return a // gcd(a,b) * b

ans = 1
for i in range(n):
    t = int(input())
    ans = lcm(ans,t)
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
import math
from functools import reduce

def gcd(numbers):
    return reduce(math.gcd, numbers)

def lcm_base(x, y):
    return x // math.gcd(x, y) * y

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)


num = []
for i in range(n):
    num.append(int(input()))
print(lcm(num))


Fixed submission:
n = int(input())
def gcd(a,b):
    while b != 0:
        a, b = b, a % b
    return a
# 最小公倍数
def lcm(a,b):
    return a // gcd(a,b) * b

ans = 1
for i in range(n):
    t = int(input())
    ans = lcm(ans,t)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a1 = []
a2 = []
for i in range(n):
    if i % 2 == 0:
        a1.append(a[i])
    else:
        a2.append(a[i])
if n % 2 == 0:
    rev = list(reversed(a2))
    print(*rev, *a1)
else:
    rev = list(reversed(a1))
    print(*rev, *a2)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a1 = []
a2 = []
for i in range(n):
    if i % 2 == 0:
        a1.append(a[i])
    else:
        a2.append(a[i])
if n % 2 == 0:
    a2.reverse()
    print(*a2+a1)
else:
    a1.reverse()
    print(*a1+a2)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a1 = []
a2 = []
for i in range(n):
    if i % 2 == 0:
        a1.append(a[i])
    else:
        a2.append(a[i])
if n % 2 == 0:
    rev = reversed(a2)
    print(*rev, *a1)
else:
    rev = reversed(a1)
    print(*rev, *a2)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a1 = []
a2 = []
for i in range(n):
    if i % 2 == 0:
        a1.append(a[i])
    else:
        a2.append(a[i])
if n % 2 == 0:
    a2.reverse()
    print(*a2+a1)
else:
    a1.reverse()
    print(*a1+a2)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
a1 = []
a2 = []
for i in range(n):
    if i % 2 == 0:
        a1.append(a[i])
    else:
        a2.append(a[i])
if n % 2 == 0:
    rev = reversed(a2)
    print(*rev, *a1)
else:
    rev = reversed(a1)
    print(*rev, *a2)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a1 = []
a2 = []
for i in range(n):
    if i % 2 == 0:
        a1.append(a[i])
    else:
        a2.append(a[i])
if n % 2 == 0:
    a2.reverse()
    print(*a2+a1)
else:
    a1.reverse()
    print(*a1+a2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(input())
leng = []
cnt = 1
for i in range(n-1):
    if s[i] == s[i+1]:
        cnt += 1
    else:
        leng.append([s[i], cnt])
        cnt = 1
if s[-1] == "(":
    leng.append(["(", cnt])
else:
    leng.append([")", cnt])
if s[0] == ")":
    leng.insert(0,["(", leng[0][1]])
if s[-1] == "(":
    leng.insert(len(leng),[")", leng[-1][1]])

leng2 = []
for i in range(0, len(leng), 2):
    l = leng[i]
    r = leng[i+1]
    if l[1] == r[1]:
        pass
    elif l[1] < r[1]:
        leng2.append([")",r[1]-l[1]])
    else:
        leng2.append(["(", l[1]-r[1]])

lc = 0
rc = 0
while leng2:
    if leng2[0][0] == ")":
        leng[0][1] += leng2[0][1]
        u = leng2.pop(0)
    else:
        break
while leng2:
    if leng2[-1][0] == "(":
        leng[-1][1] += leng2[-1][1]
        u = leng2.pop()
    else:
        break
lc = 0
rc = 0
for i in range(len(leng2)):
    tar = leng2[i]
    if tar[0] == "(":
        lc += tar[1]
    else:
        rc += tar[1]
if lc > rc:
    s[-1][1] += lc-rc
elif lc < rc:
    s[0][1] += rc-lc

ans = []
for i in range(len(leng)):
    tar = leng[i]
    for j in range(tar[1]):
        ans.append(tar[0])
print("".join(ans))










Fixed submission:
n = int(input())
s = list(input())
leng = []
cnt = 1
for i in range(n-1):
    if s[i] == s[i+1]:
        cnt += 1
    else:
        leng.append([s[i], cnt])
        cnt = 1
if s[-1] == "(":
    leng.append(["(", cnt])
else:
    leng.append([")", cnt])
if s[0] == ")":
    leng.insert(0,["(", leng[0][1]])
if s[-1] == "(":
    leng.insert(len(leng),[")", leng[-1][1]])

leng2 = []
for i in range(0, len(leng), 2):
    l = leng[i]
    r = leng[i+1]
    if l[1] == r[1]:
        pass
    elif l[1] < r[1]:
        leng2.append([")",r[1]-l[1]])
    else:
        leng2.append(["(", l[1]-r[1]])

lc = 0
rc = 0
for i in range(len(leng2)):
    if leng2[i][0] == "(":
        lc += leng2[i][1]
    else:
        rc += leng2[i][1]
    if rc - lc > 0:
        leng[0][1] += rc-lc
        lc = 0
        rc = 0
leng[-1][1] += lc-rc

ans = []
for i in range(len(leng)):
    tar = leng[i]
    for j in range(tar[1]):
        ans.append(tar[0])
print("".join(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
edge = [0] * (n-1)
for i in range(m):
    a,b = map(int,input().split())
    if a > b:
        a,b = b,a
    for j in range(a,b):
        edge[j-1] += 1
for i in range(len(edge)):
    if edge[i] % 2 == 1:
        print("NO")
        exit()
print("YES")




Fixed submission:
n,m = map(int,input().split())
point = [0] * n
cnt = 0
for i in range(m):
    a,b = map(int,input().split())
    point[a-1] += 1
    point[b-1] += 1
    # if a > b:
    #     a,b = b,a
    # for j in range(a,b):
    #     edge[j-1] += 1
for i in range(len(point)):
    if point[i] % 2 == 1:
        print("NO")
        exit()
print("YES")
Buggy python submission (verdict: Time Limit Exceeded):
import sys
#ユークリッドの互除法
def gcd(x, y):
    if x % y == 0:
        return y
    else:
        return gcd(y, x % y)
#入力
N = int(input())
A = list(map(int, input().split()))
#カウントしていく
count= [0] * (1000001)
setwise_gcd = A[0]
for i in range(0,N):
    count[A[i]]+= 1
    setwise_gcd = gcd(setwise_gcd, A[i])

#全体のgcdが1でないならnot coprime
if setwise_gcd != 1:
    print("not coprime")
    sys.exit(0)
#A[x] % i == 0 && A[y] % i == 0 となるx, y が存在しないならpairwise coprime
for i in range(2,1000001):
    divided_count = count[i]
    now_number = 2 * i
    while(now_number<1000001):
        divided_count+= count[now_number]
        now_number+= i
    if(divided_count >= 2):
        print("setwise coprime")
        exit(0)
print("pairwise coprime")


Fixed submission:
import numpy as np
#入力
N = int(input())
A = list(map(int, input().split()))
#カウンターテーブルの用意
count=[0]*(1000001)
for a in A:count[a]+= 1

#全体のgcdが1でないならnot coprime
if np.gcd.reduce(A)!=1:
    print("not coprime")
#A[x] % i == 0 && A[y] % i == 0 となるx, y が存在しないならpairwise coprime
elif np.all([sum(count[i::i])<=1 for i in range(2,10**6+1)]):
    print("pairwise coprime")
else:
    print("setwise coprime")
Buggy python submission (verdict: Runtime Error):
n=stirng(input())
ans="No"
if(n[0]=='7'||n[1]=='7'||n[2]=='7')
	ans="Yes"
print(ans)

Fixed submission:
n=input()
ans="No"
if (n[0]=='7' or n[1]=='7' or n[2]=='7'):
	ans="Yes"
print(ans)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
if 500 * n >= k:print("Yes")
  else:print("No")

Fixed submission:
n,k=map(int,input().split())
if 500 * n >= k:print("Yes")
else:print("No")
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a==b:print(a*2)
else print(max(a,b)*2-1)


Fixed submission:
a,b=map(int,input().split())
if a==b:print(a*2)
else:print(max(a,b)*2-1)

Buggy python submission (verdict: Runtime Error):
a,b=int(input())
if a==b:print(a*2)
else print(max(a,b)*2-1)

Fixed submission:
a,b=map(int,input().split())
if a==b:print(a*2)
else:print(max(a,b)*2-1)
Buggy python submission (verdict: Runtime Error):
A,B=map(in,input().split());print(A+B if A+B<10 else "error")

Fixed submission:
A,B=map(int,input().split());print(A+B if A+B<10 else "error")