Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())

if n >= 1000:
    n = int(str(n[1:]))

if n > 0:
    ans = 1000 - n
else:
    ans = 0

print(ans)

Fixed submission:
n = int(input())

if n >= 1000:
    n = int(str(n)[1:])

if n > 0:
    ans = 1000 - n
else:
    ans = 0

print(ans)

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

n = int(n[1:])
if n > 0:
    ans = 1000 - n
else:
    ans = 0

print(ans)

Fixed submission:
n = int(input())

if n >= 1000:
    n = int(str(n)[1:])

if n > 0:
    ans = 1000 - n
else:
    ans = 0

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

min_ = float('inf')
combi = itertools.combinations(p, k)
for c in combi:
    min_ = min(min_, sum(c))
    
print(min_)

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

p = sorted(p)
ans = sum(p[:k])
print(ans)
Buggy python submission (verdict: Runtime Error):
arr = ["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 = int(input())

def calc(sho, res):
    q, mod = divmod(sho, 26)
    res = arr[mod - 1] + res
    if (mod == 0):
        print(res)
    else:
        res = arr[q - 1] + res
        print(res)
    return
    
calc(n, "")

Fixed submission:
n = int(input())

def calc(m, res):
        q, mod = divmod(m, 26)
        if (mod == 0):
            q = q - 1
            mod = 26
            res = chr(ord("a") + (mod - 1)) + res
        else:
            res = chr(ord("a") + (mod - 1)) + res
        if (q > 0):
            calc(q, res)
        else:
            print(res)
        return
    
calc(n, "")

Buggy python submission (verdict: Runtime Error):
def calc(sho, res):
    q, mod = divmod(sho, 26)
    res = arr[mod - 1] + res
    if(q >= 26):
        calc(q, res)
    else:
        if (q == 0):
            print(res)
        elif(mod == 0):
            print(res)
        else:
            res = arr[q - 1] + res
            print(res)
    return 

calc(n, "")

Fixed submission:
n = int(input())

def calc(m, res):
        q, mod = divmod(m, 26)
        if (mod == 0):
            q = q - 1
            mod = 26
            res = chr(ord("a") + (mod - 1)) + res
        else:
            res = chr(ord("a") + (mod - 1)) + res
        if (q > 0):
            calc(q, res)
        else:
            print(res)
        return
    
calc(n, "")
Buggy python submission (verdict: Time Limit Exceeded):
import math
from fractions import Fraction

x = int(input())
rad = Fraction((math.pi / 180) * x)

k = 0
while True:
    k += 1
    s = rad * k
    if s % (math.pi * 2) == 0:
        break
print(k)

Fixed submission:
import math
from fractions import Fraction

x = int(input())


k = 0
while True:
    k += 1
    s = x * k
    if s % 360 == 0:
        break
print(k)

Buggy python submission (verdict: Runtime Error):

x = int(input())
rad = (math.pi / 180) * x

cos = 0
sin = 0
k = 0
while True:
    cos += (math.cos(rad * k))
    sin += (math.sin(rad * k))
    k += 1
    if int(cos) ==0 and int(sin) == 0:
        break
if k == 359:
    k = 360
print(k)

Fixed submission:
import math
from fractions import Fraction

x = int(input())


k = 0
while True:
    k += 1
    s = x * k
    if s % 360 == 0:
        break
print(k)
Buggy python submission (verdict: Runtime Error):
n = int(input())

a = list(map(int, input().split()))
for _, val in enumerate(a):
    ans *= val
if ans > 10**18:
    print(-1)
else:
    print(ans)


Fixed submission:
n = int(input())

a = list(map(int, input().split()))
ans = 1
if 0 in a:
    print(0)
else:
    for num, val in enumerate(a):
        ans *= val
        if ans > 10**18:
            print(-1)
            break 
    else:
        print(ans)
Buggy python submission (verdict: Runtime Error):
t = input()
 
ans = replace("?", "D")
print(ans)

Fixed submission:
t = input()
 
ans = t.replace("?", "D")
print(ans)

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

ans = replace("?", "D")
print

Fixed submission:
t = input()
 
ans = t.replace("?", "D")
print(ans)

Buggy python submission (verdict: Runtime Error):
t = input()
t = list(t)

if t[0] == "?":
    if t[1] == "P":
        t[0] = "D"
    else:
        t[0] = "P"
        
for i in range(1, len(t) - 1):
    if t[i] == "?":
        if t[i - 1] == "P":
            t[i] = "D"
        else:
            if t[i + 1] == "P":
                t[i] = "D"
            else:
                t[i] = "P"
if t[len(t) - 1] == "?":
        t[len(t) - 1] = "D"
            
                
ans = "".join(t)
print(ans)

Fixed submission:
t = input()
 
ans = t.replace("?", "D")
print(ans)

Buggy python submission (verdict: Runtime Error):
t = input()
t = list(t)

if t[0] == "?":
    if t[1] == "P":
        t[0] = "D"
    else:
        t[0] = "P"
        
for i in range(1, len(t)):
    if i < len(t) - 1:
        if t[i] == "?":
            if t[i - 1] == "P":
                t[i] = "D"
            else:
                if t[i + 1] == "P":
                    t[i] = "D"
                else:
                    t[i] = "P"
        else:
            t[len(t) - 1] = "D"
            
                
ans = "".join(t)
print(ans)

Fixed submission:
t = input()
 
ans = t.replace("?", "D")
print(ans)

Buggy python submission (verdict: Runtime Error):
t = input()
t = list(t)

if t[0] == "?":
    if t[1] == "P":
        t[0] = "D"
    else:
        t[0] = "P"
        
for i in range(1, len(t)):
    if t[i] == "?":
        if t[i - 1] == "P":
            t[i] = "D"
        else:
            if t[i + 1] == "P":
                t[i] = "D"
            else:
                t[i] = "P"
                
ans = "".join(t)
print(ans)

Fixed submission:
t = input()
 
ans = t.replace("?", "D")
print(ans)

Buggy python submission (verdict: Runtime Error):
t = input()
t = list(t)

if t[1] == "?":
    if t[2] == "P":
        t[1] = "D"
    else:
        t[1] = "P"
        
for i in range(2, len(t)):
    if t[i] == "?":
        if t[i - 1] == "P":
            t[i] = "D"
        else:
            if t[i + 1] == "P":
                t[i] = "D"
            else:
                t[i] = "P"
                
ans = "".join(t)
print(ans)

Fixed submission:
t = input()
 
ans = t.replace("?", "D")
print(ans)
Buggy python submission (verdict: Runtime Error):
2000000000 0 0 2000000000

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

x = k - a
if x <= 0:
    print(k)
else:
    y = x - b
    if y <= 0:
        print(a)
    else: 
        print(a + ((k - (a + b)) * (-1)))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
h = list(map(int, input().split()))
pairs = [list(map(int, input().split())) for _ in range(m)]

ans = [1] * n

for i in range(m):
    if h[pairs[i][0] - 1] < h[pairs[i][1] - 1]:
        ans[pairs[i][0] - 1] = 0
    elif h[pairs[i][0] - 1] = h[pairs[i][1] - 1]:
        ans[pairs[i][0] - 1] = 0
        ans[pairs[i][1] - 1] = 0 
    else:
        ans[pairs[i][1] - 1] = 0      

print(sum(ans))

Fixed submission:
n, m = map(int, input().split())
h = list(map(int, input().split()))
pairs = [list(map(int, input().split())) for _ in range(m)]

ans = [1] * n

for i in range(m):
    if h[pairs[i][0] - 1] < h[pairs[i][1] - 1]:
        ans[pairs[i][0] - 1] = 0
    elif h[pairs[i][0] - 1] == h[pairs[i][1] - 1]:
        ans[pairs[i][0] - 1] = 0
        ans[pairs[i][1] - 1] = 0 
    else:
        ans[pairs[i][1] - 1] = 0      

print(sum(ans))

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
h = list(map(int, input().split()))
pairs = [list(map(int, input().split())) for _ in range(m)]

ans = [1] * n

for i in range(m):
    if h[pairs[i][0] - 1] < h[pairs[i][1] - 1]:
        ans[pairs[i][0] - 1] = 0
    elif f h[pairs[i][0] - 1] = h[pairs[i][1] - 1]:
        ans[pairs[i][0] - 1] = 0
        ans[pairs[i][1] - 1] = 0 
    else:
        ans[pairs[i][1] - 1] = 0      

print(sum(ans))

Fixed submission:
n, m = map(int, input().split())
h = list(map(int, input().split()))
pairs = [list(map(int, input().split())) for _ in range(m)]

ans = [1] * n

for i in range(m):
    if h[pairs[i][0] - 1] < h[pairs[i][1] - 1]:
        ans[pairs[i][0] - 1] = 0
    elif h[pairs[i][0] - 1] == h[pairs[i][1] - 1]:
        ans[pairs[i][0] - 1] = 0
        ans[pairs[i][1] - 1] = 0 
    else:
        ans[pairs[i][1] - 1] = 0      

print(sum(ans))

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
h = list(map(int, input().split()))
pairs = [list(map(int, input().split())) for _ in range(m)]

ans = [-1] * n

for i in range(m):
    if h[pairs[i][0] - 1] < h[pairs[i][1] - 1]:
            ans[pairs[i][0] - 1] = 0
            if ans[pairs[i][1] - 1] != 0:
                ans[pairs[i][1] - 1] = 1
    else:
        if ans[pairs[i][0] - 1] !=0:
            ans[pairs[i][0] - 1] = 1
        ans[pairs[i][1] - 1] = 0      
    print(ans)
for i in range(n):
    if ans[i] == -1:
        ans[i] = 1
print(ans)
print(sum(ans))

Fixed submission:
n, m = map(int, input().split())
h = list(map(int, input().split()))
pairs = [list(map(int, input().split())) for _ in range(m)]

ans = [1] * n

for i in range(m):
    if h[pairs[i][0] - 1] < h[pairs[i][1] - 1]:
        ans[pairs[i][0] - 1] = 0
    elif h[pairs[i][0] - 1] == h[pairs[i][1] - 1]:
        ans[pairs[i][0] - 1] = 0
        ans[pairs[i][1] - 1] = 0 
    else:
        ans[pairs[i][1] - 1] = 0      

print(sum(ans))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

res = [0] * n
cnt = 1
for i in range(1, n-1):
    if a[i-1] == a[i]:
        cnt += 1
    else:
        res[a[i-1]-1] = cnt
        cnt = 1
res[a[i-1]-1] = cnt
[print(j) for j in res]

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

res = [0] * n
for i in range(len(a)):
    res[a[i]-1] += 1

[print(j) for j in res]

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

for i in range(1, n + 1):
    cnt = 0
    flg = False
    for j in a:
        if i == j:
            flg = True
            cnt += 1
        elif i != j and flg == True:
            break
    print(cnt)

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

res = [0] * n
for i in range(len(a)):
    res[a[i]-1] += 1

[print(j) for j in res]

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

for i in range(1, n + 1):
    cnt = 0
    for j in a:
        if i == j:
            cnt += 1
        else:
            pass
    print(cnt)

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

res = [0] * n
for i in range(len(a)):
    res[a[i]-1] += 1

[print(j) for j in res]
Buggy python submission (verdict: Time Limit Exceeded):
def gcd_(a, b):
    if a % b == 0: return b
    return gcd_(b, a % b)

k = int(input())
res = 0
for i in range(1, k+1):
    for j in range(1, k+1):
        for m in range(1, k+1):
            res += gcd_(gcd_(i, j), m)

print(res)


Fixed submission:
from math import gcd

k = int(input())
res = 0
for i in range(1, k+1):
    for j in range(1, k+1):
        for m in range(1, k+1):
            res += gcd(gcd(i, j), m)

print(res)

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

k = int(input())
res = 0
for i in range(1, k+1):
    for j in range(1, k+1):
        for m in range(1, k+1):
            res += math.gcd(math.gcd(i, j), m)

print(res)

Fixed submission:
from math import gcd

k = int(input())
res = 0
for i in range(1, k+1):
    for j in range(1, k+1):
        for m in range(1, k+1):
            res += gcd(gcd(i, j), m)

print(res)

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

k = int(input())
ans = 0
for i in range(1, k+1):
    for j in range(1, k+1):
        for m in range(1, k+1):
            res =reduce(math.gcd, (i, j, m))
            ans += res
print(ans)

Fixed submission:
from math import gcd

k = int(input())
res = 0
for i in range(1, k+1):
    for j in range(1, k+1):
        for m in range(1, k+1):
            res += gcd(gcd(i, j), m)

print(res)

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

def gcd_(*num):
    return reduce(math.gcd, num)


k = int(input())
ans = 0
for i in range(1, k+1):
    for j in range(1, k+1):
        for m in range(1, k+1):
#             l = list(i, j, m)
            res =gcd_(i, j, m)
            ans += res
print(ans)

Fixed submission:
from math import gcd

k = int(input())
res = 0
for i in range(1, k+1):
    for j in range(1, k+1):
        for m in range(1, k+1):
            res += gcd(gcd(i, j), m)

print(res)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))

