Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import bisect
n,K=map(int, input().split(" "))
A=list(map(int, input().split(" ")))

A2=[0]
sum=0
for i in A:
    A2.append(i+sum)
    sum+=i

#print(A2)
A3=[]
for i in range(len(A2)):
    for k in range(len(A2)-i-1):
        A3.append(A2[k+1+i]-A2[i])
A3.sort()
#print(A3)
#print(len(A3))

tmparr=[]
for i in range(50):
    if 2**i-1>A3[-1]:
        break
    tmparr.append(2**i-1)
#print(tmparr)



for i in tmparr[::-1]:
    rem=len(A3)-bisect.bisect_right(A3,i)
    if rem>K:
        A4=A3[-rem:]
        break
#print(A4)

#A5=[]
#for i in A4:
#    A5.append(bin(i))

result=[]
c = list(itertools.combinations(A4,K));
for i in c:
    init=i[0]
    for k in i:
        init = init & k
    result.append(init)
#print(result)
print(max(result))

Fixed submission:
import itertools
import bisect
n,K=map(int, input().split(" "))
A=list(map(int, input().split(" ")))

A2=[0]
sum=0
for i in A:
    A2.append(i+sum)
    sum+=i

#print(A2)
A3=[]
for i in range(len(A2)):
    for k in range(len(A2)-i-1):
        A3.append(A2[k+1+i]-A2[i])
A3.sort()
#print(A3)
#print(len(A3))

tmparr=[]
for i in range(50):
    if 2**i-1>A3[-1]:
        break
    tmparr.append(2**i-1)
#print(tmparr)


"""
for i in tmparr[::-1]:
    rem=len(A3)-bisect.bisect_right(A3,i)
    if rem>K:
        A4=A3[-rem:]
        break
"""
arr=A3
result=0
for i in tmparr[::-1]:
    count=0
    tmparr=[]
    for k in arr:
        if k & i+1 > 0:
            count+=1
            tmparr.append(k)
    if count>=K:
        arr=tmparr
        result+=i+1
print(result)
Buggy python submission (verdict: Runtime Error):
n=int(input())
V=list(map(int, input().split(" ")))
d1=[0 for i in range(10000)]
for i in V[::2]:
    d1[i]+=1
d2=[0 for i in range(10000)]
for i in V[1::2]:
    d2[i]+=1


if d1.index(max(d1)) == d2.index(max(d2)):
    if max(d1)>max(d2):
        d2[d2.index(max(d2))]=0
    else:
        d1[d1.index(max(d1))]=0

#print(d1[:5])
#print(d2[:5])
tmp1=n/2-max(d1)
tmp2=n/2-max(d2)
print(int(tmp1+tmp2))

Fixed submission:
import copy
n=int(input())
V=list(map(int, input().split(" ")))
d1=[0 for i in range(100000)]
for i in V[::2]:
    d1[i-1]+=1
d2=[0 for i in range(100000)]
for i in V[1::2]:
    d2[i-1]+=1

m1=max(d1)
m2=max(d2)
maxind1 = [i for i, x in enumerate(d1) if x == m1]
maxind2 = [i for i, x in enumerate(d2) if x == m2]

#in1=d1.index(max(d1))
#in2=d2.index(max(d2))



if (maxind1[0] == maxind2[0]) and (len(maxind1) == 1) and (len(maxind2) == 1):
    #if m1>m2:
    #d2[maxind2[0]]=0
    tmp=copy.copy(d2)
    tmp[maxind2[0]]=0
    result1=n-max(d1)-max(tmp)

    #else:
    #d1[maxind1[0]]=0
    tmp=copy.copy(d1)
    tmp[maxind1[0]]=0
    result2=n-max(tmp)-max(d2)
    print(int(min(result1,result2)))
else:
#print(d1[:5])
#print(d2[:5])
    tmp1=n/2-max(d1)
    tmp2=n/2-max(d2)
    print(int(tmp1+tmp2))

