Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import itertools

K, S = map(int, input().split())

if not ((2 <= K and K <= 2500) or (0 <= S and S <= 3*K)):
    exit()

ans = [[x,y] for x in range(2, K+1) for y in range(2, K+1) if (0<=(S-X-Y)) and ((S-X-Y)<=K)]
print(len(ans))


Fixed submission:
import itertools

K, S = map(int, input().split())

if not ((2 <= K and K <= 2500) or (0 <= S and S <= 3*K)):
    exit()

count = 0
for X in range(0, K + 1):
    for Y in range(0, K + 1):
        if 0 <= (S - X - Y) and (S - X - Y) <= K:
            count += 1

print(count)

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

K, S = map(int, input().split())

if not ((2 <= K and K <= 2500) or (0 <= S and S <= 3*K)):
    exit()

count = 0
for X, Y, Z in itertools.product(range(0, K+1), range(0, K+1), range(0, K+1)):
    if (X + Y + Z) == S:
        count+=1
print(count)


Fixed submission:
import itertools

K, S = map(int, input().split())

if not ((2 <= K and K <= 2500) or (0 <= S and S <= 3*K)):
    exit()

count = 0
for X in range(0, K + 1):
    for Y in range(0, K + 1):
        if 0 <= (S - X - Y) and (S - X - Y) <= K:
            count += 1

print(count)

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

if not ((2 <= K and K <= 2500) or (0 <= S and S <= 3*K)):
    exit()

count = 0
for X in range(0, K+1):
    for Y in range(0, K+1):
        for Z in range(0, K+1):
            if (X +Y + Z) == S:
                count+=1

print(count)


Fixed submission:
import itertools

K, S = map(int, input().split())

if not ((2 <= K and K <= 2500) or (0 <= S and S <= 3*K)):
    exit()

count = 0
for X in range(0, K + 1):
    for Y in range(0, K + 1):
        if 0 <= (S - X - Y) and (S - X - Y) <= K:
            count += 1

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

count = 0
for i in range(n):
  if(min(p[0:i+1]) >= p[i]):
    count += 1
print(count)

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

count = 1
min = p[0]
for i in range(1,n):
  if(min >= p[i]):
    min = p[i]
  if(min >= p[i]):
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
a = input()
print(a ** 3)


Fixed submission:
a = int(input())
print(a ** 3)
Buggy python submission (verdict: Runtime Error):
def f():
	S = input()
    for idx, s in enumerate(S):
      if s == 'A':
        a = 1
      if s == 'B':
        b = 1
      if a == 1 and b == 1:
        break
    return 'Yes' if a == 1 and b == 1 else 'No'
    
      
  
print(f())

Fixed submission:
def f():
    S = raw_input()
    return 'Yes' if len(set(S)) == 2 else 'No'

print(f())
Buggy python submission (verdict: Runtime Error):
S = raw_input()
price = 700 + sum(100 if c == 'o' else 0 for c in S)
print(price)

Fixed submission:
S = input()
price = 700 + sum(100 if c == 'o' else 0 for c in S)
print(price)
Buggy python submission (verdict: Time Limit Exceeded):
def get_values():
    return [int(a) for a in input().split()]

N, = get_values()
Xs = get_values()