a.sorted(reverse=True)
if a[m-1] >= (sum(a)*(1/(4*m))):
    print("Yes")
else:
    print("No")

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

a.sort(reverse=True)
if a[m-1] >= (sum(a)*(1/(4*m))):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import sys
s = input()

l = len(s)

if l % 2 == 1:
    print("No")
    return
    sys.exit(0)
else:
    for i in range(0, l, 2):
        if s[i:i+2] == "hi":
            continue
        else:
            print("No")
            sys.exit(0)
    print("Yes")

Fixed submission:
s = input()
 
l = len(s)
 
if l % 2 != 0:
    print("No")
else:
    for i in range(0, l, 2):
        if s[i:i+2] == "hi":
            if i == l-2:
                print("Yes") 
            else:
                continue

        else:
            print("No")
            break

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

l = len(s)

if l % 2 == 1:
    print("No")
else:
    for i in range(0, l, 2):
        if s[i:i+2] == "hi":
            continue
        else:
            print("No")
            return
    print("Yes")

Fixed submission:
s = input()
 
l = len(s)
 
if l % 2 != 0:
    print("No")
else:
    for i in range(0, l, 2):
        if s[i:i+2] == "hi":
            if i == l-2:
                print("Yes") 
            else:
                continue

        else:
            print("No")
            break

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

