Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

n, x = map(int, input().split())
num = list(map(int,input().split()))
d = num[0]-x
for nn in num:
    d=gcd(t,n-x)
print(d)

Fixed submission:
import fractions

n, x = map(int, input().split())
num = list(map(int,input().split()))
d = abs(num[0]-x)
for nn in num:
	d=fractions.gcd(d, abs(nn-x))
print(d)

Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

n, x = map(int, input().split())
num = list(map(int,input().split()))
d = abs(num[0]-x)
for nn in num:
    d=gcd(t,abs(n-x))
print(d)

Fixed submission:
import fractions

n, x = map(int, input().split())
num = list(map(int,input().split()))
d = abs(num[0]-x)
for nn in num:
	d=fractions.gcd(d, abs(nn-x))
print(d)

Buggy python submission (verdict: Runtime Error):
# math.gcd()を使う
import math
N, X = map(int, input().split())
# 一行の入力をリストxに入れる
x = list(map(int, input().split()))
# すべての(x[i]-X)の最大公約数が答え
# 最初の最大公約数
t = abs(x[0] - X)
for a in x:
    # 最大公約数を更新
    t = math.gcd(t, abs(a - X))
print(t)


Fixed submission:
import fractions

n, x = map(int, input().split())
num = list(map(int,input().split()))
d = abs(num[0]-x)
for nn in num:
	d=fractions.gcd(d, abs(nn-x))
print(d)

Buggy python submission (verdict: Runtime Error):
import math

n, x = map(int, input().split())
num = list(map(int,input().split()))
d = abs(num[0]-x)
for nn in num:
    d=math.gcd(t,abs(n-x))
print(d)

Fixed submission:
import fractions

n, x = map(int, input().split())
num = list(map(int,input().split()))
d = abs(num[0]-x)
for nn in num:
	d=fractions.gcd(d, abs(nn-x))
print(d)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import math
from functools import reduce

n, x = map(int, input().split())
num = list(map(int,input().split()))
nxx = np.array([x] * n)
nnum = np.array(num)
diff = nnum-nxx
d = reduce(math.gcd, diff)
print(d)

Fixed submission:
import fractions

n, x = map(int, input().split())
num = list(map(int,input().split()))
d = abs(num[0]-x)
for nn in num:
	d=fractions.gcd(d, abs(nn-x))
print(d)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
lst = list(map(int, input().split()))
imod = []
for i in range(n):
    imod = imod + [sum(lst[0:i]) % m]
imod = imod + [sum(lst) % m]
s = 0
for i in range(n):
    for j in range(i+1,n+1):
        if imod[i] == imod[j]:
            s = s + 1
print(s)

Fixed submission:
n, m = map(int, input().split())
lst = list(map(int, input().split()))
dp = {}
dp[0] = 1
a, s = 0, 0
for i in lst:
    a += i
    a %= m
    if a in dp:
        s += dp[a]
        dp[a] += 1
    else:
        dp[a] = 1
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
lst = list(map(int, input().split()))
s = 0
for i in range(n):
    for j in range(i+1,n+1):
        if sum(lst[i:j]) % m == 0:
            s = s + 1
print(s)

Fixed submission:
n, m = map(int, input().split())
lst = list(map(int, input().split()))
dp = {}
dp[0] = 1
a, s = 0, 0
for i in lst:
    a += i
    a %= m
    if a in dp:
        s += dp[a]
        dp[a] += 1
    else:
        dp[a] = 1
print(s)
Buggy python submission (verdict: Runtime Error):
import math as ma
n=int(input())
print(2*n*ma.pi)
return 0

Fixed submission:
import math as ma
n=int(input())
print(2*n*ma.pi)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split(" "))
print(max(0a-*b))

Fixed submission:
a,b=map(int,input().split(" "))
print(max(0,a-2*b))
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
sub=set()
for i in range(len(s)):
    for j in range(i,len(s)+1):
        f=s[i:j]
        if f!='':
            sub.add(f)
S=list(sub)
k=int(input())
print(sorted(S)[k-1])


Fixed submission:
s=input()
sub=set()
for i in range(len(s)):
    for j in range(i,min(i+6,len(s)+1)):
        f=s[i:j]
        if f!='':
            sub.add(f)
