Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())

if N <=999:
    print("ABC")
else:
    print("ABD")

Fixed submission:
n = int(input())

if n <=999:
    print("ABC")
else:
    print("ABD")
Buggy python submission (verdict: Runtime Error):
N,L = map(int,input().split())
s = []
for i in range(N):
    s.append(L+i)
ans_pre = abs(np.array([s]))
if L + N < 0:
    print(-1*(sum(ans_pre[0])-min(ans_pre[0])))
else:
    print(sum(s)-min(ans_pre[0]))

Fixed submission:
import numpy as np
N,L = map(int,input().split())
s = []
for i in range(N):
    s.append(L+i)
ans_pre = abs(np.array([s]))
if L + N <= 0:
    print(-1*(sum(ans_pre[0])-min(ans_pre[0])))
else:
    print(sum(s)-min(ans_pre[0]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
list_A = list(map(int,input().split()))
for _ in range(100):
    min_A = min(list_A)
    list_A.remove(min_A)
    l = np.array([list_A]) % min_A
    lr = list(l.ravel())
    lr.append(min_A)
    list_A = [x for x in lr if x != 0]
    if len(list_A) <= 1:
        break
print(list_A[0])

Fixed submission:
import numpy as np
N = int(input())
list_A = list(map(int,input().split()))
for _ in range(100):
    min_A = min(list_A)
    list_A.remove(min_A)
    l = np.array([list_A]) % min_A
    lr = list(l.ravel())
    lr.append(min_A)
    list_A = [x for x in lr if x != 0]
    if len(list_A) <= 1:
        break
print(list_A[0])
Buggy python submission (verdict: Runtime Error):
import numpy as np
N, M = map(int, input().split())
list_x = list(map(int, input().split()))
list_x.sort()
list_d = np.diff(list_x)
list_data = list_d.tolist()
if len(list_data) != 0:
    for _ in range(N-1):
        list_data.remove(max(list_data))
    print(sum(list_data))
else:
    print(0)


Fixed submission:
import numpy as np
N, M = map(int, input().split())
list_x = list(map(int, input().split()))
list_x.sort()
list_d = np.diff(list_x)
list_data = list_d.tolist()
if len(list_data) != 0:
    if N >= 2:
        list_data.sort()
        del list_data[-(N-1):]
        print(sum(list_data))
    if N == 1:
        print(sum(list_data))
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
list_x = list(map(int, input().split()))
list_x.sort()
list_data = []
a = list_x[0]
for i,x in enumerate(list_x):
    if i != 0:
        diff = x - a
        a = x
        list_data.append(diff)
    else:
        pass
if len(list_data) != 0:
    for _ in range(N-1):
        list_data.remove(max(list_data))
    print(sum(list_data))
else:
    print(0)


Fixed submission:
import numpy as np
N, M = map(int, input().split())
list_x = list(map(int, input().split()))
list_x.sort()
list_d = np.diff(list_x)
list_data = list_d.tolist()
if len(list_data) != 0:
    if N >= 2:
        list_data.sort()
        del list_data[-(N-1):]
        print(sum(list_data))
    if N == 1:
        print(sum(list_data))
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
list_x = list(map(int, input().split()))
list_x.sort()
list_data = []
a = list_x[0]
for i,x in enumerate(list_x):
    if i != 0:
        diff = x - a
        a = x
        list_data.append(diff)
    else:
        pass
if len(list_data) != 0:
    for _ in range(N-1):
        list_data.remove(max(list_data))
    print(sum(list_data))
else:
    print(0)

Fixed submission:
import numpy as np
N, M = map(int, input().split())
list_x = list(map(int, input().split()))
list_x.sort()
list_d = np.diff(list_x)
list_data = list_d.tolist()
if len(list_data) != 0:
    if N >= 2:
        list_data.sort()
        del list_data[-(N-1):]
        print(sum(list_data))
    if N == 1:
        print(sum(list_data))
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
import numpy as np
H, W = map(int,input().split())
S_pre = []
for i in range(H):
    S_i = list(input().split())
    S_pre.append(S_i)
    black = [j for j,x in enumerate(S_i) if x == '#']
       
S = np.array(S_pre)


Fixed submission:
N = int(input())
H = int(input())
W = int(input())
x = (N - H + 1) * (N - W + 1)
print(x)
Buggy python submission (verdict: Runtime Error):
a = input()
if (a[:2] >0 and a[:2]<13) and (a[2:] >0 and a[2:]<13):
  print("both")
if (a[:2] >0 and a[:2]<13) and (a[2:] ==0 or a[2:]>13):
  print("MMYY")
if (a[:2] ==0 or  a[:2]>13) and (a[2:]>0 or a[2:]<13):
  print("YYMM")
if (a[:2] ==0 or  a[:2]>13) and (a[2:] ==0 or a[2:]>13):
  print("YYMM")


Fixed submission:
a = input()
mm = int(a[:2])
yy = int(a[2:])

can1 = True
can2 = True

if mm>12:
  can1 = False
if mm<1:
  can1= False

if yy>12:
  can2 = False
if yy<1:
  can2 = False

if can1 and can2:
  print("AMBIGUOUS")
elif can2:
  print("YYMM")
elif can1:
  print("MMYY")
else:
  print("NA")
Buggy python submission (verdict: Runtime Error):
a, b, c= input().split()
a, b, c = int(a), int(b), int(c)

if a>b and a>c:
  print(int((1/2 * b * c)))
  
if b>a and b>c:
  print(int((1/2 * a * c)))
  
else:
  print(int((1/2 * a *b))

Fixed submission:
a, b, c= input().split()
a, b, c = int(a), int(b), int(c)

if a>b and a>c:
  print(int((1/2 * b * c)))
  
if b>a and b>c:
  print(int((1/2 * a * c)))
  
else:
  print(int((1/2 * a *b)))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(lambda x:int(x), input().split()))

fail=False
count_list = [0]*(int((N-1)/2)+1)
for i in range(N):
	if A[i]%2==N%2:
		print(0)
		fail=True
		break
	count_list[int(A[i]/2)] = count_list[int(A[i]/2)]+1
if not fail:
	if N%2==0:
		for c in count_list:
			if c!=2:
				print(0)
				break
		else:
			print(int(2**(N/2)%(10**9+7)))
	if N%2==1:
		if count_list[0]!=1:
			print(0)
		else:
			count_list.pop(0)
			for c in count_list:
				if c!=2:
					print(0)
					break
			else:
				print(int(2**((N-1)/2)%(10**9+7)))


Fixed submission:
N = int(input())
A = list(map(lambda x:int(x), input().split()))

fail=False
count_list = [0]*(int((N-1)/2)+1)
for i in range(N):
	if A[i]%2==N%2:
		print(0)
		fail=True
		break
	count_list[int(A[i]/2)] = count_list[int(A[i]/2)]+1
if not fail:
	if N%2==0:
		for c in count_list:
			if c!=2:
				print(0)
				break
		else:
			result = 2
			for i in range(int(N/2)-1):
				result = result*2%(10**9+7)
			print(result)
	if N%2==1:
		if count_list[0]!=1:
			print(0)
		else:
			count_list.pop(0)
			for c in count_list:
				if c!=2:
					print(0)
					break
			else:
				if N==1:
					print(1)
				else:
					result = 2
					for i in range(int((N-1)/2)-1):
						result = result*2%(10**9+7)
					print(result)
Buggy python submission (verdict: Time Limit Exceeded):
class UnionFind:
	"""Union-Find, 
	http://www.slideshare.net/chokudai/union-find-49066733"""

	def __init__(self, N):
		self.par = [i for i in range(N)]

	def root(self, x):
		if(self.par[x]==x):
			return x
		else:
			self.par[x] = self.root(self.par[x])
			return self.par[x]

	def same(self, x, y):
		return self.par[x]==self.par[y]

	def unite(self, x, y):
		x = self.root(x)
		y = self.root(y)
		# if x==y:
		# 	return
		self.par[x] = y
		return

N, K, L = map(lambda x:int(x), input().split())
P = [0]*K
Q = [0]*K
R = [0]*L
S = [0]*L
for i in range(K):
	P[i], Q[i] = map(lambda x:int(x), input().split())
for i in range(L):
	R[i], S[i] = map(lambda x:int(x), input().split())

uf_k = UnionFind(N)
uf_l = UnionFind(N)

for i in range(K):
	uf_k.unite(P[i]-1, Q[i]-1)
for i in range(L):
	uf_l.unite(R[i]-1, S[i]-1)

k_groups = [uf_k.root(i) for i in range(N)]
l_groups = [uf_l.root(i) for i in range(N)]

num_kg = max(k_groups)
num_lg = max(l_groups)
result_tab = [[0 for j in range(num_lg+1)] for i in range(num_kg+1)]
for i in range(N):
	result_tab[k_groups[i]][l_groups[i]] = result_tab[k_groups[i]][l_groups[i]]+1
for i in range(N):
	kg = k_groups[i]
	lg = l_groups[i]
	print(result_tab[kg][lg], end=" ")

Fixed submission:
class UnionFind:
	"""Union-Find, 
	http://www.slideshare.net/chokudai/union-find-49066733"""

	def __init__(self, N):
		self.par = [i for i in range(N)]

	def root(self, x):
		if(self.par[x]==x):
			return x
		else:
			self.par[x] = self.root(self.par[x])
			return self.par[x]

	def same(self, x, y):
		return self.root(x)==self.root(y)

	def unite(self, x, y):
		x = self.root(x)
		y = self.root(y)
		# if x==y:
		# 	return
		self.par[x] = y
		return

N, K, L = map(lambda x:int(x), input().split())
P = [0]*K
Q = [0]*K
R = [0]*L
S = [0]*L
for i in range(K):
	P[i], Q[i] = map(lambda x:int(x), input().split())
for i in range(L):
	R[i], S[i] = map(lambda x:int(x), input().split())

uf_k = UnionFind(N)
uf_l = UnionFind(N)

for i in range(K):
	uf_k.unite(P[i]-1, Q[i]-1)
for i in range(L):
	uf_l.unite(R[i]-1, S[i]-1)

k_groups = [uf_k.root(i) for i in range(N)]
l_groups = [uf_l.root(i) for i in range(N)]

kl_groups = [(k_groups[i], l_groups[i]) for i in range(N)]
kl_groups_origin = kl_groups
kl_groups = sorted(kl_groups)

results_dict = {}

idx = 0
count = 1
pair = kl_groups[0]
for i in range(1, N):
	if kl_groups[i]==pair:
		count = count+1
	else:
		results_dict[pair] = count
		pair = kl_groups[i]
		count = 1
results_dict[pair] = count

for i in range(N):
	pair = kl_groups_origin[i]
	print(results_dict[pair], end=" ")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
T = [0 for i in range(N)]
A = [0 for i in range(N)]
for i in range(N):
	T[i], A[i] = map(int, input().split())

minT = T[0]
minA = A[0]

for i in range(1, N):
	tmpT = T[i]
	tmpA = A[i]
	while tmpT<minT or tmpA<minA:
		tmpT = tmpT+T[i]
		tmpA = tmpA+A[i]
	minT = tmpT
	minA = tmpA
print(minT+minA)

Fixed submission:
import math
from decimal import Decimal
N = int(input())
T = [0 for i in range(N)]
A = [0 for i in range(N)]
for i in range(N):
	T[i], A[i] = map(int, input().split())

minT = T[0]
minA = A[0]

for i in range(1, N):
	tmpT = T[i]
	tmpA = A[i]
	# rate = 1
	rate = Decimal(max(math.ceil(minT/tmpT), math.ceil(minA/tmpA)))
	# if tmpT<minT or tmpA<minA:
		# rate = max(int((minT-1)/tmpT)+1, int((minA-1)/tmpA)+1)
		# rate = max(math.ceil(minT/tmpT), math.ceil(minA/tmpA))
	minT = tmpT*rate
	minA = tmpA*rate
print(minT+minA)
Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int, input().split())
A = [int(input()) for i in range(M)]

dp = [0]*(N+1)
dp[0] = 1

for next in range(1,N+1):
    if next in A:
        dp[next] = 0
    else:
        dp[next] = (dp[next-1] + dp[next-2])%1000000007

print(dp[N])

Fixed submission:
N,M = map(int, input().split())
A = set([int(input()) for i in range(M)])

dp = [0]*(N+1)
dp[0] = 1

for next in range(1,N+1):
    if next in A:
        dp[next] = 0
    else:
        dp[next] = (dp[next-1] + dp[next-2])%1000000007

print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int, input().split())
A = [int(input()) for i in range(M)]

