Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# ans

N = int(input())
a = list(map(int, input().split()))
print(sum(a) = N)

Fixed submission:
# ans

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

ans = 0

for i in range(N):
  ans += a[i] - 1
  
print(ans)

Buggy python submission (verdict: Runtime Error):
# ans

N = int(input())
a = list(map(int, input().split()))
print(sum(a) = N)

Fixed submission:
# ans

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

ans = 0

for i in range(N):
  ans += a[i] - 1
  
print(ans)

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

ans = 0

for m in range(2, 10000000):
  s = 0
  for i in range(N):
    s += m % a[i]
  ans = max(s, ans)
  
print(ans)

Fixed submission:
# ans

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

ans = 0

for i in range(N):
  ans += a[i] - 1
  
print(ans)
Buggy python submission (verdict: Runtime Error):

Copy
Copy
A, B = map(int, input().split())
 
if A <= 8 and B <= 8:
  print('Yay!')
else:
  print(':(')

Fixed submission:
A, B = map(int, input().split())
 
if A <= 8 and B <= 8:
  print('Yay!')
else:
  print(':(')

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

if a <= 8 and b <= 8:
  print('Yay!')
else:
  print(':(')

Fixed submission:
A, B = map(int, input().split())
 
if A <= 8 and B <= 8:
  print('Yay!')
else:
  print(':(')
Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())
ans = 0

for i in range(1, 1001):
  for j in range(2, 1001):
    num = i ** j
    if num < X:
      break
    ans = num

print(ans)

Fixed submission:
X = int(input())
ans = 1

for i in range(1, X+1):
  for j in range(2, X+1):
    num = i ** j
    if num > X:
      break
    if num >= ans: 
      ans = num

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())
ans = 0

for i in range(1, 1001):
  for j in range(2, 1001):
    num = i ** j
    if num >= ans and num <= X:
      ans = num

print(ans)

Fixed submission:
X = int(input())
ans = 1

for i in range(1, X+1):
  for j in range(2, X+1):
    num = i ** j
    if num > X:
      break
    if num >= ans: 
      ans = num

print(ans)
Buggy python submission (verdict: Runtime Error):
N = input()

if N[0] =- N[2]:
  print('Yes')
else:
  print('No')

Fixed submission:
N = input()

if N[0] == N[2]:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
S = input()