S=list(sub)
k=int(input())
print(sorted(S)[k-1])
Buggy python submission (verdict: Runtime Error):
print(len(set(input() for i in range(int(input()))))

Fixed submission:
print(len(set(input() for i in range(int(input())))))
Buggy python submission (verdict: Runtime Error):
A,B= map(int, input().split(" "))
S=input()
if S[3]=="-" and len(S)==A+B+1:
    print("Yes")
else:
    print("No")

Fixed submission:
# Your code here!
A,B= map(int, input().split(" "))
S=input()
n=S.count("-")
if S[A]=="-" and len(S)==A+B+1 and n==1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
if input().startwith("YAKI"):
  print("Yes")
else:
  print("No")

Fixed submission:
if input().startswith("YAKI"):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
import math
x,a,b = map(int,input().split(' '))
c = a-x
d = b-x

e = abs(c)
d = abs(d)

if e<f:
	print('A')
else:
	print('B')


Fixed submission:
x,a,b = map(int,input().split(' '))
c = a-x
d = b-x

if c<0:
	e = -c
else:
	e = c

if d<0:
	f = -d
else:
	f = d


if e<f:
	print('A')
else:
	print('B')
Buggy python submission (verdict: Runtime Error):
S = str(input)
alpha = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

S.sort()
n = 0
m = 0

for i in range(len(S)):
	if S[n] not in alpha:
		print(S[n])
		break
	n += 1

	if n = len(S) - 1:
		m = 1

if m == 1:
	print('None')

Fixed submission:
S = str(input())
alpha = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

n = 0

for i in range(26):

	if alpha[n] not in S:
		print(alpha[n])
		break
	if n == 25:
		print("None")
		break
		
	n += 1

Buggy python submission (verdict: Runtime Error):
S = str(input)
alpha = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

al = []

n = len(S)
n2 = 0

for i in range(n):
	if S[n2] in alpha:
		al.append(S[n2])
	n2 += 1

m = len(al)
n2 = 0

for j in range(m):
	numi = alpha.index(al[n2])
	del alpha[numi]
	n2 += 1

if len(alpha) == 0:
	print('None')
else:
	print(alpha[0])

Fixed submission:
S = str(input())
alpha = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

n = 0

for i in range(26):

	if alpha[n] not in S:
		print(alpha[n])
		break
	if n == 25:
		print("None")
		break
		
	n += 1

Buggy python submission (verdict: Runtime Error):
S = str(input)
alpha = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

al = []

n = len(S)
n2 = 0

for i in range(n):
	if S[n2] in alpha:
		al.append(S[n2])
	n2 += 1

m = len(al)
n2 = 0

for i in range(m):
	numi = alpha.index(al[n2])
	del alpha[numi]
	n2 += 1

print(alpha[0])	

Fixed submission:
S = str(input())
alpha = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

n = 0

for i in range(26):

	if alpha[n] not in S:
		print(alpha[n])
		break
	if n == 25:
		print("None")
		break
		
	n += 1
Buggy python submission (verdict: Runtime Error):
n=int(input())
a_list=[int(i) for i in input().split(' ')]

c = collections.Counter(a_list)
[print(c[i+1]) for i in range(n)]

Fixed submission:
n=int(input())
a_list=[int(i) for i in input().split(' ')]

import collections

c = collections.Counter(a_list)
[print(c[i+1]) for i in range(n)]

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

[print(a_list.count(i+1)) for i in range(n-1)]
print(0)

Fixed submission:
n=int(input())
a_list=[int(i) for i in input().split(' ')]

import collections

c = collections.Counter(a_list)
[print(c[i+1]) for i in range(n)]

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

slaves=[print(a_list.count(i+1)) for i in range(n-1)]
print(0)

Fixed submission:
n=int(input())
a_list=[int(i) for i in input().split(' ')]

import collections

c = collections.Counter(a_list)
[print(c[i+1]) for i in range(n)]

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

slaves=[str(a_list.count(i+1)) for i in range(n-1)]+[str(0)]
print('\n'.join(slaves))

Fixed submission:
n=int(input())
a_list=[int(i) for i in input().split(' ')]

import collections

c = collections.Counter(a_list)
[print(c[i+1]) for i in range(n)]
Buggy python submission (verdict: Runtime Error):
answer='No'
for i in str(N):
  if i=='7':
    answer='Yes'
return answer

Fixed submission:
n=input()

if '7' in str(n):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
answer='No'
for i in str(N):
  if i==7:
    print(answer)
return answer

Fixed submission:
n=input()

if '7' in str(n):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n=input()

sum=0

for i in int(n):
  if (i%3!=0)&(i%5!=0):
    sum+=i
print(sum)

Fixed submission:
n=input()
 
sum=0
 
for i in range(1,int(n)+1):
  if (i%3!=0)&(i%5!=0):
    sum+=i
    
print(sum)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
if N%500 =< A:
  print('Yes')
else:
  print('No')

Fixed submission:
N = int(input())
A = int(input())
if N%500 <= A:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
N, A = map(int, input().split('\n'))
a = N % 500
if a%A==0:
  print('Yes')
else:
  print('No')

Fixed submission:
N = int(input())
A = int(input())
if N%500 <= A:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
c = a*b
if c % 2 == 0:
  print('Even')
else:
  print('Odd')

Fixed submission:
a,b=map(int,input().split())
if a*b % 2 == 0:
  print('Even')
else:
  print('Odd')

Buggy python submission (verdict: Runtime Error):
c = a*b
if c % 2 == 0:
  print('Even')
else:
  print('Odd')


Fixed submission:
a,b=map(int,input().split())
if a*b % 2 == 0:
  print('Even')
else:
  print('Odd')

Buggy python submission (verdict: Runtime Error):
c = a*b
if c // 2 == 0:
  print('Even')
else:
  print('Odd')

Fixed submission:
a,b=map(int,input().split())
if a*b % 2 == 0:
  print('Even')
else:
  print('Odd')
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
if (a+b) % 2 = 0:
  print(int((a+b)/2))
else:
  print(int((a+b)/2)+1)

Fixed submission:
a,b = map(int, input().split())
if (a+b) % 2 == 0:
  print(int((a+b)/2))
else:
  print(int((a+b)/2)+1)
Buggy python submission (verdict: Runtime Error):
l = list[map(int,input().split())]
if (10*l[1]+l[2])%4==0:
  print('YES')
else:
  print('NO')

Fixed submission:
l = list(map(int,input().split()))
if (10*l[1]+l[2])%4==0:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
import sys

s=input()

for i in range(len(s)):
  if i%2==0:
    if s[i]==="L":
      print("No")
      sys.exit()
      
  else:
    if s[i]=="R":
      print("No")
      sys.exit()
      
print("Yes")

    
        
      


Fixed submission:
import sys

s = input()

for i in range(len(s)):
    if i%2 == 0:
        if s[i] == "L":
            print("No")
            sys.exit()
            
    else:
        if s[i] == "R":
            print("No")
            sys.exit()
print("Yes")

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

for i in range(len(s)):
  if i%2==0:
    if s[i]==="L":
      print("No")
      sys.exit()
      
  else:
    if s[i]=="R":
      print("No")
      sys.exit()
      
print("Yes")

    
        
      

Fixed submission:
import sys

s = input()

for i in range(len(s)):
    if i%2 == 0:
        if s[i] == "L":
            print("No")
            sys.exit()
            
    else:
        if s[i] == "R":
            print("No")
            sys.exit()
print("Yes")
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))

