Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n,q = map(int, input().split())
s = input()
li = set()
for i in range(n-1):
    if s[i] == "A" and s[i+1] == "C":
        li.add(i+1)

for i in range(q):
    l, r = map(int, input().split())
    ans = 0
    for num in li:
        if l <= num and num+1 <= r:
            ans += 1
    print(ans)

Fixed submission:
n,q = map(int, input().split())
s = input()
li = [0]*(n+1)
for i in range(n):
    if s[i:i+2] == "AC":
        li[i+1] = li[i] + 1
    else:
        li[i+1] = li[i]

for i in range(q):
    l, r = map(int, input().split())
    print(li[r-1] - li[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,q = map(int, input().split())
s = input()
li = []
for i in range(n-1):
    if s[i] == "A" and s[i+1] == "C":
        li.append(i+1)
for i in range(q):
    l, r = map(int, input().split())
    ans = 0
    for num in li:
        if l <= num and num+1 <= r:
            ans += 1
    print(ans)

Fixed submission:
n,q = map(int, input().split())
s = input()
li = [0]*(n+1)
for i in range(n):
    if s[i:i+2] == "AC":
        li[i+1] = li[i] + 1
    else:
        li[i+1] = li[i]

for i in range(q):
    l, r = map(int, input().split())
    print(li[r-1] - li[l-1])
Buggy python submission (verdict: Runtime Error):
a,b = map(int(input().split()))
if b%a :
    print(b-a)
else:
    print(a+b)

Fixed submission:
a,b = map(int,input().split())
if b%a :
    print(b-a)
else:
    print(a+b)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = sorted([int(input()) for i in range(n)])
diff = [h[i+1] - h[i] for i in range(n-1)]
ans = float("inf")

for i in range(n-k+1):
    ans = min(ans, sum(diff[i:i+k-1]))
print(ans)

Fixed submission:
n, k = map(int, input().split())
h = sorted([int(input()) for i in range(n)])
ans = float("inf")

for i in range(n-k+1):
    ans = min(ans, h[i+k-1]-h[i])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = sorted([int(input()) for i in range(n)])
diff = [h[i+1] - h[i] for i in range(n-1)]
ans = float("inf")

for i in range(n-k+1):
    ans = min(ans, sum(diff[i:i+k-1]))
print(ans)

Fixed submission:
n, k = map(int, input().split())
h = sorted([int(input()) for i in range(n)])
ans = float("inf")

for i in range(n-k+1):
    ans = min(ans, h[i+k-1]-h[i])
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
n,m = map(int, input().split())
count = [0]*n
py = []

for i in range(m):
    p,y = map(int, input().split())
    count[p-1] += 1
    py.append([p,y])

li = sorted(py)
count = np.cumsum(count)

for i in range(m):
    num = li.index(py[i]) + 1
    pref = str(py[i][0])
    if py[i][0] == 1:
        print(pref.zfill(6) + str(num).zfill(6))
    else:
        print(pref.zfill(6) + str(num - count[i]).zfill(6))

Fixed submission:
n,m = map(int, input().split())
py = []
for i in range(m):
    p,y = map(int, input().split())
    py.append((p,y,i))
py.sort()
li = [[0]*2 for i in range(m)]
s = 0
t = 0
for p,y,i in py:
    #もしs!=pならその県は初めてなので1番目、違うならそこから+1
    if s != p:
        s = p
        t = 1
    else:
        t += 1
    li[i][0] = s
    li[i][1] = t
for i in range(m):
    print(str(li[i][0]).zfill(6) + str(li[i][1]).zfill(6))

Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
count = [0]*m
py = []

for i in range(m):
    p,y = map(int, input().split())
    count[p-1] += 1
    py.append([p,y])

li = sorted(py)

for i in range(m):
    num = li.index(py[i]) + 1
    pref = str(py[i][0])
    print("0"*(6-len(pref)) + pref + "0"*(6-len(str(num))) + str(num - sum(count[:py[i][0]-1])))

Fixed submission:
n,m = map(int, input().split())
py = []
for i in range(m):
    p,y = map(int, input().split())
    py.append((p,y,i))
py.sort()
li = [[0]*2 for i in range(m)]
s = 0
t = 0
for p,y,i in py:
    #もしs!=pならその県は初めてなので1番目、違うならそこから+1
    if s != p:
        s = p
        t = 1
    else:
        t += 1
    li[i][0] = s
    li[i][1] = t
for i in range(m):
    print(str(li[i][0]).zfill(6) + str(li[i][1]).zfill(6))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
v = list(map(int, input().split()))

count = 0
count1 = 0
for i in range(0,n,2):
    count = max(count, v.count(v[i]))
for j in range(1,n,2):
    count1 = max(count1, v.count(v[j]))
print(n//2 if len(set(v)) == 1 else n-count-count1)

Fixed submission:
from collections import Counter
n = int(input())
v = list(map(int, input().split()))
a = Counter(v[::2])
b = Counter(v[1::2])
count = a.most_common()
count1 = b.most_common()
if len(set(v)) == 1:
    print(n//2)
    exit()
if count[0][0] == count1[0][0]:
    print(n- count[0][1] - (max(count[1][1], count1[1][1])))

else:
    print(n - count[0][1] - count1[0][1])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
v = list(map(int, input().split()))
a = v[::2]
b = v[1::2]
count = 0
count1 = 0
for i in a:
    count = max(count, a.count(i))
for j in b:
    count1 = max(count1, b.count(j))
print(n//2 if len(set(v)) == 1 else n-count-count1)

Fixed submission:
from collections import Counter
n = int(input())
v = list(map(int, input().split()))
a = Counter(v[::2])
b = Counter(v[1::2])
count = a.most_common()
count1 = b.most_common()
if len(set(v)) == 1:
    print(n//2)
    exit()
if count[0][0] == count1[0][0]:
    print(n- count[0][1] - (max(count[1][1], count1[1][1])))

else:
    print(n - count[0][1] - count1[0][1])
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
if a*b % :
    print("Yes")
else:
    print("No")

Fixed submission:
a,b = map(int, input().split())
if a*b % 2:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n,i = map(int, input())
print(n-i+1)

Fixed submission:
n,i = map(int, input().split())
print(n-i+1)
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
print(2*n // math.gcd(2,n))

Fixed submission:
n = int(input())
if n % 2:
    print(2*n)
else:
    print(n)

Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
print(2*n // math.gcd(2,n))

Fixed submission:
n = int(input())
if n % 2:
    print(2*n)
else:
    print(n)
Buggy python submission (verdict: Runtime Error):
if 1<= int(input()) <= 999:
    print("ABC")
if 1000 <= int(input()) <= 1998:
    print("ABD")

Fixed submission:
if 1<= int(input()) <= 999:
    print("ABC")
else:
    print("ABD")
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
diff = b - a
def tower(n):
    if n < 1:
        return 0
    return n + tower(n - 1)
print(int(tower(diff) - b))

Fixed submission:
a,b = map(int, input().split())
print(int(((b-a)*(b-a+1))/2) - b)

Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
diff = b - a
def tower(n):
    if n < 1:
        return 0
    return n + tower(n - 1)
print(tower(diff) - b)

Fixed submission:
a,b = map(int, input().split())
print(int(((b-a)*(b-a+1))/2) - b)

Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
diff = b - a - 1
def tower(n):
    if n < 1:
        return 0
    return n + tower(n - 1)
print(tower(diff) - a)

Fixed submission:
a,b = map(int, input().split())
print(int(((b-a)*(b-a+1))/2) - b)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(input())
li = []
for i in range(1,n-1):
    li.append(len(set(s[:i+1]) & set(s[i+1:])))
print(max(li))

Fixed submission:
n = int(input())
s = list(input())
li = []
for i in range(1,n-1):
    li.append(len(set(s[:i+1]) & set(s[i+1:])))
print(0 if len(li) == 0 else max(li))
Buggy python submission (verdict: Runtime Error):
x = int(input())
li = list(range(2,x+1))
ans = [1]
n = 2
while li[0]**n < x:
    for i in range(x-1):
        if li[i]**n > x:
            ans.append(li[i-1]**n)
            break
    n += 1
print(max(ans))

Fixed submission:
x = int(input())
if x == 1:
    print(1)
    exit()
li = list(range(2,x+1))
ans = [1]
n = 2
while li[0]**n < x:
    for i in range(x-1):
        if li[i]**n > x:
            ans.append(li[i-1]**n)
            break
    n += 1
print(max(ans))
Buggy python submission (verdict: Runtime Error):
h,w = map(int, input().split())
s = [list(input()) for i in range(w)]
dx = [0,1,0,-1]
dy = [1,0,-1,0]

for x in range(h):
    for y in range(w):
        if s[x][y] == "#":
            flag = False

            for i in range(4):
                nx = x + dx[i]
                ny = y + dy[i]
                if 0 <= nx < h and 0 <= ny < w and s[nx][ny] == "#":
                    flag = True

            if not flag:
                print("No")
                exit()

print("Yes")

Fixed submission:
h,w = map(int, input().split())
s = [list(input()) for i in range(h)]
dx = [0,1,0,-1]
dy = [1,0,-1,0]

for x in range(h):
    for y in range(w):
        if s[x][y] == "#":
            flag = False

            for i in range(4):
                nx = x + dx[i]
                ny = y + dy[i]

                if 0 <= nx < h and 0 <= ny < w and s[nx][ny] == "#":
                    flag = True

            if not flag:
                print("No")
                exit()

print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
x = list(map(int, input().split()))
X = sorted(x)
num = int(n/2)
ans = dict()
for i in range(n):
	target = X[:i] + X[i+1:]
		
	ans.setdefault(X[i], target[num - 1])
for i in x:
	print(ans[i])	

Fixed submission:
n = int(input())
x = list(map(int, input().split()))
ans = dict()
x_copy = sorted(x[:])
right = x_copy[(n//2)-1]
left = x_copy[-(n//2)]

for i in range(n):
    if i < n//2:
        ans[x_copy[i]] = left
    else:
        ans[x_copy[i]] = right

for i in x:
    print(ans[i])
Buggy python submission (verdict: Runtime Error):
a,b,k = map(int, input().split())
li = list(range(a,b+1))
li_low = li[:k]
li_high = li[-k:]
li_ans = sorted(list(set(li_low + li_high)))
for i in range(len(li_ans)):
    print(li_ans[i])

Fixed submission:
a,b,k = map(int,input().split())
if (b-a+1) <= 2*k:
    for k in range(a,b+1):
        print(k)
else:
    for i in range(a,a+k):
        print(i)
    for j in range(b-k+1,b+1):
        print(j)

Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
li = list(range(a,b+1))
list_ = li[:k] + li[len(li)-k:]
list_ = sorted(list(set(list_)))
for i in range(len(list_)):
    print(list_[i])

Fixed submission:
a,b,k = map(int,input().split())
if (b-a+1) <= 2*k:
    for k in range(a,b+1):
        print(k)
else:
    for i in range(a,a+k):
        print(i)
    for j in range(b-k+1,b+1):
        print(j)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
if a+b>=c:
    print("Yes")
if a+b < c
    print("NO")

Fixed submission:
a,b,c = map(int, input().split())
if a+b >= c:
    print("Yes")
if a+b < c:
    print("No")
Buggy python submission (verdict: Runtime Error):
if n<a:
    print("Yes")
    exit()
if (n-a)%500:
    print("No")
else:
    print("Yes")

Fixed submission:
n = int(input())
a = int(input())
if n<a:
    print("Yes")
    exit()
if n % 500 <= a:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
from sys import stdin

a, b = stdin.readline().rstrip().split()
ab = a * b

if ab % 2 == 0:
    print("Even")
else:
    print("Odd")

Fixed submission:
from sys import stdin

a, b = [int(x) for x in stdin.readline().rstrip().split()]
ab = a * b

if ab % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy python submission (verdict: Runtime Error):
a, b = int(input())
ab = a * b

if ab % 2 == 0:
    print("Even")
else:
    print("Odd")

Fixed submission:
from sys import stdin

a, b = [int(x) for x in stdin.readline().rstrip().split()]
ab = a * b

if ab % 2 == 0:
    print("Even")
else:
    print("Odd")
Buggy python submission (verdict: Runtime Error):
n,h = map(int, input().split())
li = []
cut = 0
for i in range(n):
	a, b = map(int, input().split())
	cut = max(a, cut)
	li.append(b)
li = sorted(li, reverse = True)
ans = 0

for b in li:
	if b > cut:
		h -= b
		ans += 1
		if h < 0:
			print(ans)
			exit()
	else:
		break
ans += (-(-h//cut))
print(ans)		n,h = map(int, input().split())
li = []
cut = 0
for i in range(n):
	a, b = map(int, input().split())
	cut = max(a, cut)
	li.append(b)
li = sorted(li, reverse = True)
ans = 0

for b in li:
	if b > cut:
		h -= b
		ans += 1
		if h < 0:
			print(ans)
			exit()
	else:
		ans += (-(-h // cut))
		print(ans)
		exit()	
		
ans += (-(-h//cut))
print(ans)		

Fixed submission:
import heapq

n,h = map(int, input().split())
cut = 0
throw = []
heapq.heapify(throw)

for i in range(n):
	a,b = map(int, input().split())	
	cut = max(cut, a)
	heapq.heappush(throw, -(b))

ans = 0
for i in range(n):
	num = heapq.heappop(throw)*(-1)
	if num > cut:
		 h -= num
		 ans += 1
		 if h <= 0:
			 print(ans)
			 exit()
	else:
		ans += (-(-h // cut))
		print(ans)
		exit()	
		
ans += (-(-h // cut))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = [list(map(int, input().split())) for i in range(n-1)]

for i in range(n-1):
    time = li[i][0] + li[i][1]
    for j in range(i+1, n-1):
        now = li[j][1]
        while time > now:
            now += li[j][2]
        time = now
        time += li[j][0]
    print(time)
print(0)

Fixed submission:
n = int(input())
li = [list(map(int, input().split())) for i in range(n-1)]

for i in range(n-1):
	time = li[i][0] + li[i][1]
	for j in range(i+1, n-1):
		now = li[j][1]
		if now < time:
			now += li[j][2] * (-(-(time-now)//li[j][2]))
		time = now
		time += li[j][0]
	print(time)
print(0)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
def ryuka(n):
    if n == 0:
        return 2
    elif n == 1:
        return 1

    return ryuka(n-1) + ryuka(n-2)
print(ryuka(n))

Fixed submission:
n = int(input())
li = [2,1]
for i in range(n+1):
    if i == 0:
        continue
    elif i == 1:
        continue
    else:
        li.append(li[i-2] + li[i-1])
print(li[n])

Buggy python submission (verdict: Runtime Error):
def ryuka(n):
    if n == 0:
        return 2
    elif n == 1:
        return 1

    return ryuka(n-1) + ryuka(n-2)
print(ryuka(n))

Fixed submission:
n = int(input())
li = [2,1]
for i in range(n+1):
    if i == 0:
        continue
    elif i == 1:
        continue
    else:
        li.append(li[i-2] + li[i-1])
print(li[n])
Buggy python submission (verdict: Runtime Error):
li = set(list(map(int, input().split())))
print(li[0])

Fixed submission:
li = list(map(int, input().split()))
if li.count(li[0]) == 1:
    print(li[0])
if li.count(li[1]) == 1:
    print(li[1])
if li.count(li[2]) == 1:
    print(li[2])
Buggy python submission (verdict: Runtime Error):
for i in range(h):
    for j in range(w):
        if s[i][j] == "0":
            for k in range(8):
                if 0 <= j+y[k] < w and 0 <= i+x[k] < h and s[i+x[k]][j+y[k]] == "#":
                    s[i][j] = str(int(s[i][j])+1)
                    
for i in range(h):
    print("".join(s[i]))

Fixed submission:
h,w = map(int, input().split())
s = [list(input().replace(".","0")) for i in range(h)]
x = [1,1,0,-1,-1,-1,0,1]
y = [0,1,1,1,0,-1,-1,-1]

for i in range(h):
    for j in range(w):
        if s[i][j] == "0":
            for k in range(8):
                if 0 <= j+y[k] < w and 0 <= i+x[k] < h and s[i+x[k]][j+y[k]] == "#":
                    s[i][j] = str(int(s[i][j])+1)
                    
for i in range(h):
    print("".join(s[i]))
Buggy python submission (verdict: Runtime Error):
x,t = map(int, input())
if x >= t:
    print(x-t)
if x < t:
    print(0)

Fixed submission:
x,t = map(int, input().split())
if x >= t:
    print(x-t)
if x < t:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int, input().split())
start = set()
goal = set()
for i in range(m):
    a,b = map(int, input().split())
    if a == 1:
        start.add(b)
    elif  b == n:
        goal.add(a)

for i in start:
    for j in goal:
        if i == j:
            print("POSSIBLE")
            exit()
print("IMPOSSIBLE")

Fixed submission:
n,m = map(int, input().split())
start = set()
goal = set()
for i in range(m):
    a,b = map(int, input().split())
    if a == 1:
        start.add(b)
    elif  b == n:
        goal.add(a)

ans = start & goal
if len(ans) > 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
if (a+b) % :
    print("Impossible")
else:
    print("Possible")

Fixed submission:
a,b = map(int, input().split())
if a % 3 ==0 or b % 3 == 0 or (a+b) % 3 == 0 :
    print("Possible")
else:
    print("Impossible")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
    b.append(a[i])
    b = b[::-1]

for i in b:
    print(i)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
if n % 2:
    li = a[1::2][::-1] + a[::2]
    li = li[::-1]
else:
    li = a[::2][::-1] + a[1::2]
    li = li[::-1]
print(" ".join(map(str, li)))
Buggy python submission (verdict: Runtime Error):
x,a,b = map(int, input().split())

if a > b:
    print("delicious")
    exit()
if a < b and abs(a-b) <= x:
    print("safe")
if aa < b and abs(a-b) > x:
    print("dangerous")

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

if a >= b:
    print("delicious")
if a < b and abs(a-b) <= x:
    print("safe")
if a < b and abs(a-b) > x:
    print("dangerous")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for i in range(n)]
on = 1
count = 0
on_li = [1]
while True:
    on = a[on-1]
    count += 1
    if on == 2:
        print(count)
        exit()

    if on in on_li:
        print(-1)
        exit()
    else:
        on_li.append(on)

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

c,s=1,a[0]

while s!=2 and c<n:
    c,s=c+1,a[s-1]

print(c if c<n else -1)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]
on = 1
count = 0
on_li = [1]
while True:
    on = a[on-1]
    if on in on_li:
        print(-1)
        exit()
    on_li.append(on)
    print(on_li)
    count += 1
    if on == 2:
        print(count)
        exit()

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

c,s=1,a[0]

while s!=2 and c<n:
    c,s=c+1,a[s-1]

print(c if c<n else -1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
li = [0]*9
tourist = 0

for i in a:
    if i // 400 == 8:
        tourist += 1

    if li[i//400] == 0:
        li[i//400] = 1

minrate = sum(li[:8])
maxrate = 0
if minrate + tourist > 8:
    maxrate = 8
else:
    maxrate = minrate + tourist

print(minrate, maxrate)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
li = [0]*15
tourist = 0

for i in a:
    if i // 400 >= 8:
        tourist += 1

    if li[i//400] == 0:
        li[i//400] = 1

maxrate = sum(li[:8]) + tourist

minrate = 0

if sum(li[:8]) == 0:
    minrate = 1
else:
    minrate = sum(li[:8])

print(minrate, maxrate)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
if b-a = c-b:
    print("YES")
else:
    print("NO")

Fixed submission:
a,b,c = map(int, input().split())
if b-a == c-b:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a < b:
    print("Bob")
if a > b:
    print("Alice")
if a = b:
    print("Draw")

Fixed submission:
a, b = map(int, input().split())
if a == 1 and a != b:
    print("Alice")
    exit()
if b == 1 and a != b:
    print("Bob")
    exit()
if a < b:
    print("Bob")
    exit()
if a > b:
    print("Alice")
    exit()
if a == b:
    print("Draw")
Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int,input().split())
count = 0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x+y+z == s:
                count += 1
print(count)

Fixed submission:
k,s = map(int,input().split())
count = 0
for x in range(k+1):
    for y in range(k+1):
        z = s - x - y
        if 0 <= z <= k:
            count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,x = map(int,input().split())
for i in range(a,b+1):
    if i % x == 0:
        print(((b-i)//x) + 1)
        exit()
print(0)

Fixed submission:
a, b, x = map(int, input().split())
print(b // x - (a - 1) // x)
Buggy python submission (verdict: Runtime Error):
n = int(input())
print(n(n+1)/2)

Fixed submission:
n = int(input())
print(int(n*(n+1)/2))
Buggy python submission (verdict: Runtime Error):
 = list(input())
str = ""
for i in range(len(s)):
    if s[i] == "0":
        str += "0"
    if s[i] == "1":
        str += "1"
        print(str)
    if s[i] == "B":
        if str == "":
            continue
        else:
            str = str[:-1]
print(str)

Fixed submission:
s = input()

a = ''
for x in s:
    if x == '0':
        a += '0'
    elif x == '1':
        a += '1'
    else:
        if a != '':
            #a = list(a)
            a = a[:-1]

print(a)

Buggy python submission (verdict: Runtime Error):
 = list(input())
str = ""
for i in range(len(s)):
    if s[i] == "0":
        str += "0"
    if s[i] == "1":
        str += "1"
        print(str)
    if s[i] == "B":
        if str == "":
            continue
        else:
            str = str[:-1]
print(str)

Fixed submission:
s = input()

a = ''
for x in s:
    if x == '0':
        a += '0'
    elif x == '1':
        a += '1'
    else:
        if a != '':
            #a = list(a)
            a = a[:-1]

print(a)
Buggy python submission (verdict: Runtime Error):
li = input().split().remove('5')
if '7' in li:
    print('YES')
else:
    print('NO')

Fixed submission:
if input().split().count('5') == 2:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
s = ''
for i in range(1, n+1):
  s = s + str(a.index(i)+1) + ' '
print(s[:-1])

Fixed submission:
import numpy as np
n = int(input())
a = list(map(int, input().split()))
print(' '.join(list(map(str, np.argsort(a) + 1))))
Buggy python submission (verdict: Runtime Error):
import numpy as np

n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
p = np.array([k for i in range(n)])
for i in a:
  p = p - 1 
  p[i-1] += 1
for i in p:
  if i > 0:
    print('Yes')
  else:
    print('No')

Fixed submission:
n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
lena = len(a)
p = [k-lena for i in range(n)]
for i in a:
  p[i-1] += 1
for i in p:
  if i > 0:
    print('Yes')
  else:
    print('No')

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

n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
p = np.array([k for i in range(n)])
for i in a:
  p = p - 1 
  p[i-1] += 1
for i in p:
  if i > 0:
    print('Yes')
  else:
    print('No')

Fixed submission:
n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
lena = len(a)
p = [k-lena for i in range(n)]
for i in a:
  p[i-1] += 1
for i in p:
  if i > 0:
    print('Yes')
  else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
L=[0]
R=[0]
ans=0

for i in range(M):
    Lt,Rt=map(int,input().split())
    L.append(Lt)
    R.append(Rt)

for i in range(1,N+1):
    flg=1
    for j in range(1,M+1):
        if i >= L[j] and i <= R[j]:
            continue
        flg=0

    if flg==1:
        ans+=1
print(ans)


Fixed submission:
N,M=map(int,input().split())
Lm=0
Rm=N
ans=0

for i in range(M):
    Lt,Rt=map(int,input().split())
    if Lm < Lt:
        Lm = Lt
    if Rm > Rt:
        Rm = Rt
if Rm < Lm:
    print(0)
else:
    print(Rm-Lm+1)