Buggy python submission (verdict: Runtime Error):
n=int(input())
V=list(map(int, input().split(" ")))
d1=[0 for i in range(100000)]
for i in V[::2]:
    d1[i]+=1
d2=[0 for i in range(100000)]
for i in V[1::2]:
    d2[i]+=1


if d1.index(max(d1)) == d2.index(max(d2)):
    if max(d1)>max(d2):
        d2[d2.index(max(d2))]=0
    else:
        d1[d1.index(max(d1))]=0

#print(d1[:5])
#print(d2[:5])
tmp1=n/2-max(d1)
tmp2=n/2-max(d2)
print(int(tmp1+tmp2))

Fixed submission:
import copy
n=int(input())
V=list(map(int, input().split(" ")))
d1=[0 for i in range(100000)]
for i in V[::2]:
    d1[i-1]+=1
d2=[0 for i in range(100000)]
for i in V[1::2]:
    d2[i-1]+=1

m1=max(d1)
m2=max(d2)
maxind1 = [i for i, x in enumerate(d1) if x == m1]
maxind2 = [i for i, x in enumerate(d2) if x == m2]

#in1=d1.index(max(d1))
#in2=d2.index(max(d2))



if (maxind1[0] == maxind2[0]) and (len(maxind1) == 1) and (len(maxind2) == 1):
    #if m1>m2:
    #d2[maxind2[0]]=0
    tmp=copy.copy(d2)
    tmp[maxind2[0]]=0
    result1=n-max(d1)-max(tmp)

    #else:
    #d1[maxind1[0]]=0
    tmp=copy.copy(d1)
    tmp[maxind1[0]]=0
    result2=n-max(tmp)-max(d2)
    print(int(min(result1,result2)))
else:
#print(d1[:5])
#print(d2[:5])
    tmp1=n/2-max(d1)
    tmp2=n/2-max(d2)
    print(int(tmp1+tmp2))
Buggy python submission (verdict: Runtime Error):
n,k=map(int, input().split(" "))
X=list(map(int, input().split(" ")))
import bisect
maxvalue=100000000000000000000000
place=bisect.bisect_left(X,0)

if k<place:
    X=X[place-k:]
elif k<n-place:
    X=X[:place-n]

#print(place)
for i in range(n-k+1):
    low=X[i]
    high=X[i+k-1]
    if high*low<0:
        low=abs(low)
        high=abs(high)
        value=min(low,high)*2+max(low,high)
    else:
        low=abs(low)
        high=abs(high)
        value=low+high
    #print(value)
    if value<maxvalue:
        maxvalue=value
print(maxvalue)


Fixed submission:
n,k=map(int, input().split(" "))
X=list(map(int, input().split(" ")))
#import bisect
maxvalue=100000000000000000000000
#place=bisect.bisect_left(X,0)

#if k<place:
#    X=X[place-k:]
#if k<n-place:
#    X=X[:-(n-place-k)]

#print(X)
#print(place)
for i in range(n-k+1):
    low=X[i]
    high=X[i+k-1]
    if high*low<0:
        low=abs(low)
        high=abs(high)
        value=min(low,high)*2+max(low,high)
    else:
        low=abs(low)
        high=abs(high)
        value=max(low,high)
    #print(value)
    if value<maxvalue:
        maxvalue=value
print(maxvalue)
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int, input().split(" "))
#min=0
#max=1000000000
arr=[[0,100000000]]
for i in range(m):

    flag=1
    a,b=map(int, input().split(" "))
    for n,j in enumerate(arr):
        flag=1
        if j[0]<=a and j[1]>=b:
            del arr[n]
            #arr.remove(j)
        elif j[0]>=a and j[1]<=b:
            flag=0
            break
    if flag==1:
        arr.append([a,b])

#arr.sort(key=lambda x:x[0])
arr.sort(key=lambda x:(x[0],x[1]))
#print(arr)
#count=0
num=0
count=0
for i in range(len(arr)):
    if arr[i][0]-num>=0:
        count+=1
        num=arr[i][1]