ans=0
pre=-1

for i in a:
  ans += b[i-1]
  if(i==pre+1):
    ans += c[i-2]
  pre=i
  
print(ans)

Fixed submission:
n=int(input())
print(n**3)
Buggy python submission (verdict: Runtime Error):
a = input()
s = input()
  if a >= 3200:
  	print("red")
  else:
    print(s)

Fixed submission:
a = int(input())
s = input()
if a >= 3200:
  print(s)
else:
  print("red")
Buggy python submission (verdict: Runtime Error):
if len(S) == 6 and S[2]==S[3] and S[4]==S[5]: print('Yes')
else: print('No')

Fixed submission:
S = input()

if len(S) == 6 and S[2]==S[3] and S[4]==S[5]: print('Yes')
else: print('No')

Buggy python submission (verdict: Runtime Error):
def coffee():
    if len(S) == 6 and S[2]==S[3] and S[4]==S[5]:
        return 'Yes'

coffee()

Fixed submission:
S = input()

if len(S) == 6 and S[2]==S[3] and S[4]==S[5]: print('Yes')
else: print('No')

Buggy python submission (verdict: Runtime Error):
if len(S) == 6 and S[2]==S[3] and S[4]==S[5]:
    print("Yes")

Fixed submission:
S = input()

if len(S) == 6 and S[2]==S[3] and S[4]==S[5]: print('Yes')
else: print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import math