l = len(s)
# print(l)
# print(s[0:1])
if l % 2 != 0:
    print("No")
else:
    for i in range(0, l, 2):
        if s[i:i+2] == "hi":
            # print(s[i:i+1])
        else:
            print("No")
            break
    print("Yes")

Fixed submission:
s = input()
 
l = len(s)
 
if l % 2 != 0:
    print("No")
else:
    for i in range(0, l, 2):
        if s[i:i+2] == "hi":
            if i == l-2:
                print("Yes") 
            else:
                continue

        else:
            print("No")
            break
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
r = -1
for price in range(1010):
    tax_8 = int(price * 0.08)
    tax_10 = int(price * 0.1)
    if tax_8 == a and tax_10 == b:
        r = price
        braek
print(r)


Fixed submission:
a, b = map(int, input().split())
r = -1
for price in range(1010):
    tax_8 = int(price * 0.08)
    tax_10 = int(price * 0.1)
    if tax_8 == a and tax_10 == b:
        r = price
        break
print(r)

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
r = "-1"
for price in range(1010):
    tax_8 = int(price * 0.08)
    tax_10 = int(price * 0.1)
    if tax_8 == a and tax_10 == b :
        r = price
        braek
print(r)

Fixed submission:
a, b = map(int, input().split())
r = -1
for price in range(1010):
    tax_8 = int(price * 0.08)
    tax_10 = int(price * 0.1)
    if tax_8 == a and tax_10 == b:
        r = price
        break