dp = [0]*(N+1)
dp[0] = 1

for next in range(1,N+1):
    if next in A:
        dp[next] = 0
    else:
        dp[next] = dp[next-1] + dp[next-2]

print(dp[N]%1000000007)

Fixed submission:
N,M = map(int, input().split())
A = set([int(input()) for i in range(M)])

dp = [0]*(N+1)
dp[0] = 1

for next in range(1,N+1):
    if next in A:
        dp[next] = 0
    else:
        dp[next] = (dp[next-1] + dp[next-2])%1000000007

print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int, input().split())
A = [int(input()) for i in range(M)]

dp = [0]*(N+1)

dp[0] = 1
for now in range(N+1):
    next1 = now + 1
    next2 = now + 2
    if next1 <= N:
        if next1 not in A:
            dp[next1] += dp[now]
    if next2 <= N:
        if next2 not in A:
            dp[next2] += dp[now]
print(dp[N]%1000000007)

Fixed submission:
N,M = map(int, input().split())
A = set([int(input()) for i in range(M)])

dp = [0]*(N+1)
dp[0] = 1

for next in range(1,N+1):
    if next in A:
        dp[next] = 0
    else:
        dp[next] = (dp[next-1] + dp[next-2])%1000000007

print(dp[N])
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
li = list(map(int,input().split()))

