Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, (input().split())))
a.append(0)
mon = 1000
kab = 0
x = 0
z = 0
while z <= n-1:
    if x == 0:
        while a[z+1] < a[z]:
            z += 1
            if z == n-1:
                break
        kab += mon//a[z]
        ans = mon
        mon -= kab*a[z]
        x = 1
        if z < n-1:
            z += 1
        else:
            break
    elif x == 1:
        while a[z+1] > a[z]:
            z += 1
            if z == n-1:
                break
        mon += kab*a[z]
        kab = 0
        x = 0
        if z < n-1:
            z += 1
        else:
            break
print(max(ans, mon))

Fixed submission:
n = int(input())
a = list(map(int, (input().split())))
a.append(0)
mon = 1000
kab = 0
x = 0
for i in range(n):
    if a[i] <= a[i+1]:
        kab = mon//a[i]
        mon += kab*(a[i+1]-a[i])
print(mon)
Buggy python submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a2 = [0]
b2 = [0]
for i in range(n):
    a2.append(a2[i]+a[i])
for i in range(n):
    b2.append(b2[i]+b[i])
ans = 0
for i in range(n):
    if a[i] > k:
        break
    cnt = m
    sm = 0
    while sm < k-a2[i]:
        sm = b2[cnt-1]
        cnt -= 1
    ans = max(cnt, ans)
print(ans)

Fixed submission:
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a2 = [0]
b2 = [0]
for i in range(n):
    a2.append(a2[i]+a[i])
for i in range(m):
    b2.append(b2[i]+b[i])
ans = 0
cnt = m
for i in range(n+1):
    if a2[i] > k:
        break
    sm = 0
    while b2[cnt] > k-a2[i]:
        cnt -= 1
    ans = max(cnt+i, ans)
print(ans)

Buggy python submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a2 = [0]
b2 = [0]
for i in range(n):
    a2.append(a2[i]+a[i])
for i in range(n):
    b2.append(b2[i]+b[i])
for i in range(len(a)):
    if a[0] > k:
        break
    cnt = 0
    sm = 0
    while sm < k-a2[i]:
        sm = b2[cnt]
        cnt += 1
    ans = max(cnt, ans)
print(ans)

Fixed submission:
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a2 = [0]
b2 = [0]
for i in range(n):
    a2.append(a2[i]+a[i])
for i in range(m):
    b2.append(b2[i]+b[i])
ans = 0
cnt = m
for i in range(n+1):
    if a2[i] > k:
        break
    sm = 0
    while b2[cnt] > k-a2[i]:
        cnt -= 1
    ans = max(cnt+i, ans)
print(ans)

Buggy python submission (verdict: Runtime Error):
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a2 = [0]
b2 = [0]
for i in range(n):
    a2.append(a2[i]+a[i])
for i in range(n):
    b2.append(b2[i]+b[i])
ans = 0
for i in range(len(a)):
    cnt = 0
    sm = 0
    while sm < k-a2[i]:
        sm += b[cnt]
        cnt += 1
    ans = max(cnt, ans)
print(ans)

Fixed submission:
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a2 = [0]
b2 = [0]
for i in range(n):
    a2.append(a2[i]+a[i])
for i in range(m):
    b2.append(b2[i]+b[i])
ans = 0
cnt = m
for i in range(n+1):
    if a2[i] > k:
        break
    sm = 0
    while b2[cnt] > k-a2[i]:
        cnt -= 1
    ans = max(cnt+i, ans)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
q = int(input())
bc = [list(map(int,input().split())) for i in range(q)]
l1 = []
l2 = []
ans = sum(a)
for i in range(q):
    b = bc[i][0]
    c = bc[i][1]
    cnt = a.count(b)
    cnt2 = cnt + l2.count(b) - l1.count(b)
    for j in range(cnt):
        l1.append(b)
        l2.append(c)
    dif = c - b
    ans += dif * cnt2
    print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
q = int(input())
bc = [list(map(int,input().split())) for i in range(q)]
x = [0]*10**5
for i in a:
    x[i-1] += 1
ans = sum(a)
for i in range(q):
    b = bc[i][0]
    c = bc[i][1]
    x[c-1] += x[b-1]
    cnt = x[b-1]
    dif = c - b
    ans += dif * cnt
    x[b-1] = 0
    print(ans)
Buggy python submission (verdict: Runtime Error):
a, v= map(int, input().split())
b, w= map(int, input().split())
t = int(input())
l = b-a
s = v-w

    print('YES' if l<=s*t else 'NO')