print(r)
Buggy python submission (verdict: Runtime Error):
s = input()
q = int(input())
flg = False

for i in range(q):
    x = input()
    if int(len(x)) == 1:
        a = int(x)
        if flg == False:
            flg = True
        else:
            flg = False
        print("G:",s)
    else:
        a, b, c = map(str, x.split()) 
        if flg == False and int(b) == 1:
            s = c + s
        elif flg == False and int(b) == 2:
            s = s + c
        elif flg == True and int(b) == 1:
            s = s + c
        else:
            s = c + s

if flg == True:
    s = s[::-1]
print(s)

Fixed submission:
from collections import deque

s = input()
q = int(input())

t = deque(s)
flg = False
for _ in range(q):
    query = input()
    if query[0] == "1":
        flg = not flg
    elif query[0] == "2":
        _, f, c = query.split()
        if f == "1":
            if flg:
                t.append(c)
            else:
                t.appendleft(c)
        elif f == "2":
            if flg:
                t.appendleft(c)
            else:
                t.append(c)
result = "".join(t)
if flg:
    result = result[::-1]
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())
flg = False

for i in range(q):
    x = input()
    if int(len(x)) == 1:
        a = int(x)
        s = s[::-1] 
        # print(s)
    else:
        a, b, c = map(str, x.split()) 
        if int(b) == 1:
            s = c + s
            # print(s)
        else:
            s = s + c
            # print(s)