li.sort()
tmp = 0

for i in range(M):
    B, C = map(int, input().split())
    for j in range(B):
        if li[j] < C:
            li[j] = C
        else:
            break
    li.sort()

print(sum(li))

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

if A >= 13:
    print(B)
elif A >= 6 and A <= 12:
    print("{:.0f}".format(B/2))
elif A <= 5:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())

id = [0] * (N+1)

for i in range(M):
    L, R = map(int, input().split())
    for j in range(L, R+1):
        id[j] += 1

cnt = 0
for i in range(1, N+1):
    if id[i] == M:
        cnt += 1

print(cnt)


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

left = 1
right = N

for i in range(M):
    L, R = map(int, input().split())
    if L > left :
        left = L
    if R < right:
        right = R

if right-left+1 > 0:
    print(right-left+1)
else:
    print(0)

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

id = [True] * (N+1)

for i in range(M):
    L, R = map(int, input().split())
    for j in range(1, L):
        id[j] = False
    for j in range(R+1, N+1):
        id[j] = False

cnt = 0
for i in range(1, N+1):
    if id[i] == True:
        cnt += 1

print(cnt)


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

left = 1
right = N

for i in range(M):
    L, R = map(int, input().split())
    if L > left :
        left = L
    if R < right:
        right = R

if right-left+1 > 0:
    print(right-left+1)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