K = int(input())
ans = 0
for i in range(K):
    for j in range(K):
        for k in range(K):
            gcd_0 = math.gcd(i+1,j+1)
            ans += math.gcd(gcd_0,k+1)

print(ans)

Fixed submission:
import math

K = int(input())
ans = 0
for i in range(K):
    for j in range(K):
        for k in range(K):
            gcd_0 = math.gcd(i+1,j+1)
            ans += math.gcd(gcd_0,k+1)

print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
c = collections.Counter(S)
values, counts = zip(*c.most_common())
a = 0
for i in counts:
    if i==2:
        a += 1
    else:
        a *= 0
if a:
    print("Yes")
else:
    print("No")


Fixed submission:
import collections
S = input()
c = collections.Counter(S)
values, counts = zip(*c.most_common())
a = 0
for i in counts:
    if i==2:
        a += 1
    else:
        a *= 0
if a:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
def lcm(x, y):
    return (x * y) // math.gcd(x, y)


a,b,c,d = map(int,input().split())
c_i=a//c
d_i=a//d
cd_i=a//(lcm(c,d))
if not a%c==0:
    c_i+=1
if not a%d==0:
    d_i+=1
if not a%(lcm(c,d))==0:
    cd_i+=1

c_f=b//c
d_f=b//d
cd_f=b//(lcm(c,d))

print(b-a-(c_f+d_f-cd_f-c_i-d_i+cd_i+1)+1)


Fixed submission:
def gcd(m,n):
    x= max(m,n)
    y= min(m,n)
    if x%y == 0:
        return y
    else:
        while not x%y==0:
            z=x%y
            x= y
            y=z
        else:
            return z
def lcm(x, y):
    return (x * y) // gcd(x, y)


a,b,c,d = map(int,input().split())
lcm = lcm(c,d)
c_i=a//c
d_i=a//d
cd_i=a//lcm
if not a%c==0:
    c_i+=1
if not a%d==0:
    d_i+=1
if not a%lcm==0:
    cd_i+=1

c_f=b//c
d_f=b//d
cd_f=b//lcm

print(b-a-(c_f+d_f-cd_f-c_i-d_i+cd_i+1)+1)

Buggy python submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)


a,b,c,d = map(int,input().split())
c_i=a//c
d_i=a//d
cd_i=a//(lcm(c,d))
if not a%c==0:
    c_i+=1
if not a%d==0:
    d_i+=1
if not a%(lcm(c,d))==0:
    cd_i+=1

c_f=b//c
d_f=b//d
cd_f=b//(lcm(c,d))

print(b-a-(c_f+d_f-cd_f-c_i-d_i+cd_i+1)+1)

Fixed submission:
def gcd(m,n):
    x= max(m,n)
    y= min(m,n)
    if x%y == 0:
        return y
    else:
        while not x%y==0:
            z=x%y
            x= y
            y=z
        else:
            return z
def lcm(x, y):
    return (x * y) // gcd(x, y)


a,b,c,d = map(int,input().split())
lcm = lcm(c,d)
c_i=a//c
d_i=a//d
cd_i=a//lcm
if not a%c==0:
    c_i+=1
if not a%d==0:
    d_i+=1
if not a%lcm==0:
    cd_i+=1

c_f=b//c
d_f=b//d
cd_f=b//lcm

print(b-a-(c_f+d_f-cd_f-c_i-d_i+cd_i+1)+1)
Buggy python submission (verdict: Runtime Error):
N,M = input().split()
N = int(N)
M = int(M)
list = []
A_list = []

for i in range(M):
    x,y,z = input().split()
    x,y,z = int(x),int(y),int(z)
    list.append([x,y,z])

A_list.append([list[0][0]])
for data in list:
    check = 0
    for A_data in A_list:
        if data[0] in A_data:
            A_data.append(data[1])
            check = 0
        elif data[1] in A_data:
            A_data.append(data[0])
            check = 0
        elif not data[0] in A_data and not data[1] in A_data:
            check = 1
    if check:
        A_list.append([data[0],data[1]])