print(s)

Fixed submission:
from collections import deque

s = input()
q = int(input())

t = deque(s)
flg = False
for _ in range(q):
    query = input()
    if query[0] == "1":
        flg = not flg
    elif query[0] == "2":
        _, f, c = query.split()
        if f == "1":
            if flg:
                t.append(c)
            else:
                t.appendleft(c)
        elif f == "2":
            if flg:
                t.appendleft(c)
            else:
                t.append(c)
result = "".join(t)
if flg:
    result = result[::-1]
print(result)
Buggy python submission (verdict: Runtime Error):
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]

Size = 3
bingo = False
for row in a:
    if all(item in b for item in row):
        bingo = True
for col in zip(*a):
    if all(item in b for item in col):
        bingo = True
if all(a[i][i] in b for i in range(Size)):
    bingo = True
if all(a[i][Size - 1 - i] in b for i in range(Size)):
    bingo = True
 
print("Yes" if bingo else "No")

Fixed submission:
n = int(input())
a = n // 2
b = n % 2
print(a + b)
Buggy python submission (verdict: Runtime Error):
res = False
for row in a:
    if all(num in b for num in row):
        res = True
for col in zip(a):
    if all(num in b for num in col):
        res = True
if all(a[i][i] in b for i range(3)):
        res = True
if all(a[i][2 - i] in b for i range(3)):
        res = True


print("Yes" if res else("No"))

Fixed submission:
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]

Size = 3
bingo = False
for row in a:
    if all(item in b for item in row):
        bingo = True
for col in zip(*a):
    if all(item in b for item in col):
        bingo = True
if all(a[i][i] in b for i in range(Size)):
    bingo = True
if all(a[i][Size - 1 - i] in b for i in range(Size)):
    bingo = True
 
print("Yes" if bingo else "No")
Buggy python submission (verdict: Runtime Error):
[print(n) for n in max_name] [print(n) for n in max_name] n = int(input())
name = {}
for _ in range(n):
    st = str(input())
    if st in name:
        tmp = name[st] + 1
        name[st] = tmp
    else:
        name[st] = 1

max_val = max(name.values())
max_name = [k for k, v in name.items() if v==max_val]
max_name.sort
for n in max_name:
    print(n)