if n != 1:
  l = list(map(int,input().split()))
  i = 0
  cnt = 0
  ans = 0
  while cnt <= x:
    ans += 1
    cnt += l[i]
    i += 1
  print(ans)
else:
  l = int(input())
  if l <= x:
    print(2)
  else:
    print(1)

Fixed submission:
n,x = map(int,input().split())
if n != 1:
  l = list(map(int,input().split()))
  i = 0
  cnt = 0
  ans = 0
  while cnt <= x :
    if i == n:
      print(n+1)
      exit()
    ans += 1
    cnt += l[i]
    i += 1
  print(ans)
else:
  l = int(input())
  if l <= x:
    print(2)
  else:
    print(1)

Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
if n > 2:
  l = list(map(int,input().split()))
  i = 0
  cnt = 0
  ans = 0
  while cnt <= x:
    ans += 1
    cnt += l[i]
    i += 1
  print(ans)
else:
  l = int(input())
  if l <= x:
    print(2)
  else:
    print(1)

Fixed submission:
n,x = map(int,input().split())
if n != 1:
  l = list(map(int,input().split()))
  i = 0
  cnt = 0
  ans = 0
  while cnt <= x :
    if i == n:
      print(n+1)
      exit()
    ans += 1
    cnt += l[i]
    i += 1
  print(ans)
else:
  l = int(input())
  if l <= x:
    print(2)
  else:
    print(1)

Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
if n != 1:
  l = list(map(int,input().split()))
  i = 0
  cnt = 0
  ans = 0
  while cnt <= x:
    ans += 1
    cnt += l[i]
    i += 1
  print(ans)
else:
  l = int(input())
  if l <= x:
    print(2)
  else:
    print(1)

Fixed submission:
n,x = map(int,input().split())
if n != 1:
  l = list(map(int,input().split()))
  i = 0
  cnt = 0
  ans = 0
  while cnt <= x :
    if i == n:
      print(n+1)
      exit()
    ans += 1
    cnt += l[i]
    i += 1
  print(ans)