print(len(A_list))

Fixed submission:
import sys

N,K = input().split()
S = input()

N = int(N)
K = int(K)

S_new = S[:K-1] + S[K-1].lower() + S[K:]

print("{}".format(S_new))

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

for i in range(M):
    x,y,z = input().split()
    x,y,z = int(x),int(y),int(z)
    list.append([x,y,z])

A_list.append([list[0][0]])
for data in list:
    check = 0
    for A_data in A_list:
        if data[0] in A_data:
            A_data.append(data[1])
            check = 0
        elif data[1] in A_data:
            A_data.append(data[0])
            check = 0
        elif not data[0] in A_data and not data[1] in A_data:
            check = 1
    if check:
        A_list.append([data[0],data[1]])

print(len(A_list))

Fixed submission:
import sys

N,K = input().split()
S = input()

N = int(N)
K = int(K)

S_new = S[:K-1] + S[K-1].lower() + S[K:]

print("{}".format(S_new))
Buggy python submission (verdict: Runtime Error):
import numpy as np
a = input()
b = input()
a_int =int(a)
b_int = int(b)
# print(a)
# print(b)
c = ""
if(a<b):
    for i in range(b_int):
        c += str(a)
    print(c)

else:
    for i in range(a_int):
        c += str(b)
    print(c)

Fixed submission:
import numpy as np
a,b=input().split()
# print(a)
# print(b)
a_int =int(a)
b_int = int(b)
# print(a)
# print(b)
c = ""
if(a<b):
    for i in range(b_int):
        c += str(a)
    print(c)

else:
    for i in range(a_int):
        c += str(b)
    print(c)
Buggy python submission (verdict: Runtime Error):
half_length = all_length / 2
before_sum = 0
after_sum = 0
for ax in length_list:
    if before_sum+ax < half_length:
        before_sum += ax
        continue
    else:
        after_sum = before_sum + ax
        break
before_diff = all_length - before_sum 
after_diff = all_length - after_sum

if before_diff < after_diff:
    print(before_diff - before_sum)
else:
    print(after_sum - after_diff)


Fixed submission:
N = int(input())
length_list = [int(x) for x in input().split()]

all_length = sum(length_list)

half_length = all_length / 2
before_sum = 0
after_sum = 0
for ax in length_list:
    if before_sum+ax < half_length:
        before_sum += ax
        continue
    else:
        after_sum = before_sum + ax
        break
before_diff = all_length - before_sum 
after_diff = all_length - after_sum

if before_diff - before_sum < after_sum - after_diff:
    print(before_diff - before_sum)
else:
    print(after_sum - after_diff)
Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q = [int(x) for x in input().split()]

all_result = []
for a_i in range(Q):
    all_result.append(int(input()))

for num in range(N):
    point = all_result.count(num + 1)
    if (K - Q + point) > 0:
        print('Yes')
    else:
        print('No')



Fixed submission:
import collections

N,K,Q = [int(x) for x in input().split()]

all_result = []
for a_i in range(Q):
    all_result.append(int(input()))

c = collections.Counter(all_result)

for num in range(N):
    point = c[num + 1]
    if (K - Q + point) > 0:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
NUM = 3
max = input(data)
print(max**NUM)

Fixed submission:
max = int(input())
print(max ** 3)
Buggy python submission (verdict: Runtime Error):
num = int(input())
A_i = [ int(x) for x in input().split()]
B_i = [ int(x) for x in input().split()]
C_i = [ int(x) for x in input().split()]

prev = 0
for a in a_i:
  result += B_i[a]
  if prev > 0 and a-1 == prev:
    result += C_i[prev]
  
print(result)

Fixed submission:
num = int(input())
A_i = [ int(x) for x in input().split()]
B_i = [ int(x) for x in input().split()]
C_i = [ int(x) for x in input().split()]
 
prev = 50
result = 0
for a in A_i:
  result += B_i[a-1]
  if a-1 == prev:
    result += C_i[prev-1]
  prev = a
  
print(result)
Buggy python submission (verdict: Runtime Error):
x, a = map(int, input())
if x>=a:
  print(10)
else :
  print(0)

Fixed submission:
x, a = map(int, input().split())
if x>=a:
  print(10)