Fixed submission:
n = int(input())
name = {}
for i in range(n):
    st = str(input())
    if st in name:
        tmp = name[st] + 1
        name[st] = tmp
    else:
        name[st] = 1

max_val = max(name.values())
max_name = [k for k, v in name.items() if v==max_val]
max_name = sorted(max_name)

for n in max_name:
    print(n)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a.sort()

for i in range(len(a)):
    if a[i] == a[i-1]
    print("NO")
else:
    print("YES")

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
length1 = len(a)
length2 = len(set(a))
# print(length1, length2)
if length1 == length2:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = list(map(int, input().split())) #サイコロの最大値

# 期待値の配列を作る
e = []
max_m = 0
f = []
e = [(1+p[i])/2  for i in range(n)]
for j in range(n-k+1):
    m = sum(e[j:j+k])
    max_m = max(max_m, m)
    # if max_m < m:
    #     max_m = m

print(max_m)

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

e = []
max_ = 0
sum_ = 0
f = []
e = [(1+p[i])/2  for i in range(n)]
for i in range(n):
    if i < k:
        sum_ += e[i]
        max_ = sum_
    else:
        sum_ = sum_ + e[i] - e[i - k]
        max_ = max(max_, sum_)

print(max_)
Buggy python submission (verdict: Runtime Error):
h = int(input())

def dev(n):
    if n == 1:
        retuen 1
    else:
        retuen 1 + dev(n//2) * 2

print(dev(h))

Fixed submission:
h = int(input())

def dev_(n):
    if n == 1:
        return 1
    else:
        return 1 + dev_(n//2) * 2

print(dev_(h))

Buggy python submission (verdict: Runtime Error):
def dev(n):
    if n = 1:
        retuen 1
    else:
        retuen 1 + dev(n//2) * 2

print(dev(h))


Fixed submission:
h = int(input())

def dev_(n):
    if n == 1:
        return 1
    else:
        return 1 + dev_(n//2) * 2

print(dev_(h))

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

def dev(n):
    if n = 1:
        retuen 1
    else:
        retuen 1 + dev(n//2) * 2

print(def(h))

Fixed submission:
h = int(input())

def dev_(n):
    if n == 1:
        return 1
    else:
        return 1 + dev_(n//2) * 2

print(dev_(h))
Buggy python submission (verdict: Runtime Error):
cnt = 1
tmp_min = p[0]
for i in range(n-1):
    tmp_min = min(tmp_min, p[i+1]) 
    if tmp_min == p[i+1]:
        cnt += 1
print(cnt)

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

cnt = 1
tmp_min = p[0]
for i in range(1, n):
    tmp_min = min(tmp_min, p[i]) 
    if tmp_min == p[i]:
        cnt += 1
print(cnt)

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

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

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

cnt = 1
tmp_min = p[0]
for i in range(1, n):
    tmp_min = min(tmp_min, p[i]) 
    if tmp_min == p[i]:
        cnt += 1
print(cnt)

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

cnt = 0
for i in range(n):
    for j in range(i):
        if p[j]<p[i]:
            break
    else:
        cnt += 1

print(cnt)

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

cnt = 1
tmp_min = p[0]
for i in range(1, n):
    tmp_min = min(tmp_min, p[i]) 
    if tmp_min == p[i]:
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())

def cookie(t, s, p):
        if t > 0:
            t = t - 1
        elif s > 0:
            s = s - 1
        else:
            pass
        p -= 1
        if p > 0:
            cookie(t, s, p)
        return t, s
    
res = cookie(a, b, k)
t, s = res
print(t, s)

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

if a > k:
    print(a - k, b)
else:
    print(0, max(0, a + b - k))

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

def cookie(t, s, p):
        if t > 0:
            t = t - 1
        elif s > 0:
            s = s - 1
        else:
            pass
        p -= 1
        if p > 0:
            cookie(t, s, p)
        return t, s
    
res = cookie(a, b, k)
print(res)

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

if a > k:
    print(a - k, b)
else:
    print(0, max(0, a + b - k))