print(count)


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

    arr.append([a,b])

#arr.sort(key=lambda x:x[0])
arr.sort(key=lambda x:(x[0],x[1]))
left=0
num=0
count=0
for i in range(len(arr)):
    if arr[i][0]==left:
        pass
    if arr[i][1]<=num:
        num=arr[i][1]
    if arr[i][0]-num>=0:
        count+=1
        num=arr[i][1]
        left=arr[i][0]
    #print(arr[i],count)
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int, input().split(" "))
#min=0
#max=1000000000
arr=[[0,100000000]]
for i in range(m):
    flag=1
    a,b=map(int, input().split(" "))
    for j in arr:
        flag=1
        if j[0]<=a and j[1]>=b:
            arr.remove(j)
        elif j[0]>=a and j[1]<=b:
            flag=0
            break
    if flag==1:
        arr.append([a,b])

arr.sort(key=lambda x:x[0])
#print(arr)
#count=0
num=0
count=0
for i in range(len(arr)):
    if arr[i][0]-num>=0:
        count+=1
        num=arr[i][1]

print(count)

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

    arr.append([a,b])

#arr.sort(key=lambda x:x[0])
arr.sort(key=lambda x:(x[0],x[1]))
left=0
num=0
count=0
for i in range(len(arr)):
    if arr[i][0]==left:
        pass
    if arr[i][1]<=num:
        num=arr[i][1]
    if arr[i][0]-num>=0:
        count+=1
        num=arr[i][1]
        left=arr[i][0]
    #print(arr[i],count)
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int, input().split(" ")))
count=0
num1=0
num2=0
a=[[]]
b=[[]]
count=0


for i in range(n):
    xors=0
    sums=0
    for k in range(n-i):
        if xors^A[k+i] == sums+A[k+i]:
            #print(i,k+i)
            count+=1
        else:
            break
        xors=xors^A[k+i]
        sums=sums+A[k+i]
print(count)


Fixed submission:
n=int(input())
A=list(map(int, input().split(" ")))
count=0

xors=0
sums=0
r=0
for l in range(n):
    while (r != n and xors^A[r] == sums+A[r]):
        sums += A[r]
        xors ^= A[r]
        r += 1
    count+=r-l
    xors^=A[l]
    sums-=A[l]
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
num=int(raw_input())
tmp=[]
for i in range(num):
    tmp.append(int(raw_input()))

output=0
for i in set(tmp):
    if tmp.count(i)%2 ==1:
        output+=1
print output

Fixed submission:
num=int(raw_input())
tmp={}
for i in range(num):
    a=int(raw_input())
    if a in tmp:
        tmp[a]+=1
    else:
        tmp[a]=1

output=0
for i in tmp:
    if tmp[i]%2 ==1:
        output+=1
print output
Buggy python submission (verdict: Time Limit Exceeded):
num=raw_input()
out=0
for i in range(len(num)):
    #out+=num[i:].count(num(i))
    #print len(num[i:])-num[i:].count(num[i])
    out+=len(num[i:])-num[i:].count(num[i])

print out+1

Fixed submission:
num=raw_input()
out=0
d={}
for i in set(num):
    d[i]=num.count(i)
#print d
#aaa
for i in range(len(num)):
    #out+=num[i:].count(num(i))
    #print len(num[i:])-num[i:].count(num[i])
    #out+=len(num[i:])-num[i:].count(num[i])
    out+=len(num[i:])-d[num[i]]
    d[num[i]]-=1

print out+1
Buggy python submission (verdict: Runtime Error):
tmp=map(int, raw_input().split(" "))
a=abs(tmp[0]-tmp[1])
b=abs(tmp[0]-tmp[2])
if a<b:
    print("A")
else:
    print("B")

Fixed submission:
tmp=map(int, raw_input().split(" "))
a=abs(tmp[0]-tmp[1])
b=abs(tmp[0]-tmp[2])
if a<b:
    print("A")
else:
    print("B")