Fixed submission:
a, v= map(int, input().split())
b, w= map(int, input().split())
t = int(input())
l = abs(b-a)
s = v-w
print('YES' if l<=s*t else 'NO')
Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a = list(map(float, input().split()))
ans = int(np.prod(a))
print(ans if ans <= 10**18 else '-1')

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = [i for i in a if i != 1]
ans = 1
if len(b) < 100:
    for i in range(len(b)):
        ans *= b[i]
else:
    ans = 10**18+1
if 0 in b:
    ans = 0
print(ans if ans <= 10**18 else '-1')

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
n = int(input())
a = list(map(int, input().split()))
ans = reduce(lambda x,y:x*y,a)
print(ans if ans <= 10**18 else '-1')

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = [i for i in a if i != 1]
ans = 1
if len(b) < 100:
    for i in range(len(b)):
        ans *= b[i]
else:
    ans = 10**18+1
if 0 in b:
    ans = 0
print(ans if ans <= 10**18 else '-1')

Buggy python submission (verdict: Time Limit Exceeded):
import functools
import operator
n = int(input())
a = list(map(int, input().split()))
ans = functools.reduce(operator.mul, a)
print(ans if ans <= 10**18 else '-1')

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = [i for i in a if i != 1]
ans = 1
if len(b) < 100:
    for i in range(len(b)):
        ans *= b[i]
else:
    ans = 10**18+1
if 0 in b:
    ans = 0
print(ans if ans <= 10**18 else '-1')

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in range(n):
    ans *= a[i]
print(ans if ans <= 10**18 else '-1')

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = [i for i in a if i != 1]
ans = 1
if len(b) < 100:
    for i in range(len(b)):
        ans *= b[i]
else:
    ans = 10**18+1
if 0 in b:
    ans = 0
print(ans if ans <= 10**18 else '-1')
Buggy python submission (verdict: Runtime Error):
n = int(input())
b = n
def pf(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
l = list(set(pf(n)))
cnt = 0
for i in l:
    n = b
    t = 1
    j = i
    while i <= n:
        if n % i == 0:
            cnt += 1
            n = n // i
            a.append(i)
        i *= j
print(cnt)

Fixed submission:
n = int(input())
b = n
def pf(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
l = list(set(pf(n)))
cnt = 0
for i in l:
    n = b
    t = 1
    j = i
    while i <= n:
        if n % i == 0:
            cnt += 1
            n = n // i
        i *= j
print(cnt)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
h = list(map(int, input().split()))
ans = [1] * n
for i in range(m):
    ai, bi = map(int, input().split()) 
    ab[i] = ai
    ab[i+m] = bi
    if h[ai-1] >= h[bi-1]:
        ans[bi-1] = 0
    elif h[ai-1] < h[bi-1]:
        ans[ai-1] = 0
print(sum(ans))

Fixed submission:
n, m = map(int, input().split())
h = list(map(int, input().split()))
ans = [1] * n
for i in range(m):
    ai, bi = map(int, input().split()) 
    if h[ai-1] >= h[bi-1]:
        ans[bi-1] = 0
    if h[ai-1] <= h[bi-1]:
        ans[ai-1] = 0
print(sum(ans))
Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())

for i in range(-1000, 1000):
    for j in range(-1000, 1000):
        if i**5-j**5 == x:
            a = i
            b = j
            break
print(a, b)

Fixed submission:
x = int(input())

for i in range(-200, 200):
    for j in range(-200, 200):
        if i**5-j**5 == x:
            a = i
            b = j
            break
print(a, b)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
c = [str(a.count(i)) for i in range(1, n+1)]
print('\n'.join(c))

Fixed submission:
import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
l = [str(0) for i in range(n)]
key = list(c.keys())
for i in range(len(list(c.keys()))):
    l[key[i]-1] = str(c[key[i]])
print('\n'.join(l))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    print(a.count(i+1))

Fixed submission:
import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
l = [str(0) for i in range(n)]
key = list(c.keys())
for i in range(len(list(c.keys()))):
    l[key[i]-1] = str(c[key[i]])
print('\n'.join(l))
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce
def gcd(x):
    return reduce(math.gcd, x)


a = int(input())
l = []
for i in range(1, a+1):
    for j in range(1, a+1):
        for k in range(1, a+1):
            l.append(gcd([i, j, k]))
print(sum(l))

Fixed submission:
n = input()
print('Yes' if '7' in n else 'No')
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int,input().split())
while n > k/2:
    n = abs(n - k)
print(n)

Fixed submission:
n, k = map(int,input().split())
a = n // k
n = n - a*k
while n > k/2:
    n = abs(n - k)