else:
  l = int(input())
  if l <= x:
    print(2)
  else:
    print(1)

Buggy python submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = list(map(int,input().split()))
i = 0
cnt = 0
ans = 0
while cnt <= x:
  ans += 1
  cnt += l[i]
  i += 1
print(ans)

Fixed submission:
n,x = map(int,input().split())
if n != 1:
  l = list(map(int,input().split()))
  i = 0
  cnt = 0
  ans = 0
  while cnt <= x :
    if i == n:
      print(n+1)
      exit()
    ans += 1
    cnt += l[i]
    i += 1
  print(ans)
else:
  l = int(input())
  if l <= x:
    print(2)
  else:
    print(1)
Buggy python submission (verdict: Runtime Error):

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

while True:
    a = n- i*(2*d+1)
    if a<=0:
        print(i)
        break
    else:
        continue


Fixed submission:
n,d = map(int, input().split())
a = 0
ct=0

for i in range(n):
    if n<d:
        print(1)
        break
    else:
        a = n- i*(2*d+1)
        if a<=0:
            print(i)
            break

Buggy python submission (verdict: Runtime Error):
n,d = map(int, input().split())

while True:
    a = n- i*(2*d+1)
    if a<=0:
        print(i)
        break


Fixed submission:
n,d = map(int, input().split())
a = 0
ct=0

for i in range(n):
    if n<d:
        print(1)
        break
    else:
        a = n- i*(2*d+1)
        if a<=0:
            print(i)
            break