Buggy python submission (verdict: Runtime Error):
a_list=("abcdefghijklmnopqrstuvwxyz")
word=(raw_input())
flag=0
out="None"
for i in a_list:
    for n,k in enumerate(word):
        if i==k:
            break
        if n==len(word)-1:
            out=i
            flag=1
    if flag==1:
        break
print(out)

Fixed submission:
a_list=("abcdefghijklmnopqrstuvwxyz")
word=(raw_input())
flag=0
out="None"
for i in a_list:
    for n,k in enumerate(word):
        if i==k:
            break
        if n==len(word)-1:
            out=i
            flag=1
    if flag==1:
        break
print(out)
Buggy python submission (verdict: Time Limit Exceeded):
num=raw_input()
tmp=map(int, raw_input().split(" "))
arr=[]
arr_v=[]
for i in set(tmp):
    if tmp.count(i) > 1:
        arr.append(i)
    if tmp.count(i) > 3:
        arr_v.append(i)

if len(arr)<2:
    print 0
else:
    arr.sort()
    if arr[-1] in arr_v:
        print arr[-1]**2
    else:
        print arr[-2]*arr[-1]


Fixed submission:
num=raw_input()
tmp=map(int, raw_input().split(" "))
tmp.sort()
tmp.reverse()
oldnum=0
arr=[]
flag=0
out=0
for i in range(len(tmp)-1):
    if tmp[i]==tmp[i+1] and flag==0:
            arr.append(tmp[i])
            flag=1
    else:
        flag=0
    if len(arr)==2:
        out=arr[0]*arr[1]
        break
    try:
        if tmp[i]==tmp[i+1] and tmp[i]==tmp[i+2] and tmp[i]==tmp[i+3]:
            out=tmp[i]**2
            break
    except:
        pass
print out
Buggy python submission (verdict: Runtime Error):
num=raw_input()
tmp=raw_input()
tmp2=raw_input()
bef="none"
n_state=0
af_state=0
if tmp[0]==tmp[1]:
    out=6
else:
    out=3

for i in range(1,len(tmp)):
    if tmp[i]!=bef:
        if i<int(num)-1:
            if tmp[i]==tmp[i+1]:
                if n_state==0:
                    out=out*2
                else:
                    out=out*3
                    n_state=0
            else:
                if n_state==0:
                    out=out*2
                else:
                    out=out*1
                    n_state=0
        else:
            if n_state==0:
                out=out*2
            else:
                out=out*1
                n_state=0
    else:
        n_state=1
    bef=tmp[i]
print out % 1000000007


Fixed submission:
num=raw_input()
tmp=raw_input()
tmp2=raw_input()
bef="none"
n_state=0
af_state=0
if len(tmp)==1:
    out=3
else:
    if tmp[0]==tmp[1]:
        out=6
        n_state=1
        init=2
    else:
        out=3
        init=1
    #out=3

    for i in range(init,len(tmp)):
        if tmp[i]!=bef:
            #print "aaa"
            if i<int(num)-1:
                if tmp[i]==tmp[i+1]:
                    if n_state==0:
                        out=out*2
                    else:
                        out=out*3
                        n_state=0
                else:
                    if n_state==0:
                        out=out*2
                    else:
                        out=out*1
                        n_state=0
            else:
                if n_state==0:
                    out=out*2
                else:
                    out=out*1
                    n_state=0
        else:
            n_state=1
        bef=tmp[i]
print out % 1000000007
Buggy python submission (verdict: Runtime Error):
tmp=map(int, raw_input().split(" "))
if tmp[1]<tmp[2]:
    print 0
else:
    print min(tmp[1],tmp[3])-tmp[2]


Fixed submission:
num=list(raw_input())
#print num
#print num[::-1]
if num==num[::-1]:
    print "Yes"
else:
    print "No"
Buggy python submission (verdict: Runtime Error):
import fractions
def lcm(a, b):
    return (a*b)//fracitons.gcd(a,b)