else :
  print(0)
Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a = [int(i) for i in input().split()]
a = np.array(a, dtype='int64')
a.sort()
for i in range(n):
    if a[i] > 0:
        k = i
        break
a = np.absolute(a)
a.sort()

if k % 2 == 0:
    print(np.sum(a))
else :
    print(np.sum(a)- a[0]*2)

Fixed submission:
import numpy as np
n = int(input())
a = [int(i) for i in input().split()]
a = np.array(a, dtype='int64')
k = np.sum(a < 0)
a = np.absolute(a)
a.dtype ='uint64'
a.sort()

if k % 2 == 0:
    print(int(np.sum(a)))
else :
    print(int(np.sum(a)- a[0]*2))

Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a = [int(i) for i in input().split()]
a = np.array(a, dtype='int64')
a.sort()
print(a)
for i in range(n):
    if a[i] > 0:
        k = i
        print(i)
        break
a = np.absolute(a)
a.sort()

if k % 2 == 0:
    print(np.sum(a))
else :
    print(np.sum(a)- a[0]*2)

Fixed submission:
import numpy as np
n = int(input())
a = [int(i) for i in input().split()]
a = np.array(a, dtype='int64')
k = np.sum(a < 0)
a = np.absolute(a)
a.dtype ='uint64'
a.sort()

if k % 2 == 0:
    print(int(np.sum(a)))
else :
    print(int(np.sum(a)- a[0]*2))
Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int, input().split())
s = input()
k = 0
cnt = [0 for _ in range(n)]
for i in range(n):
    cnt[i] = s[:i+1].count('AC')

while True:
    l, r = map(int, input().split())
    print(cnt[r-1]-cnt[l-1])
    k += 1
    if q <= k:
        break


Fixed submission:
n, q = map(int, input().split())
s = input()
k = 0
sum_c = [0 for _ in range(n)]
cnt = 0
for i in range(n-1):
    if s[i:i+2] == 'AC':
        cnt += 1
    sum_c[i+1] = cnt

while True:
    l, r = map(int, input().split())
    print(sum_c[r-1]-sum_c[l-1])
    k += 1
    if q <= k:
        break

Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int, input().split())
s = input()
k = 0
while True:
    l, r = map(int, input().split())
    print(s[l-1:r].count('AC'))
    k += 1
    if q <= k:
        break


Fixed submission:
n, q = map(int, input().split())
s = input()
k = 0
sum_c = [0 for _ in range(n)]
cnt = 0
for i in range(n-1):
    if s[i:i+2] == 'AC':
        cnt += 1
    sum_c[i+1] = cnt

while True:
    l, r = map(int, input().split())
    print(sum_c[r-1]-sum_c[l-1])
    k += 1
    if q <= k:
        break
Buggy python submission (verdict: Runtime Error):
import numpy as np 
n , m = map(int, input().split())
l = np.array([list(map(int, input().split())) for _ in range(m)])
l2 = np.zeros(m)

l2 = l[:,0]*(10**6) + l[:,1]
l2 = np.sort(l2)

j = 1000000
k = 1
for i in range(m):
    if j+1000000 > l2[i]:
        l2[i] = j + k
        k += 1
    else :
        j += 1000000
        l2[i] = j + 1
        k = 2

for i in l2 :
    print('{0:012d}'.format(i))


    

Fixed submission:
x , y = map(int, input().split())
print(int(x+y/2))
Buggy python submission (verdict: Time Limit Exceeded):
n , m = map(int, input().split())
l = [list(map(int,input().split())) for _ in range(m)]
l.sort()

cut = [l[0]]
for i in range(1,m):
    for j in range(len(cut)):
        key = 0
        if cut[j][0] <= l[i][0]  and l[i][0] < cut[j][1] :
            cut[j][0] = l[i][0]
            key +=1
        if cut[j][0] < l[i][1] and l[i][1] <= cut[j][1]  :
            cut[j][1] = l[i][1]
            key +=1
        if key > 0:
            break
    
    if key == 0 :
        cut.append(l[i])


print(len(cut))
    


Fixed submission:
n , m = map(int, input().split())
l = [list(map(int,input().split())) for _ in range(m)]
l.sort()
l = l[::-1]
cnt = 1
key = l[0][0]
for i in range(1,m):
    if key >= l[i][1]:
        cnt += 1
        key = l[i][0]
print(cnt)