for idx, xi in enumerate(Xs):
    Ys = sorted(Xs[:idx] + Xs[idx+1:])
    print(Ys[len(Ys) // 2])

Fixed submission:
def get_values():
    return [int(a) for a in input().split()]

# PROBLEM C
N, = get_values()
Xs = get_values()

Ys = sorted(Xs)
mdx = len(Ys) // 2
x2b = {x:Ys[mdx if idx < mdx else mdx - 1] for idx, x in enumerate(Ys)}
for x in Xs:
    print(x2b[x])
Buggy python submission (verdict: Runtime Error):
# PROBLEM A
s = input()
letters = set(s)
perm_abc = len(letters) == 3 and all(c in letters for c in 'abc')
if perm_abc:
    print 'Yes'
else:
    print 'No'

Fixed submission:
# PROBLEM A
s = input()
letters = set(s)
perm_abc = len(letters) == 3 and all(c in letters for c in 'abc')
if perm_abc:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
# PROBLEM B
a, b, k = [int(arg) for arg in input().split()]
for x in range(a, b + 1):
    if x - a < k or b - x < k:
        print(x)

Fixed submission:
# PROBLEM B
a, b, k = [int(arg) for arg in input().split()]
if a + k < b + 1 - k:
    for x in range(a, a + k):
        print(x)
    for x in range(b+1-k, b+1):
        print(x)
else:
    for x in range(a, b + 1):
        if x - a < k or b - x < k:
            print(x)
Buggy python submission (verdict: Time Limit Exceeded):
# PROBLEM D
Q = int(input())
for _ in range(Q):
    a, b = sorted([int(s) for s in input().split()])
    c = 1
    sol = 0
    while True:
        d = (a * b) // c
        while c * d >= a * b:
            d -= 1
        if c > d:
            break
        if c < d:
            sol_ = (c != a) + (d != b)
        else:
            sol_ = (c != a) and (c != b)
        #print('candidate', c, d, sol_)
        sol += sol_
        c += 1
    print(sol)

Fixed submission:
# PROBLEM D
Q = int(input())
for _ in range(Q):
    a, b = sorted([int(s) for s in input().split()])
    c_max = int((a * b) ** 0.5)
    if c_max * c_max == a * b:
        c_max -= 1
    sol = 2 * c_max
    if a <= c_max:
        sol -= 1
    if (c_max * c_max < a * b) and (c_max * (c_max + 1) >= a * b):
        sol -= 1
    print(sol)
Buggy python submission (verdict: Runtime Error):
# PROBLEM A
a, b, c, d = [int(v) for v in input().split()]
sol = max(a, b) + max(c, d)
print(sol)

Fixed submission:
# PROBLEM A
a, b, c, d = [int(input()) for _ in range(4)]
sol = min(a, b) + min(c, d)
print(sol)
Buggy python submission (verdict: Time Limit Exceeded):
def f(scores, d):
    if len(scores) == 1:
        if scores[0] % 10 == d:
            res = 0
        else:
            res = scores[0]
    else:
        f1 = scores[0] + f(scores[1:], get_fld(scores[0], d))
        if f1 % 10 == d:
            f1 = 0
        f2 = f(scores[1:], d)
        res = max(f1, f2)
    return res
 
def get_fld(score, d):
    res = d - score % 10
    if res < 0:
        res += 10
    return res     
 
N = int(input())
scores = []
for _ in range(N):
    scores.append(int(input()))
print(f(scores, 0))

Fixed submission:

def f(scores):
    res = sum(scores)
    if res % 10 == 0:
        candidates = list(score for score in scores if score % 10 != 0)
        if candidates:
            res -= min(candidates)
        else:
            res = 0
    return res
 
N = int(input())
scores = []
for _ in range(N):
    scores.append(int(input()))
print(f(scores))
Buggy python submission (verdict: Runtime Error):
N = int(input())
s, t = input().split()
 
ans = ''
i = j = 0
flag = True
while j < N:
    if flag:
	    ans += s[i]
        i += 1
    else:
        ans += t[j]
        j += 1
    flag = not flag

Fixed submission:
n = int(input())
s, t = input().split()

ans = ''
i = 0
flag = True

while i < n:
  if flag:
    ans += s[i]
  else:
    ans += t[i]
    i += 1
  flag = not flag
else:
  print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
s, t = input().split()
 
ans = ''
i = j = 0
flag = True
while j < N:
	if flag:
		ans += s[i]
      	i += 1
	else:
    	ans += t[j]
    	j += 1
  
	flag = not flag
else:
	print(ans)

Fixed submission:
n = int(input())
s, t = input().split()

ans = ''
i = 0
flag = True

while i < n:
  if flag:
    ans += s[i]
  else:
    ans += t[i]
    i += 1
  flag = not flag
else:
  print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
s, t = input().split()

ans = ''
i = j = 0
flag = True
while j < N:
  if flag:
	  ans += s[i]
      i += 1
  else:
      ans += t[j]
      j += 1
  
  flag = not flag


Fixed submission:
n = int(input())
s, t = input().split()

ans = ''
i = 0
flag = True

while i < n:
  if flag:
    ans += s[i]
  else:
    ans += t[i]
    i += 1
  flag = not flag
else:
  print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict


def find_distances(edge_dict, node, distances):
    for end in edge_dict[node]:
        if distances[end] < 0:
            distances[end] = distances[node] + 1
            distances = find_distances(edge_dict, end, distances)

    return distances


if __name__ == "__main__":
    V, T, A = map(int, input().split())
    T -= 1
    A -= 1
    edge_dict = defaultdict(list)

    for _ in range(V - 1):
        start, end = map(int, input().split())
        edge_dict[start - 1].append(end - 1)
        edge_dict[end - 1].append(start - 1)
    
    dist_T = [-1] * V
    dist_T[T] = 0
    dist_T = find_distances(edge_dict, T, dist_T)

    dist_A = [-1] * V
    dist_A[A] = 0
    dist_A = find_distances(edge_dict, A, dist_A)

    max_dist = 0
    for i in range(V):
        if dist_T[i] <= dist_A[i]:
            max_dist = max(max_dist, dist_A[i])
    
    print(max_dist - 1)


Fixed submission:
from collections import defaultdict

# def find_distances(edge_dict, node, distances):
#     for end in edge_dict[node]:
#         if distances[end] < 0:
#             distances[end] = distances[node] + 1
#             distances = find_distances(edge_dict, end, distances)

#     return distances


def find_distances(edge_dict, node, V):
    distances = [-1] * V
    stack = [(0, node)]

    while stack:
        dist, node = stack.pop()
        if distances[node] >= 0:
            continue

        distances[node] = dist
        for end in edge_dict[node]:
            stack.append((dist + 1, end))

    return distances

if __name__ == "__main__":
    V, T, A = map(int, input().split())
    T -= 1
    A -= 1
    edge_dict = defaultdict(list)

    for _ in range(V - 1):
        start, end = map(int, input().split())
        edge_dict[start - 1].append(end - 1)
        edge_dict[end - 1].append(start - 1)
    
    dist_T = [-1] * V
    dist_T[T] = 0
    dist_T = find_distances(edge_dict, T, V)

    dist_A = [-1] * V
    dist_A[A] = 0
    dist_A = find_distances(edge_dict, A, V)

    max_dist = 0
    for i in range(V):
        if dist_T[i] <= dist_A[i]:
            max_dist = max(max_dist, dist_A[i])
    
    print(max_dist - 1)
Buggy python submission (verdict: Runtime Error):
s = input()
 
ans = 0
for i in range(len(s)):
  for j in list(range(len(s)))[::-1]:
    if j < i:
      return ans
    else:
      if s[i] != s[j]:
        ans += 1

Fixed submission:
s = input()
ans = 0
i = 0
j = len(s) - 1
while i <= j:
    if s[i] != s[j]:
        ans += 1
    i += 1
    j -= 1
else:
    print(ans)

Buggy python submission (verdict: Runtime Error):
s = input()

ans = 0
for i in range(len(s)):
  for j in list(range(len(s)))[::-1]:
    if j < i:
      return ans
    else:
      if s[i] != s[j]:
        ans += 1

Fixed submission:
s = input()
ans = 0
i = 0
j = len(s) - 1
while i <= j:
    if s[i] != s[j]:
        ans += 1
    i += 1
    j -= 1
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
int(num),int(val) = input().split(" ")

if num < 10:
	print val + 100*(10-num)
else:
	print val


Fixed submission:
def main():
	num,val = input().split(" ")
	num = int(num)
	val = int(val)

	if num < 10:
		print(val + 100*(10-num))
	else:
		print(val)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
num = raw_input()
val = raw_input()

if int(num) < 10:
	rate = int(val) + 100*(10 - int(num))
	print	rate
else:
	rate = int(val)
	print	rate


Fixed submission:
def main():
	num,val = input().split(" ")
	num = int(num)
	val = int(val)

	if num < 10:
		print(val + 100*(10-num))
	else:
		print(val)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
def main():
	num = raw_input()
	val = raw_input()

	if int(num) < 10:
		rate = int(val) + 100*(10 - int(num))
	else:
  		rate = int(val)
	print rate
if __name__ == "__main__":
	main()

Fixed submission:
def main():
	num,val = input().split(" ")
	num = int(num)
	val = int(val)

	if num < 10:
		print(val + 100*(10-num))
	else:
		print(val)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
def main():
	num = raw_input()
	val = raw_input()

	if int(num) < 10:
		rate = val + 100*(10-num)
	else:
  		rate = int(val)
	print rate
if __name__ == "__main__":
	main()

Fixed submission:
def main():
	num,val = input().split(" ")
	num = int(num)
	val = int(val)

	if num < 10:
		print(val + 100*(10-num))
	else:
		print(val)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
a,b = (int(x) for x in input().split())
cnt = 0
for i in range(a,b+1):
    if str(i) == str(i)[::-1]:
        cnt += 1

print(cnt)


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

if a < 10000 or b > 99999:
    sys.exit(1)

cnt = 0
for i in range(a,b+1):
    if str(i) == str(i)[::-1]:
        cnt += 1

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

if A==B and B==C or A!=B and B!=C and C!=A:
    print('No')
else
    print('Yes')


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

if A==B and B==C or A!=B and B!=C and C!=A:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
S=input()

if S=="SUN":
    print('7')
elif S=="MON":
    print('6')
elif S=="TUE":
    print('5')
elif S=="WED":
    print('4')
elif S=="THU":
    print('3')
elif S=="FRI":
    print('2
elif S=="SAT":
    print('1')


Fixed submission:
S=input()

if S=="SUN":
    print('7')
elif S=="MON":
    print('6')
elif S=="TUE":
    print('5')
elif S=="WED":
    print('4')
elif S=="THU":
    print('3')
elif S=="FRI":
    print('2')
elif S=="SAT":
    print('1')
Buggy python submission (verdict: Runtime Error):
ipt=list(map(int, input().split()))

N=ipt[0]
K=ipt[1]
h=ipt[2:]

cnt=0
for n in range(N):
    if h[n]>=K:
        cnt+=1

print(cnt)


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

cnt=0
for n in range(N):
    if h[n]>=K:
        cnt+=1

print(cnt)
Buggy python submission (verdict: Runtime Error):
a,b=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき

al=factorization(a) 
bl=factorization(b)

a_s=set()
b_s=set()
for i in range(len(al)):
    a_s.add(al[i][0])
for j in range(len(bl)):
    b_s.add(bl[j][0])
    

s=a_s&b_s
    
print(len(s)+1)

Fixed submission:
"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

a,b=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき

al=factorization(a) 
bl=factorization(b)

a_s=set()
b_s=set()
for i in range(len(al)):
    a_s.add(al[i][0])
for j in range(len(bl)):
    b_s.add(bl[j][0])
    

s=a_s&b_s
s.add(1)    

print(len(s))
Buggy python submission (verdict: Runtime Error):
N,K,Q=input().split()
N=int(N)
K=int(K)
Q=int(Q)

a=[]
for q in range(Q):
    a.append(int(input()))

cnt=[0]*N
for q in range(Q):
    cnt[int(a[q])-1]+=1

'print(cnt)

for n in range(N):
    if K - (Q - cnt[n]) > 0:    
        print('Yes')
    else:
        print('No')

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

a=[]
for q in range(Q):
    a.append(int(input()))

cnt=[0]*N
for q in range(Q):
    cnt[int(a[q])-1]+=1

for n in range(N):
    if K - (Q - cnt[n]) > 0:    
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
a=[]
for q in range(Q):
    a.append(int(input()))

cnt=0
for n in range(N):
    if K - (Q - a.count(n+1)) > 0:    
        print('Yes')
    else:
        print('No')

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

a=[]
for q in range(Q):
    a.append(int(input()))

cnt=[0]*N
for q in range(Q):
    cnt[int(a[q])-1]+=1

for n in range(N):
    if K - (Q - cnt[n]) > 0:    
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
N,M,*A=input().split()  

N=int(N)
M=int(M)
a=[]
for n in range(N):
    a.append(int(A[n]) * (-1))

import heapq
import math

heapq.heapify(a)
for m in range(M):
    heapq.heappush(a,math.ceil(heapq.heappop(a)/2))   
    
print(sum(a)*(-1))

Fixed submission:
N,M,=input().split()  #複数数値入力　「A B」みたいなスペース空いた入力のとき

N=int(N)
M=int(M)

A=list(map(int, input().split()))

a=[]
for n in range(N):
    a.append(int(A[n]) * (-1))

import heapq
import math

heapq.heapify(a)
for m in range(M):
    heapq.heappush(a,math.ceil(heapq.heappop(a)/2))   
    
print(sum(a)*(-1))

Buggy python submission (verdict: Runtime Error):
N=int(N)
M=int(M)
a=[]
for n in range(N):
    a.append(int(A[n]) * (-1))

import heapq
import math

heapq.heapify(a)
for m in range(M):
    heapq.heappush(a,math.ceil(heapq.heappop(a)/2))   
    
print(sum(a)*(-1))

Fixed submission:
N,M,=input().split()  #複数数値入力　「A B」みたいなスペース空いた入力のとき

N=int(N)
M=int(M)

A=list(map(int, input().split()))

a=[]
for n in range(N):
    a.append(int(A[n]) * (-1))

import heapq
import math

heapq.heapify(a)
for m in range(M):
    heapq.heappush(a,math.ceil(heapq.heappop(a)/2))   
    
print(sum(a)*(-1))
Buggy python submission (verdict: Runtime Error):
n = int(input())
b=list(map(int, input().split())) 

sum =b[0]

if len(b) >= 2:
    for i in range(1,len(b)):
        if b[i-1]<b[i]:
            sum+=b[i-1]
        else:
            sum+=b[i]
        
sum+=b[i]
        
print(sum)

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

sum =b[0]

if len(b) >= 2:
    for i in range(1,len(b)):
        if b[i-1]<b[i]:
            sum+=b[i-1]
        else:
            sum+=b[i]
        
sum+=b[-1]
        
print(sum)

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

sum =b[0]

print(len(b))
if len(b) >= 2:
    for i in range(1,len(b)):
        if b[i-1]<b[i]:
            sum+=b[i-1]
        else:
            sum+=b[i]
        
sum+=b[i]
        
print(sum)

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

sum =b[0]

if len(b) >= 2:
    for i in range(1,len(b)):
        if b[i-1]<b[i]:
            sum+=b[i-1]
        else:
            sum+=b[i]
        
sum+=b[-1]
        
print(sum)

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

sum =b[0]
for i in range(1,len(b)):
    if b[i-1]<b[i]:
        sum+=b[i-1]
    else:
        sum+=b[i]
        
sum+=b[i]
        
print(sum)

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

sum =b[0]

if len(b) >= 2:
    for i in range(1,len(b)):
        if b[i-1]<b[i]:
            sum+=b[i-1]
        else:
            sum+=b[i]
        
sum+=b[-1]
        
print(sum)

Buggy python submission (verdict: Runtime Error):
n = int(input())
b=list(map(int, input().split())) 
  
sum =b[0]
for i in range(1,len(b)):
    if b[i-1]<b[i]:
        sum+=b[i-1]
    else:
        sum+=b[i]
        
sum+=b[i]
        
print(sum)

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

sum =b[0]

if len(b) >= 2:
    for i in range(1,len(b)):
        if b[i-1]<b[i]:
            sum+=b[i-1]
        else:
            sum+=b[i]
        
sum+=b[-1]
        
print(sum)
Buggy python submission (verdict: Runtime Error):
import math
import heapq

N=int(input[0])
V=list(map(int, input[1].split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

heapq.heapify(V)
a=heapq.heappop(V)
b=0
for i in range(len(V)):
    b=heapq.heappop(V)
    a=(a+b)/2

print(a)

Fixed submission:
import math
import heapq

N=int(input())
V=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

heapq.heapify(V)
a=heapq.heappop(V)
b=0
for i in range(len(V)):
    b=heapq.heappop(V)
    a=(a+b)/2

print(a)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input()) 
t = [int(input()) for i in range(n)] 

for j in t:
  if j != max(t):
  	print(max(t))
  else:
    print(sorted(t)[n-2])

Fixed submission:
n = int(input()) 
t = [int(input()) for i in range(n)] 

ma = max(t)
ma2 = sorted(t)[n-2]

for j in t:
  if j != ma:
  	print(ma)
  else:
    print(ma2)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input()) 
t = [int(input()) for i in range(n)] 

for j in t:
  if j != sorted(t)[n-1]:
  	print(sorted(t)[n-1])
  else:
    print(sorted(t)[n-2])

Fixed submission:
n = int(input()) 
t = [int(input()) for i in range(n)] 

ma = max(t)
ma2 = sorted(t)[n-2]

for j in t:
  if j != ma:
  	print(ma)
  else:
    print(ma2)
Buggy python submission (verdict: Runtime Error):
from collections import Counter

n=int(input())
a=list(map(int, input().split()))

flag="No"

count_by_kw = Counter()
for i in range(n):
    count_by_kw[a[i]]+=1

if count_by_kw.get(0) == n:
    flag="Yes"

if count_by_kw.get(0) == n/3 and len(count_by_kw.keys())==2:
    flag="Yes"

cl=list(count_by_kw.values())
ck=list(count_by_kw.values())

if len(cl)==3:
    if cl[0] == cl[1] and cl[1] == cl[2]:
        if ck[0]^ck[1]^ck[2]^ == 0
            flag="Yes"
        
print(flag)





Fixed submission:
from collections import Counter

n=int(input())
a=list(map(int, input().split()))

flag="No"

count_by_kw = Counter()
for i in range(n):
    count_by_kw[a[i]]+=1

if count_by_kw.get(0) == n:
    flag="Yes"

if count_by_kw.get(0) == n/3 and len(count_by_kw.keys())==2:
    flag="Yes"

cl=list(count_by_kw.values())
ck=list(count_by_kw.keys())

if len(cl)==3:
    if cl[0] == cl[1] and cl[1] == cl[2]:
        xor = ck[0]^ck[1]^ck[2]
        if xor == 0:
            flag="Yes"
        
print(flag)
Buggy python submission (verdict: Runtime Error):
N,L=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき

aji=0
eat=99999

for i in range(1,N+1):
    aji=aji+i+L-1
    if abs(aji) < abs(eat):
        eat = aji
        
print(aji)

Fixed submission:
S=input()

hantei="Good"

for i in range(3):
    if S[i] == S[i+1]:
        hantei="Bad"
        
print(hantei)
Buggy python submission (verdict: Runtime Error):
aji=0
eat=99999

for i in range(1,N+1):
    aji=aji+i+L-1
    if abs(aji) < abs(eat):
        eat = aji
        
print(aji)

Fixed submission:
N,L=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき

aji_sum=0
eat=99999

for i in range(1,N+1):
    
    aji_sum=aji_sum+i+L-1
    if abs(i+L-1) < abs(eat):
        eat = i+L-1

print(aji_sum-eat)
Buggy python submission (verdict: Runtime Error):
import math

a,b,c,d=map(int,input().split())
cnt=0

cc=b//c-(a-1)//c
dd=b//d-(a-1)//d
ee=b//(c * d // math.gcd(c, d))-(a-1)//(c * d // math.gcd(c, d))
    
print(cc,dd,ee)
print((b-a+1)-(cc+dd-ee))

Fixed submission:
import fractions

a,b,c,d=map(int,input().split())
cnt=0

cc=b//c-(a-1)//c
dd=b//d-(a-1)//d
ee=b//(c * d // fractions.gcd(c, d))-(a-1)//(c * d // fractions.gcd(c, d))
    
print((b-a+1)-(cc+dd-ee))
Buggy python submission (verdict: Runtime Error):
#
import sys

n,x=map(int, input().split())
L=list(map(int, input().split()))  

d=0
b=0
for i in range(n+1):
    d=d+L[i]
    b+=1
    
    if d > x:
        print(b)
        sys.exit()

Fixed submission:
#
import sys

n,x=map(int, input().split())
L=list(map(int, input().split()))  

d=0
b=0
for i in range(n):
    d=d+L[i]
    b+=1
    if d > x:
        print(b)
        sys.exit()    
    
print(b+1)
Buggy python submission (verdict: Runtime Error):
import math
import heapq
import sys
from collections import Counter
import numpy as np
import datetime

#N,K=map(int, input[0].split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input[1].split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
#s = [input() for i in range(3)]

N,K=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき

a=1/N*((1/2)**math.ceil(math.log2(K)))
sum=0
for n in range(1,N+1):
    if n<K:
        sum+=a*(2**(n-1))
    else:
        sum+=1/N
print(sum)
    

Fixed submission:
import math
import heapq
import sys
from collections import Counter
import numpy as np
import datetime

#N,K=map(int, input[0].split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input[1].split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
#s = [input() for i in range(3)]

N,K=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき

sum=0
for n in range(1,N+1):
    if n<K:
        sum+=1/N*((1/2)**math.ceil(math.log2(K/n)))
    else:
        sum+=1/N
print(sum)