Buggy python submission (verdict: Runtime Error):
N,D=map(int,input().split())
print(N)
print(D)
import math
print(N/(1+2*D))
math.ceil(N/(1+2*D)

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

import math

print(math.ceil(N/(1+2*D)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for _ in range(n)]
m1, m2 = sorted(set(a))[n - 2:]
if a.count(m1) > 1:
    for _ in range(n):
        print(m1)
else:
    for x in a:
        print(m1) if x == m2 else print(m2)


Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
b = sorted(a)
for x in a:
    print(b[(x < b[-1]) - 2])
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())

xy = [0 for _ in range(n + 1)]


def root(x):
    i = x
    while xy[i] != 0:
        i = xy[i]
    return i


for _ in range(m):
    x, y, z = map(int, input().split())
    rx = root(x)
    ry = root(y)
    if rx != ry:
        xy[ry] = rx

ans = 0
for i in xy[1:]:
    if i == 0:
        ans += 1

print(ans)


Fixed submission:
n, m = map(int, input().split())

xy = [i for i in range(n + 1)]


def root(x):
    i = x
    while i != xy[i]:
        i = xy[i]
    xy[x] = i
    return i


for _ in range(m):
    x, y, z = map(int, input().split())
    rx = root(x)
    ry = root(y)
    if rx != ry:
        xy[ry] = rx

ans = -1
for i, v in enumerate(xy):
    if i == v:
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
xy = [list(map(int, input().split()[:2])) for i in range(m)]

s = set(sum(xy, []))

for a in xy:
    for b in xy:
        if not a == b:
            for c in b:
                if c in a:
                    a += b
                    xy.remove(b)
                    break

print(n - len(s) + len(xy))


Fixed submission:
n, m = map(int, input().split())

xy = [i for i in range(n + 1)]


def root(x):
    i = x
    while i != xy[i]:
        i = xy[i]
    xy[x] = i
    return i


for _ in range(m):
    x, y, z = map(int, input().split())
    rx = root(x)
    ry = root(y)
    if rx != ry:
        xy[ry] = rx

ans = -1
for i, v in enumerate(xy):
    if i == v:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[int(x) for x in input().split()]
b=0
for i in a:
  b=b^a
if b==0:
  print("Yes")
else:
  print("No")

Fixed submission:
n=int(input())
a=[int(x) for x in input().split()]
b=0
for i in a:
  b=b^i
if b==0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
from math import gcd
[a,b,c,d]=[int(x) for x in input().split()]
k=(c*d)//gcd(c,d)
count=(b-a+1)-((b//c-(a-1)//c)+(b//d-(a-1)//d)-(b//k-(a-1)//k))
print(count)
    

Fixed submission:
def gcd(x, y): 
  
   while(y): 
       x, y = y, x % y 
  
   return x 
[a,b,c,d]=[int(x) for x in input().split()]
k=(c*d)//gcd(c,d)
count=(b-a+1)-((b//c-(a-1)//c)+(b//d-(a-1)//d)-(b//k-(a-1)//k))
print(count)
Buggy python submission (verdict: Runtime Error):
[n,x]=[int(x) for x in input().split()]
l=[int(x) for x in input().split()]
k=0
count=0
for i in range(n):
  if k<=x:
    count+=1
  k+=l[i]
print(count)

Fixed submission:
[x,a]=[int(x) for x in input().split()]
if x<a:
  print('0')
else:
  print('10')
Buggy python submission (verdict: Runtime Error):
[n,x]=[int(x) for x in input().split()]
l=[int(x) for x in input().split()]
k=0
count=0
for i in range(n+1):
  if k<=x:
    count+=1
  k+=l[i]
print(count)

Fixed submission:
[n,x]=[int(i) for i in input().split()]
l=[int(x) for x in input().split()]
a=1
su=0

for i in l:
    
    if su>x:
        
        break
    su+=i
    if su<=x:
        a+=1
   

print(a)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
x=list(map(int,input().split()))

for i in range(len(x)):
    b=list()
    for j in range(len(x)):
        if j!=i:b.append(x[j])
    b.sort()
    print(b[int(n/2)-1])



Fixed submission:
n = int(input())
x = list(map(int, input().split()))
 
xs = list(sorted(x))
b1 = xs[n//2-1]
b2 = xs[n//2]
for xi in x:
    if xi<=b1:print(b2)
    else:print(b1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))
 
res = "No"
a_set = list(set(a))
 
a_set = [i for i in a_set if i != 0]
 
if len(a_set) == 3:
    if a_set[0] ^ a_set[1] == a_set[2]:
        if a.count(a_set[0]) == a.count(a_set[1]) and a.count(a_set[0]) == a.count(a_set[2]):
            res = "Yes"
if len(a_set) == 0:
    if a_set[0] == 0:
        res = "Yes"
print(res)

Fixed submission:
N = int(input())
a = list(map(int,input().split()))
 
res = "No"
a_set = list(set(a))
 

 
if len(a_set) == 3:
    if a_set[0] ^ a_set[1] == a_set[2]:
        if a.count(a_set[0]) == a.count(a_set[1]) and a.count(a_set[0]) == a.count(a_set[2]):
            res = "Yes"
if len(a_set) == 1:
    if a_set[0] == 0:
        res = "Yes"
if len(a_set) == 2:
    if 0 in a_set:
        if N%3 == 0 and a.count(0) == N/3:
            res = "Yes"
print(res)
Buggy python submission (verdict: Runtime Error):
N = int(input())
L,R = map(int,input().split())

if L-R > 672:
    print(0)
else:
    minMod = 100000000
    for i in range(L,R):
        for j in range(i+1,R+1):
            tmp = (i*j)%2019
            if minMod > tmp:
                minMod = tmp
            elif tmp == 0:
                minMod = 0 
                break
    print(minMod)

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

train = A*N
taxi  = B

if taxi < train:
    print(taxi)
else:
    print(train)

Buggy python submission (verdict: Runtime Error):
L,R = map(int,input().split())

if L-R > 672:
    print(0)
else:
    minMod = 100000000
    for i in range(L,R):
        for j in range(i+1,R+1):
            tmp = (i*j)%2019
            if minMod > tmp:
                minMod = tmp
    print(minMod)


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

train = A*N
taxi  = B

if taxi < train:
    print(taxi)
else:
    print(train)
Buggy python submission (verdict: Runtime Error):
#失恋してメンタル死んでるのでコードもシンデマス

dic = {}
key = []
item = []

for i in range(3):
    a,b = map(int,input().split())
    dic[a] = b
    key.append(a)
    item.append(b)

for i in key:
    flag = True
    tmp_key = key
    tmp_item = item
    
    a = i
    while flag:
        if a in key:
          a = dic[a]
            tmp_key.remove(a)
            tmp_item.remove(dic[a])
            
        else:
            flag = False
        
    if len(tmp_item) == 0 and len(tmp_key) == 0:
        res = "YES"
        res_flag = False
if res_flag:
  res = "NO"

print(res)
 
        
        

Fixed submission:
N,K = map(int,input().split())
N = (N+1)//2
 
if N >= K:
  res = "YES"
else:
  res = "NO"

print(res)