while True:
  if S[0:len(S)//2] == S[len(S)//2:len(S)-1]:
    print(len(S))
  else:
    tmp = S[0:len(S)-2]
    S = tmp

Fixed submission:
S = input()
cnt = 0

for i in range(len(S)):
  if S[0:len(S)//2] == S[len(S)//2:len(S) + 1] and cnt != 0:
    print(len(S))
    exit()
  else:
    cnt += 1
    S = S[0:len(S) - 1]
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = [int(input()) for _ in range(N)]
cnt = 1

for i in range(N+1):
  nxt = a[i]-1
  cnt += 1
  if a[nxt] == 2:
    print(cnt)
    exit()
  else:
    nxt = a[i] - 1

print(-1)

Fixed submission:
N = int(input())
a = [int(input()) for _ in range(N)]
nxt = a[0]-1
cnt = 1
if a[0]-1 == 1:
  print(cnt)
  exit()

for i in range(1, N+1):
  if a[nxt] == 2:
    cnt += 1
    print(cnt)
    exit()
  else:
    nxt = a[nxt] - 1
    cnt += 1
else:    
  print(-1)

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = [int(input()) for _ in range(N)]
light = 1
cnt = 0

for i in range(N):
  if i == 0:
    nxt = a[0] - 1
  else:
    nxt = a[nxt]
    
  if nxt == 2:
    break
  else:
    cnt += 1

print(cnt)

Fixed submission:
N = int(input())
a = [int(input()) for _ in range(N)]
nxt = a[0]-1
cnt = 1
if a[0]-1 == 1:
  print(cnt)
  exit()

for i in range(1, N+1):
  if a[nxt] == 2:
    cnt += 1
    print(cnt)
    exit()
  else:
    nxt = a[nxt] - 1
    cnt += 1
else:    
  print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N = int(input())
S = [int(input()) for _ in range(N)]
ans = 0

for i in range(N+1):
  c = itertools.combinations(S, i)
  for s in c:
    sn = list(s)
    if sum(sn) % 10 != 0:
      ans = max(ans, sum(sn))
      
print(ans)

Fixed submission:
import itertools

N = int(input())
S = [int(input()) for _ in range(N)]
ans = 0

for i in range(N-1,N+1):
  c = itertools.combinations(S, i)
  for s in c:
    sn = list(s)
    if sum(sn) % 10 != 0:
      ans = max(ans, sum(sn))
      
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())

if A == B:
  print('EQUAL')
elif A > B:
  print('GREATER')
else:
  print('LESS')

Fixed submission:
A = int(input())
B = int(input())

if A == B:
  print('EQUAL')
elif A > B:
  print('GREATER')
else:
  print('LESS')
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
h = int(input())

print({a + b} * h // 2)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
 
print((a + b) * h // 2)
Buggy python submission (verdict: Runtime Error):
phrases = map(int, input().split())
phrases.sort(reverse=True)

if phrases == [7,5,5]:
  print('YES')
else:
  print('NO')

Fixed submission:
phrases = input().split()
phrases.sort(reverse=True)

if phrases == ['7', '5', '5']:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
x = int(input())
n = int(input())

p = []
for i in range(n):
    p.append(int(input()))

for i in range(100):
    if (x - i) not in p:
        print(x - i)
        break
    elif (x + i) not in p:
        print(x + i)
        break
    else:
        continue

Fixed submission:
str1 = input()
lst1 = str1.split()
x = int(lst1[0])
n = int(lst1[1])

string = input()
list = string.split()
p = []
for num in list:
    p.append(int(num))

for i in range(100):
    if (x - i) not in p:
        print(x - i)
        break
    elif (x + i) not in p:
        print(x + i)
        break
    else:
        continue

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

p = []
for i in range(n):
    p.append(int(input()))

for i in range(100):
    if (x - i) not in p:
        print(x - i)
        exit()
    elif (x + i) not in p:
        print(x + i)
        exit()
    else:
        continue

Fixed submission:
str1 = input()
lst1 = str1.split()
x = int(lst1[0])
n = int(lst1[1])

string = input()
list = string.split()
p = []
for num in list:
    p.append(int(num))

for i in range(100):
    if (x - i) not in p:
        print(x - i)
        break
    elif (x + i) not in p:
        print(x + i)
        break
    else:
        continue
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=[0]
c=0
l.append(map(int,input().split()))
for i in range(1,n+1,2):
  if l[i]&1:
    c+=1
print(c)

Fixed submission:
n=int(input())
l=[0]
c=0
l=l+(list(map(int,input().split())))

try:
  for i in range(1,n+1,2):
    if l[i]&1:
      c+=1
except:
  pass
print(c)
Buggy python submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
l=[]
p=A
q=B
if A>B:
    A=q
    B=p
for i in range(1,B+1):
    if A%i==0 and B%i==0:
        l.append(i)

print(l[K-1])


Fixed submission:
A,B,C=map(int,input().split())
p=B//A
if p>=C:
  print(C)
else:
  print(p)

Buggy python submission (verdict: Runtime Error):
A,B,C=map(int(input().split()))
p=B//A
if p>=C:
  print(C)
else:
  print(p)

Fixed submission:
A,B,C=map(int,input().split())
p=B//A
if p>=C:
  print(C)
else:
  print(p)
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
p=0
c=0
while p<len(s)-1:
    if (s[p]=='0' and s[p+1]=='1') or (s[p]=='1' and s[p+1]=='0'):
        s=s[:p]+s[p+2:]
        
        c+=2
        p=0
    else:
        p+=1
print(c)


Fixed submission:
s=input()
a=s.count('0')
b=s.count('1')
if a>=b:
    print(b*2)
else:
    print(a*2)
Buggy python submission (verdict: Runtime Error):
x = int(input())
n = [i**5 for i in range(63+1)]

a = 0
b = 0
res = False
i = 0
while not res:
    sign = 1 - 2*(n[i] < x)
    for j in range(i+1):
        if (n[i] - n[j] * sign) == x:
            print(i,j*sign)
            res = True
    i += 1

Fixed submission:
x = int(input())
n = [i**5 for i in range(119+1)]

a = 0
b = 0
res = False
i = 0
while not res:
    sign = 1 - 2*(n[i] < x)
    for j in range(i+1):
        if (n[i] - n[j] * sign) == x:
            print(i,j*sign)
            res = True
    i += 1

Buggy python submission (verdict: Runtime Error):
x = int(input())
n = [i**5 for i in range(63)]

a = 0
b = 0
res = False
i = 0
while not res:
    sign = 1 - 2*(n[i] < x)
    for j in range(i+1):
        if (n[i] - n[j] * sign) == x:
            print(i,j*sign)
            res = True
    i += 1

Fixed submission:
x = int(input())
n = [i**5 for i in range(119+1)]

a = 0
b = 0
res = False
i = 0
while not res:
    sign = 1 - 2*(n[i] < x)
    for j in range(i+1):
        if (n[i] - n[j] * sign) == x:
            print(i,j*sign)
            res = True
    i += 1

Buggy python submission (verdict: Runtime Error):
x = int(input())
n = [i**5 for i in range(63)]

a = 0
b = 0
for i in range(len(n)-1):
    now = abs(n[i]-x)
    next = abs(n[i+1]-x)
    if (now<next) or (i+1 == len(n)-1):
        a = i
        break

sign = 1 - 2*(n[a] < x)
pos = 0
while True:
    if (n[a] - n[pos]*sign) == x: 
        b = pos
        break
    pos += 1
print(a,b*sign)
        


Fixed submission:
x = int(input())
n = [i**5 for i in range(119+1)]

a = 0
b = 0
res = False
i = 0
while not res:
    sign = 1 - 2*(n[i] < x)
    for j in range(i+1):
        if (n[i] - n[j] * sign) == x:
            print(i,j*sign)
            res = True
    i += 1
Buggy python submission (verdict: Time Limit Exceeded):
a,b,n = list(map(int, input().split()))
fnc = lambda x: int(a*x/b) - a*int(x/b)
prev = 0
for i in range(n+1):
    now = fnc(i)
    if prev > now:
        print(prev)
        break
    elif i == n:
        print(now)
        break
    prev = now

Fixed submission:
a,b,n = list(map(int, input().split()))
if n < b:
    print(int(a/b * n))
else:
    print(int(a/b * (b-1)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
d = []
for i in range(n):
    s = input()
    if not(s in d): d.append(s)

print(len(d))



Fixed submission:
S,W = list(map(int,input().split()))
if W >= S:print('unsafe')
else: print('safe')

Buggy python submission (verdict: Runtime Error):
if W >= S:print('unsafe')
else: print('safe')

Fixed submission:
S,W = list(map(int,input().split()))
if W >= S:print('unsafe')
else: print('safe')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
d = []
for i in range(n):
    s = input()
    if not(s in d): d.append(s)

print(len(d))



Fixed submission:
n = int(input())
d = {}
for i in range(n):
    s = input()
    if not(s in d): d[s] = 1

print(len(d))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
s = list(input() for i in range(n))
s = np.array(s)
i = 0
while 0 < (len(s)):
    s = s[s != s[0]] 
    i += 1
print(i)




Fixed submission:
n = int(input())
d = {}
for i in range(n):
    s = input()
    if not(s in d): d[s] = 1

print(len(d))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
count = 0
for i in range(n):
    a = input()
    if not(a in s):
        s.append(a)
        count += 1
print(count)

Fixed submission:
n = int(input())
d = {}
for i in range(n):
    s = input()
    if not(s in d): d[s] = 1

print(len(d))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for i in range(n):
    a = input()
    if not(a in s):
        s.append(a)
print(len(s))




Fixed submission:
n = int(input())
d = {}
for i in range(n):
    s = input()
    if not(s in d): d[s] = 1

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

N = int(input())
A = np.array(input().split()).astype(float)

res = np.sum(A == np.arange(1,N+1).reshape(N,1), axis= 1)
for i in range(N):
    print(res[i])

Fixed submission:
import numpy as np

N = int(input())
A = np.array(input().split()).astype(int)

# res = np.sum(A == np.arange(1,N+1).reshape(N,1), axis= 1)
res = np.zeros(N).astype(int)
for i in range(N-1):
    res[A[i]-1] += 1
for i in range(N):
    print(res[i])

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

N = int(input())
A = np.array(input().split()).astype(int)

res = np.sum(A == np.arange(1,N+1).reshape(N,1), axis= 1)
for i in range(N):
    print(res[i])

Fixed submission:
import numpy as np

N = int(input())
A = np.array(input().split()).astype(int)

# res = np.sum(A == np.arange(1,N+1).reshape(N,1), axis= 1)
res = np.zeros(N).astype(int)
for i in range(N-1):
    res[A[i]-1] += 1
for i in range(N):
    print(res[i])

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

N = int(input())
A = np.array(input().split()).astype(int)

res = np.sum(A == np.arange(1,N+1).reshape(N,1), axis= 1)
for i in range(N):
    print(res[i])

Fixed submission:
import numpy as np

N = int(input())
A = np.array(input().split()).astype(int)

# res = np.sum(A == np.arange(1,N+1).reshape(N,1), axis= 1)
res = np.zeros(N).astype(int)
for i in range(N-1):
    res[A[i]-1] += 1
for i in range(N):
    print(res[i])
Buggy python submission (verdict: Runtime Error):
nums = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(nums[int(input())+1])

Fixed submission:
nums = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(nums[int(input())-1])

Buggy python submission (verdict: Runtime Error):
nums = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(nums[input()+1])

Fixed submission:
nums = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(nums[int(input())-1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
string = [0 for i in range(N)]
calc_str = lambda :"".join(list(chr(i+ord('a')) for i in string))
chr_a = ord('a')
print(calc_str())
now = N-2


while True:
    if string[now+1]-max(string[:now+1]) > 0:
        if now == 0: break
        string[now+1] = 0
        now -= 1
        
    else:
        string[now+1] += 1
        now = N-2

        print(calc_str())

Fixed submission:
N = int(input())
string = [0 for i in range(N)]
calc_str = lambda :"".join(list(chr(i+ord('a')) for i in string))
chr_a = ord('a')
print(calc_str())
now = N-2


while N > 1:
    if string[now+1]-max(string[:now+1]) > 0:
        if now == 0: break
        string[now+1] = 0
        now -= 1
        
    else:
        string[now+1] += 1
        now = N-2

        print(calc_str())

Buggy python submission (verdict: Runtime Error):
N = int(input())
string = [0 for i in range(N)]
calc_str = lambda :"".join(list(chr(i+ord('a')) for i in string))
chr_a = ord('a')
print(calc_str())
now = N-2


while True:
    if string[now+1]-string[now] > 0:
        if now == 0: break
        string[now+1] = 0
        now -= 1
        
    else:
        string[now+1] += 1
        now = N-2

        print(calc_str())

Fixed submission:
N = int(input())
string = [0 for i in range(N)]
calc_str = lambda :"".join(list(chr(i+ord('a')) for i in string))
chr_a = ord('a')
print(calc_str())
now = N-2


while N > 1:
    if string[now+1]-max(string[:now+1]) > 0:
        if now == 0: break
        string[now+1] = 0
        now -= 1
        
    else:
        string[now+1] += 1
        now = N-2

        print(calc_str())
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input()) 
A=list(map(int,input().split()))
a=[]
for i in range(N):   
    if A[i] in a:
        print("NO")
        break

    else:
        a.append(A[i])
        if i==N-1:print('YES')

Fixed submission:
N=int(input()) 
A=sorted(list(map(int,input().split())))
a=[]
for i in range(N-1):   
    if A[i]==A[i+1]:
        print("NO") 

        break
    elif i==N-2:print("YES")
Buggy python submission (verdict: Runtime Error):
n = int(input())
ns = input().split()
a = eval('^'.join(ns))
print(*[a^int(i) for i in ns])

Fixed submission:
n = int(input())
ns = list(map(int, input().split()))
a = ns[0]
for i in range(1, n):
    a = a^ns[i]
print(*[a^int(i) for i in ns])
Buggy python submission (verdict: Time Limit Exceeded):
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result
n, m, k = map(int, input().split())
ans = 0
for i in range(k + 1):
    ans = (ans + m * pow(m - 1, n - 1 - i, 998244353) * cmb(n-1,i)) % 998244353
print(ans)


Fixed submission:
n, m, k = map(int, input().split())
ans = 0
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 998244353
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]

for i in range( 2, n + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
for i in range(k + 1):
    ans = (ans + m * pow(m - 1, n - 1 - i, mod) * cmb(n-1,i, mod)) % mod
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
s = input()
n = len(s)
dp = [0]
mod = 2019
a = 0
for i in range(n):
    a += int(s[n-i-1]) * 10 ** i
    dp.append(a%mod)
ans = 0
c = Counter(dp)
for value in c.values():
    ans += value * (value-1) / 2
print(int(ans))

Fixed submission:
from collections import Counter
s = input()
n = len(s)
dp = [0]
mod = 2019
a = 0
for i in range(n):
    a = a + int(s[n-i-1]) * pow(10, i, mod)
    a %= mod
    dp.append(a%mod)
ans = 0
c = Counter(dp)
for value in c.values():
    ans += value * (value-1) / 2
print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
from math import gcd
from functools import reduce
def gcd_list(xs):
    return reduce(gcd, xs)

n = int(input())
a = 0
for i in range(1, n+1):
    for j in range(1, n+1):
        for k in range(1, n+1):
            a += gcd_list([i,j,k])
print(a)

Fixed submission:
from math import gcd

n = int(input())
a = 0
for i in range(1, n+1):
    for j in range(1, n+1):
        b = gcd(i, j)
        for k in range(1, n+1):
            a += gcd(k, b)
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
n, x, y = map(int, input().split())
for k in range(1, n):
    min_combi_set = list()
    for i in range(1, n+1):
        for j in range(1, i):
            min_distance = min(abs(i-j), abs(x-i) + 1 + abs(j-y),abs(y-i) + 1 + abs(x-j))
            if min_distance == k:
                min_combi_set.append({i, j})
    print(len(min_combi_set))


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

count = {k:0 for k in range(1, n)}
for i in range(1, n+1):
    for j in range(1, i):
        k = min(abs(i-j), abs(x-i) + 1 + abs(j-y),abs(y-i) + 1 + abs(x-j))
        count[k] += 1
for i in count.values():
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
nums = list(map(int, input().split()))
nums_count_dict = {number: nums.count(number) for number in set(nums)}
nums_count_combi = {number: nums_count_dict[number]*(nums_count_dict[number]-1)/2 for number in set(nums)}
total = sum(nums_count_combi.values())
for number in nums:
    print(int(total-nums.count(number)+1))


Fixed submission:
from collections import Counter
n = int(input())
nums = list(map(int, input().split()))
nums_count_dict = Counter(nums)
nums_count_combi = {key: value*(value-1)/2 for key, value in nums_count_dict.items()}
total = sum(nums_count_combi.values())
for number in nums:
    print(int(total-nums_count_dict[number]+1))
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())
is_reverse = 0
for i in range(q):
    query = input()
    if query[0] == '1':
        is_reverse = (is_reverse+1) % 2
    else:
        _, f, c = query.split()
        if (is_reverse+int(f))%2 == 0:
            s += c
        else:
            s = c + s
if is_reverse:
    print(s[::-1])
else:
    print(s)

Fixed submission:
s = input()
q = int(input())
is_reverse = 0
left = ''
for i in range(q):
    query = input()
    if query[0] == '1':
        is_reverse = (is_reverse+1) % 2
    else:
        _, f, c = query.split()
        if (is_reverse+int(f))%2 == 0:
            s += c
        else:
            left += c
s = left[::-1] + s
if is_reverse:
    print(s[::-1])
else:
    print(s)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())
for i in range(q):
    query = input()
    if query[0] == '1':
        s = s[::-1]
    else:
        _, f, c = query.split()
        if f == '1':
            s = c + s
        else:
            s += c
print(s)

Fixed submission:
s = input()
q = int(input())
is_reverse = 0
left = ''
for i in range(q):
    query = input()
    if query[0] == '1':
        is_reverse = (is_reverse+1) % 2
    else:
        _, f, c = query.split()
        if (is_reverse+int(f))%2 == 0:
            s += c
        else:
            left += c
s = left[::-1] + s
if is_reverse:
    print(s[::-1])
else:
    print(s)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n = len(set(input().split())):
    print('YES')
else:
    print('NO')

Fixed submission:
n = int(input())
if n == len(set(input().split())):
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
ps = list(map(int, input().split()))
ex = list(map(lambda x:(1+x)/2, ps))
sums = [sum(ex[i:i+k]) for i in range(n-k+1)]
print(max(sums))

Fixed submission:
n, k = map(int, input().split())
ns = list(map(int, input().split()))
cnt = sum(ns[:k])
max_cnt = cnt
for i in range(n - k):
    cnt += ns[i+k]
    cnt -= ns[i]
    max_cnt = max(max_cnt, cnt)
print((max_cnt+k)/2)
Buggy python submission (verdict: Runtime Error):
n, k, s = map(int, input().split())
if s != 10 ** 9:
    print(*[s if i < k else s + 1 for i in range(n)])
else:
    print(*[s if i < k else 1 for i in range(n)]))

Fixed submission:
n, k, s = map(int, input().split())
if s != 10 ** 9:
    print(*[s if i < k else s + 1 for i in range(n)])
else:
    print(*[s if i < k else 1 for i in range(n)])