print(n)
Buggy python submission (verdict: Runtime Error):
lst1 = [int() for i in input().split()]
lst2 = [int() for i in input().split()]
lst3 = [int() for i in input().split()]
n = int(input())
b = [int(input()) for i in range(n)]
lst4 = [lst1[0], lst2[0], lst3[0]]
lst5 = [lst1[1], lst2[1], lst3[1]]
lst6 = [lst1[2], lst2[2], lst3[2]]
lst7 = [lst1[0], lst2[1], lst3[2]]
lst8 = [lst1[2], lst2[1], lst3[0]]
if len(set(b) & set(lst4)) == 3:
    print('Yes')
elif len(set(b) & set(lst5)) == 3:
    print('Yes')
elif len(set(b) & set(lst6)) == 3:
    print('Yes')
elif len(set(b) & set(lst7)) == 3:
    print('Yes')
elif len(set(b) & set(lst8)) == 3:
    print('Yes')
else:
    print('No')

Fixed submission:
n = int(input())
if n % 2 == 0:
    print(int(n/2))
else:
    print(int(n//2+1))
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
cnt = 0
for i in range(n):
    if s[i] == 'A' and s[i+1] == 'B' and s[i+2] == 'C':
        cnt += 1
print(cnt)

Fixed submission:
n = int(input())
s = input()
cnt = 0
for i in range(n-2):
    if s[i] == 'A' and s[i+1] == 'B' and s[i+2] == 'C':
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
if a >= k:
    a -= k
elif a < k and a + b >= k:
    b = b - (k-a)
    a = 0
else:
    a = 0
    b = 0
print(a, b)

Fixed submission:
s, t = input().split()
print(t+s)

Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
if a >= k:
    a -= k
elif a + b >= k:
    b = b - (k-a)
    a = 0
else:
    a = 0
    b = 0
print(a, b)

Fixed submission:
s, t = input().split()
print(t+s)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())
for i in range(k):  
    if a > 0:
        a -= 1
    elif b > 0:
        b -= 1
    else:
        break
print(a, b)

Fixed submission:
a, b, k = map(int, input().split())
if a >= k:
    a -= k
elif a < k and a + b >= k:
    b = b - (k-a)
    a = 0
else:
    a = 0
    b = 0
print(a, b)
Buggy python submission (verdict: Runtime Error):
import fraction
a, b = map(int, input().split())
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
print(lcm(a, b))

Fixed submission:
a = [int(input())]
b = [int(input())]
l = [1, 2, 3]
ans = set(l) - set(a) -set(b)
print(list(ans)[0])
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)
def lcm(a, b):
    return (a * b) // math.gcd(a, b)
print(lcm(a, b))

Fixed submission:
a, b = map(int, input().split())
def gcd(a, b):
    while b:
        a, b= b, a%b
    return a
def lcm(a, b):
    return (a * b) // gcd(a, b)
print(lcm(a, b))