N = input().split()
N = [int(i) for i in N]
print(lcm(N[0],N[1]))



Fixed submission:
import fractions
def lcm(a, b):
    return (a*b)//fractions.gcd(a,b)

N = input().split()
N = [int(i) for i in N]
print(lcm(N[0],N[1]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
print(int(N*(N-1)//2)

Fixed submission:
N =int(input())
print(int(N*(N-1)//2))
Buggy python submission (verdict: Runtime Error):
N = input().split()
N = [int(i) for i in N]
pi = [0 for i in range(N[0])]
ci = [0 for i in range(N[0])]
for i in range(N[0]):
    buf = input().split()
    pi[i] = int(buf[0])
    ci[i] = int(buf[1])

num_min = 10*100
G_new = N[1]

flag= [0 for i in range(N[0])]
for i in range(0, pow(2, N[0])):
    G_new = N[1]
    count = 0
    #print(bin(i))
    for j in range(N[0]):
        flag[j] = (i>>j & 1)
        if(flag[j]==1):
            G_new -= ci[j]
            G_new -= 100*(j+1)*pi[j]
            count += pi[j]
    #print(flag)

    if(G_new<=0):
        #print(i, flag)
        if(count < num_min):
            #print(count)
            num_min = count
            #print(count)
    else:
        for j in range(N[0]):
            if((flag[N[0]-1-j])==0):
                #print(i, flag, N[0]-1-j, G_new, pi[N[0]-1-j], count, -(-G_new//(100*(N[0]-j)))   )
                if(G_new - 100*(N[0]-j)*pi[N[0]-1-j] < 0):
                    count += -(-G_new//(100*(N[0]-j)))
                    if(count < num_min):
                       # print(count)
                        num_min = count
                		break

    
print(num_min)


Fixed submission:
N = input().split()
N = [int(i) for i in N]
pi = [0 for i in range(N[0])]
ci = [0 for i in range(N[0])]
for i in range(N[0]):
    buf = input().split()
    pi[i] = int(buf[0])
    ci[i] = int(buf[1])

num_min = 10*100
G_new = N[1]

flag= [0 for i in range(N[0])]
for i in range(0, pow(2, N[0])):
    G_new = N[1]
    count = 0
    #print(bin(i))
    for j in range(N[0]):
        flag[j] = (i>>j & 1)
        if(flag[j]==1):
            G_new -= ci[j]
            G_new -= 100*(j+1)*pi[j]
            count += pi[j]
    #print(flag)

    if(G_new<=0):
        #print(i, flag)
        if(count < num_min):
            #print(count)
            num_min = count
            #print(count)
    else:
        for j in range(N[0]):
            if((flag[N[0]-1-j])==0):
                #print(i, flag, N[0]-1-j, G_new, pi[N[0]-1-j], count, -(-G_new//(100*(N[0]-j)))   )
                if(G_new - 100*(N[0]-j)*pi[N[0]-1-j] < 0):
                    count += -(-G_new//(100*(N[0]-j)))
                    if(count < num_min):
                       # print(count)
                        num_min = count
                break

    
print(num_min)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N = input().split()
N = [int(i) for i in N]
num = [i for i in range(N[0]+1)]

count = 0

#1
for i in range(N[0]+1):
    if(3*i == N[1]):
        count += 1

l2 = list(itertools.combinations(num, 2))
l3 = list(itertools.combinations(num, 3))
#print(num)
#print(l2)

#2
for i in range(len(l2)):
    if((l2[i][0] + 2*l2[i][1]) == N[1]):
        count += 1*3
    if((l2[i][0]*2 + l2[i][1]) == N[1]):
        count += 1*3

#3
for i in range(len(l3)):
    if((l3[i][0] + l3[i][1] + l3[i][2]) == N[1]):
        count += 1*6

print(count)


Fixed submission:
N = input().split()
N = [int(i) for i in N]
count = 0
for i in range(N[0]+1):
    for j in range(N[0]+1):
        k = N[1] - i - j
        if((k <= N[0])and(k>=0)):
            count += 1
print(count)

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

count = 0
for i in range(N[0]+1):
  for j in range(N[0]+1):
    for k in range(N[0]+1):
      s = i + j + k
      if(s == N[1]):
        count += 1
print(count)


Fixed submission:
N = input().split()
N = [int(i) for i in N]
count = 0
for i in range(N[0]+1):
    for j in range(N[0]+1):
        k = N[1] - i - j
        if((k <= N[0])and(k>=0)):
            count += 1
print(count)

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

count = 0
for i in range(N[0]+1):
  for j in range(N[0]+1):
    for k in range(N[0]+1):
      s = i + j + k
      if(s == N[1]):
        count += 1
print(count)

Fixed submission:
N = input().split()
N = [int(i) for i in N]
count = 0
for i in range(N[0]+1):
    for j in range(N[0]+1):
        k = N[1] - i - j
        if((k <= N[0])and(k>=0)):
            count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
import sys

S = input()
K = int(input())

if len(S) == 1:
    print(K//2)
    sys.exit()
if len(S) == 2:
    if S[0] == S[1]:
        print(K)
    else:
        print('0')
    sys.exit()

olds = S[0]
l = 1
c = 0
first = 1
for i in range(1,len(S)):

    if olds == S[i]:
        l += 1
    else:
        if first:
            firstL = l
            first = 0
        c += l//2
        l = 1
    olds = S[i]
    
    if i == len(S)-1:
        lastL = l
        c += l//2

if S[0] == S[-1] and firstL%2 == 1 and lastL%2 == 1:
    print((c+1)*K-1)
else:
    print(c*K)


Fixed submission:
import sys

S = input()
K = int(input())

if len(S) == 1:
    print(K//2)
    sys.exit()
if len(S) == 2:
    if S[0] == S[1]:
        print(K)
    else:
        print('0')
    sys.exit()

olds = S[0]
l = 1
c = 0
first = 1
for i in range(1,len(S)):

    if olds == S[i]:
        l += 1
    else:
        if first:
            firstL = l
            first = 0
        c += l//2
        l = 1
    olds = S[i]
    
    if i == len(S)-1:
        if first:
            print(len(S)*K//2)
            sys.exit()
        lastL = l
        c += l//2

if S[0] == S[-1] and firstL%2 == 1 and lastL%2 == 1:
    print((c+1)*K-1)
else:
    print(c*K)

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

olds = S[0]
l = 1
c = 0
first = 1
for i in range(1,len(S)):

    if olds == S[i]:
        l += 1
    else:
        if first:
            firstL = l
            first = 0
        c += l//2
        l = 1
    olds = S[i]
    
    if i == len(S)-1:
        lastL = l
        c += l//2

if S[0] == S[-1] and firstL%2 == 1 and lastL%2 == 1:
    print((c+1)*K-1)
else:
    print(c*K)


Fixed submission:
import sys

S = input()
K = int(input())

if len(S) == 1:
    print(K//2)
    sys.exit()
if len(S) == 2:
    if S[0] == S[1]:
        print(K)
    else:
        print('0')
    sys.exit()

olds = S[0]
l = 1
c = 0
first = 1
for i in range(1,len(S)):

    if olds == S[i]:
        l += 1
    else:
        if first:
            firstL = l
            first = 0
        c += l//2
        l = 1
    olds = S[i]
    
    if i == len(S)-1:
        if first:
            print(len(S)*K//2)
            sys.exit()
        lastL = l
        c += l//2

if S[0] == S[-1] and firstL%2 == 1 and lastL%2 == 1:
    print((c+1)*K-1)
else:
    print(c*K)
Buggy python submission (verdict: Runtime Error):
if input() == 'Sunny':
    print('Cloudy')
elif input() == 'Cloudy':
    print('Rainy')
elif input() == 'Rainy':
    print('Sunny')



Fixed submission:
S = input()
if S == 'Sunny':
    print('Cloudy')
elif S == 'Cloudy':
    print('Rainy')
elif S == 'Rainy':
    print('Sunny')
Buggy python submission (verdict: Runtime Error):
import sys

if __name__ == '__main__':
    N = int(input())
    A = InputToInt()
    if N%3 != 0:
        print('No')
        sys.exit()
    A.sort()

    n = N/3
    if 1 == len(set(A[0:n])) and 1 == len(set(A[n:2*n])) and 1 == len(set(A[2*n:3*n])) and A[0] == A[n] ^ A[2*n]:
        print('Yes')
    else:
        print('No')


Fixed submission:
import sys
def InputToInt():
    A = input().split()
    for i in range(len(A)):
        A[i] = int(A[i])
    return A

if __name__ == '__main__':
    N = int(input())
    A = InputToInt()
    if set(A) == {0}:
        print('Yes')
        sys.exit()
    
    if N%3 != 0:
        print('No')
        sys.exit()
    A.sort()

    n = int(N/3)
    if 1 == len(set(A[0:n])) and 1 == len(set(A[n:2*n])) and 1 == len(set(A[2*n:3*n])) and A[0] == A[n] ^ A[2*n]:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
def InputToInt():
    A = input().split()
    for i in range(len(A)):
        A[i] = int(A[i])
    return A
    
if __name__ == '__main__':
    N = int(input())
    A = InputToInt()

    for i in range(N):
        s = 0
        for j in range(0,N-2,2):
            s += A[(i+j)%N] - A[(i+j+1)%N]
        print(s + A[(i-1)%N], end=" ")


Fixed submission:
import numpy as np

def InputToInt():
    A = input().split()
    for i in range(len(A)):
        A[i] = int(A[i])
    return A
    
if __name__ == '__main__':
    N = int(input())
    A = InputToInt()

    s = np.zeros(N)
    for j in range(0,N-2,2):
        s[0] += A[j] - A[j+1]
    s[0] += A[N-1]
    s[N-1] = (A[N-1] - s[0]/2)*2

    for i in range(2,N):
        s[N-i] = (A[N-i] - s[N-i+1]/2)*2
    for i in range(N):
        print(int(s[i]), end=" ")

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

def InputToInt():
    A = input().split()
    for i in range(len(A)):
        A[i] = int(A[i])
    return A
    
if __name__ == '__main__':
    N = int(input())
    A = np.array(InputToInt())

    V = np.ones(N)
    
    for i in range(1,N,2):
        V[i] = -1

    for i in range(N):
        print(int(np.dot(A, V)),end=" ")
        v = V[N-1]
        V[1:N] = V[0:N-1]
        V[0] = v
        


Fixed submission:
import numpy as np

def InputToInt():
    A = input().split()
    for i in range(len(A)):
        A[i] = int(A[i])
    return A
    
if __name__ == '__main__':
    N = int(input())
    A = InputToInt()

    s = np.zeros(N)
    for j in range(0,N-2,2):
        s[0] += A[j] - A[j+1]
    s[0] += A[N-1]
    s[N-1] = (A[N-1] - s[0]/2)*2

    for i in range(2,N):
        s[N-i] = (A[N-i] - s[N-i+1]/2)*2
    for i in range(N):
        print(int(s[i]), end=" ")
Buggy python submission (verdict: Runtime Error):
length, pos = input().split(' ')
length,pos = int(length), int(pos)
target = input()
if target[pos-1] == 'A':
  target[pos-1] = 'a'
if target[pos-1] == 'B':
  target[pos-1] = 'b'
if target[pos-1] == 'C':
  target[pos-1] = 'c'

print(target)


Fixed submission:
length, pos = input().split(' ')
length, pos = int(length), int(pos)
target = input()
answer = ''
if pos == 1:
  answer = str(target[pos-1].lower() + target[1:])
elif pos == length:
  answer = str(target[:-1] + target[pos-1].lower())
else:
  answer = str(target[:pos-1] + target[pos-1].lower() + target[pos:])

print(answer)