Buggy python submission (verdict: Runtime Error):
import fractions
a, b = map(int, input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
print(lcm(a, b))

Fixed submission:
a, b = map(int, input().split())
def gcd(a, b):
    while b:
        a, b= b, a%b
    return a
def lcm(a, b):
    return (a * b) // gcd(a, b)
print(lcm(a, b))

Buggy python submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
print(lcm(a, b))

Fixed submission:
a, b = map(int, input().split())
def gcd(a, b):
    while b:
        a, b= b, a%b
    return a
def lcm(a, b):
    return (a * b) // gcd(a, b)
print(lcm(a, b))
Buggy python submission (verdict: Runtime Error):
s = input()
l = [None, 'SAT', 'FRY', 'THU', 'WED', 'TUE', 'MON', 'SUN']
print(l.index(s))

Fixed submission:
s = input()
l = [None, 'SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
print(l.index(s))
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(1000000)
from collections import deque

# 整数の入力
N = int(input())
s = 0

while N//10 != 0 or  N%10 !=0:
    s += N%10
    N //= 10

if s % 9 == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(1000000)
from collections import deque

# 整数の入力
N = int(input())
# s = 0

# while N//10 != 0 or  N%10 !=0:
#     s += N%10
#     N //= 10

if N % 9 == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import math
# スペース区切りの整数の入力
X, K, D = map(int, input().split())

cross = abs(-(-X//D))

if cross >= K:
    for i in range(K):
        if X >= 0:
            X -= D
        else:
            X += D
    print(abs(X))
else:
    for i in range(cross):
        if X >= 0:
            X -= D
        else:
            X += D
    
    if (K-cross)%2 == 0:
        print(abs(X))
    else:
        if X >= 0:
            print(abs(X-D))
        else:
            print(abs(X+D))





Fixed submission:
#!/usr/bin/env python3
import math
# スペース区切りの整数の入力
X, K, D = map(int, input().split())

cross = abs(-(-X//D))

if cross >= K:
    if X >= 0:
        X -= D*K
    else:
        X += D*K
    print(abs(X))
else:
    if X >= 0:
        X -= D*cross
    else:
        X += D*cross
    
    if (K-cross)%2 == 0:
        print(abs(X))
    else:
        if X >= 0:
            print(abs(X-D))
        else:
            print(abs(X+D))
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
# 整数の入力
k = int(input())

x = 7%k
s=[]
i = 1
while(s.count(x) == 0):
    if x == 0:
        print(i)
        exit(0)
    s.append(x)
    x=(10*x+7)%k
    i += 1

print(-1)







Fixed submission:
#!/usr/bin/env python3
# 整数の入力
k = int(input())

x = 7%k
for i in range(1, k+1):
    if x == 0:
        print(i)
        exit(0)
    x=(10*x+7)%k

print(-1)

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
# 整数の入力
k = int(input())

if k % 2 == 0:
    print(-1)
    #print("a")
    exit(0)

d1 = k % 10
print(d1)
if d1 != 1 and d1 != 7 and d1 != 3 and d1 != 9:
    print(-1)
    #print("b")
    exit(0)

def PrimeJudge(n):
    ret = True
    for i in range(2, int(n ** 0.5)+1):
        if n % i == 0:
            ret = False
            break
    return ret

if PrimeJudge(k) == False:
    print(-1)
    #print("c")
    exit(0)

s = 7
while(1):
    i = int(s)
    if i < k:
        s = str(s)+'7'
    else:
        if i % k == 0:
            print(len(s))
            exit(0)
        else:
            s = str(s)+'7'





Fixed submission:
#!/usr/bin/env python3
# 整数の入力
k = int(input())

x = 7%k
for i in range(1, k+1):
    if x == 0:
        print(i)
        exit(0)
    x=(10*x+7)%k

print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
num_list = list(map(int, input().split()))
ori_list = set(num_list)
for i in range(a):
    if i+1 in ori_list:
        print(num_list.count(i+1))
    else:
        print(0)

Fixed submission:

from collections import Counter
a = int(input())
num_list = list(map(int, input().split()))
D = Counter(num_list)
for i in range(a):
    print(D[i+1])

Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
num_list = list(map(int, input().split()))
for i in range(a):
    print(num_list.count(i+1))

Fixed submission:

from collections import Counter
a = int(input())
num_list = list(map(int, input().split()))
D = Counter(num_list)
for i in range(a):
    print(D[i+1])
Buggy python submission (verdict: Time Limit Exceeded):

def gcd_tri(a,b,c):
    if a < b:
        a,b = b,a
    while a % b != 0:
        a,b = b, a%b
    if b < c:
        b,c = c,b
    while b % c != 0:
        b,c = c, b%c
    return c

a = int(input())

ans =0
for n in range(a):
    for l in range(a):
        for m in range(a):
            ans += gcd_tri(n+1,l+1,m+1)
print(ans)

Fixed submission:
import math
a = int(input())
lis =[]
ans = 0
for x in range(1,a+1):
    for y in range(1, a+1):
        lis.append(math.gcd(x,y))
for z in range(1, a+1):
    for l in lis:
        ans += math.gcd(z,l)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

a = int(input())
def gcd(*numbers):
    return reduce(math.gcd, numbers)
ans =0
for n in range(a):
    for l in range(a):
        for m in range(a):
            ans += gcd(n+1,l+1,m+1)
print(ans)

Fixed submission:
import math
a = int(input())
lis =[]
ans = 0
for x in range(1,a+1):
    for y in range(1, a+1):
        lis.append(math.gcd(x,y))
for z in range(1, a+1):
    for l in lis:
        ans += math.gcd(z,l)
print(ans)
Buggy python submission (verdict: Runtime Error):
S=str(input())
if S[3]　== S[2]:
  if S[4]==S[6]:
    return str(Yes)
  

Fixed submission:

S = str(input())
a= 'Yes'
b='No'
if S[3] is S[2] and S[4] is S[5]:
    print(a)
else:
    print(b)
Buggy python submission (verdict: Runtime Error):
a=int(input())
n = math.floor(a/500)
total_price= n * 1000 + (a - n * 500)
print(total_price)

Fixed submission:
import math
a=int(input())
n = math.floor(a/500)
m = math.floor((a - n * 500)/5)
total_price= n * 1000 + m*5
print(total_price)
Buggy python submission (verdict: Runtime Error):
N=int(input())
M=int(input())

print(int((M-1)*M/2+(N-1)*N/2))

Fixed submission:
inp=str(input())
N= int(inp.split()[0])
M=int(inp.split()[1])
n= abs(N)
m=abs(M)
sum_N = (N-1)*N/2
sum_M=(M-1)*M/2
sum_all = sum_N + sum_M
print(int(sum_all))

Buggy python submission (verdict: Runtime Error):
N=int(input())
M=int(input())
sum_N = (N-1)*N/2
sum_M=(M-1)*M/2
sum_all = sum_N + sum_M
print(int(sum_all))

Fixed submission:
inp=str(input())
N= int(inp.split()[0])
M=int(inp.split()[1])
n= abs(N)
m=abs(M)
sum_N = (N-1)*N/2
sum_M=(M-1)*M/2
sum_all = sum_N + sum_M
print(int(sum_all))

Buggy python submission (verdict: Runtime Error):
N=int(input())
M=int(input())
sum_N = (N-1)*N/2
sum_M=(M-1)*M/2
sum_all = sum_N + sum_M
print(int(sum_all))

Fixed submission:
inp=str(input())
N= int(inp.split()[0])
M=int(inp.split()[1])
n= abs(N)
m=abs(M)
sum_N = (N-1)*N/2
sum_M=(M-1)*M/2
sum_all = sum_N + sum_M
print(int(sum_all))
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = map(int, input().split())
b_list = list(b)
count = 0
for i in range(len(b_list)):
    if b_list[i] == min(b_list[:i+1]):
        count += 1
        
print(count)

Fixed submission:
n = input()
(p,q) = n.split()
a='Yes'
b='No'
if p == q:
    print(a)
else:
    print(b)
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = map(int, input().split())
b_list = list(b)
count = 0
for i in range(len(b_list)):
    if b_list[i] == min(b_list[:i+1]):
        count += 1
        
print(count)

Fixed submission:
a = int(input())
b_list = list(map(int, input().split()))
count = 0
mini=a
for i in range(len(b_list)):
    if b_list[i] <= mini:
        count += 1
        mini = b_list[i]
        
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = map(int, input().split())
b_list = list(b)
count = 0
for i in range(len(b_list)):
    if b_list[i] == min(b_list[:i+1]):
        count += 1
        
print(count)

Fixed submission:
a = int(input())
b_list = list(map(int, input().split()))
count = 0
mini=a
for i in range(len(b_list)):
    if b_list[i] <= mini:
        count += 1
        mini = b_list[i]
        
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = map(int, input().split())
b_list = list(b)
count = 0
for i in range(len(b_list)):
    if b_list[i] == min(b_list[:i+1]):
        count += 1
        
print(count)

Fixed submission:
a = int(input())
b_list = list(map(int, input().split()))
count = 0
mini=a
for i in range(len(b_list)):
    if b_list[i] <= mini:
        count += 1
        mini = b_list[i]
        
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
def pos_num(l):
    l_sort = l.copy()
    l_len = len(l)
    l_sort.sort()
    if l_len == 1:
        an = 0
    else:
        #print(l_sort.index(l[0])+1)
        an = (l_sort.index(l[0]))*math.factorial(l_len-1)
    #print(an)
    return an 

    

ls = list(map(int, input().split()))
an = 0
for i in range(n-1):
    b = pos_num(ls[i:])
    an += b
    #print(an)
    
print()
ll = list(map(int, input().split()))
bn = 0
for i in range(n-1):
    b = pos_num(ll[i:])
    bn += b
    #print(bn)

print(abs(an-bn))

Fixed submission:
import math
n = int(input())
def pos_num(l):
    l_sort = l.copy()
    l_len = len(l)
    l_sort.sort()
    if l_len == 1:
        an = 0
    else:
        #print(l_sort.index(l[0])+1)
        an = (l_sort.index(l[0]))*math.factorial(l_len-1)
    #print(an)
    return an 

    

ls = list(map(int, input().split()))
an = 0
for i in range(n-1):
    b = pos_num(ls[i:])
    an += b
    #print(an)
    

ll = list(map(int, input().split()))
bn = 0
for i in range(n-1):
    b = pos_num(ll[i:])
    bn += b
    #print(bn)

print(abs(an-bn))
Buggy python submission (verdict: Runtime Error):
a_list=[1,2,3]
p,q= input().split()
a_list.remove(int(p))
a_list.remove(int(q))
print(a_list[0])

Fixed submission:
a_list=[1,2,3]
p= input()
q=input()
a_list.remove(int(p))
a_list.remove(int(q))
print(a_list[0])