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

gcache = { }
s = 0

for a in range(1, k+1):
  for b in range(1, k+1):
    tup = (min(a, b), max(a, b))
    if tup not in gcache:
      gc = math.gcd(tup[0], tup[1])
      gcache[tup] = gc
    gc = gcache[tup]
    for c in range(1, k+1):
      tup = (min(c, gc), max(c, gc))
      if tup not in gcache:
        gc = math.gcd(tup[0], tup[1])
        gcache[tup] = gc
      gc = gcache[tup]
      s += gc

print(s)


Fixed submission:
k = int(input())

from math import gcd

s = 0
for a in range(1, k+1):
  for b in range(1, k+1):
    g = gcd(a, b)
    for c in range(1, k+1):
      s += gcd(g, c)

print(s)

Buggy python submission (verdict: Time Limit Exceeded):
import math
k = int(input())

s = 0
for a in range(1, k+1):
  for b in range(1, k+1):
    for c in range(1, k+1):
      g = math.gcd(math.gcd(a, b), c)
      s += g

print(s)


Fixed submission:
k = int(input())

from math import gcd

s = 0
for a in range(1, k+1):
  for b in range(1, k+1):
    g = gcd(a, b)
    for c in range(1, k+1):
      s += gcd(g, c)

print(s)
Buggy python submission (verdict: Runtime Error):
def incr_lunlun(num):
    num[0] += 1
    if len(num) == 1:
        if num[0] == 10:
            num.append(1)
            num[0] = 0

    elif num[0] > num[1] + 1 or num[0] == 10:
        suffix = incr_lunlun(num[1:])
        num = [suffix[0] - 1] + list(suffix)

    return num


def main():
    k = int(input())
    num = [1]
    for i in range(k-1): 
        num = incr_lunlun(num)

    print(int(''.join(str(i) for i in reversed(num))))



main()


Fixed submission:
def incr_lunlun(num):
    num[0] += 1
    if len(num) == 1:
        if num[0] == 10:
            num.append(1)
            num[0] = 0
    
    elif num[0] > num[1] + 1 or num[0] == 10:
        suffix = incr_lunlun(num[1:])
        digit = max(0, suffix[0] - 1)
        num = [digit] + list(suffix)

    return num


def main():
    k = int(input())
    num = [1]
    for i in range(k-1): 
        num = incr_lunlun(num)

    print(int(''.join(str(i) for i in reversed(num))))



main()
Buggy python submission (verdict: Runtime Error):
k, n = (int(i) for i in input().split())
st [int(i) for i in input().split()]

st = sorted(st)
st.append(st[0] + k)

diffs = [st[i+1] - st[i] for i in range(n)]

print(k - max(diffs))


Fixed submission:
def main():
    k, n = (int(i) for i in input().split())
    st = [int(i) for i in input().split()]

    st = sorted(st)
    st.append(st[0] + k)

    diffs = [st[i+1] - st[i] for i in range(n)]

    print(k - max(diffs))

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

t = s[:(n-1)//2]
u = s[(n+3)//2:]

if (s == s[::-1]
    and len(t) > 0 and len(u) > 0 and
    and t == t[::-1]
    and u == u[::-1]):
  print('Yes')
else:
  print('No')
  


Fixed submission:
s = input()
n = len(s)

t = s[:(n-1)//2]
u = s[(n+3)//2-1:]

if (s == s[::-1]
    and t == t[::-1]
    and u == u[::-1]):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

def main():
    n = int(input())
    balls = [int(i) for i in input().split()]

    # v - value written on ball
    # b - ball index in [0, n)
    # ct - number of times a value occurs

    # hist[v] = ct
    hist = Counter(balls)
    diff_counts = set(hist.values())
    combos1 = { ct: 0 if ct == 1 else (ct-1) * (ct-2) // 2 for ct in
            diff_counts }
    combos = { ct: ct * (ct-1) // 2 for ct in diff_counts  }

    for b in range(n):
        v = balls[b]
        ct = hist[v]
        tot = sum(combos[hist[v2]] for v2 in hist.keys())
        print(tot - combos[ct] + combos1[ct])

main()


Fixed submission:
from collections import Counter

def main():
    n = int(input())
    balls = [int(i) for i in input().split()]

    # v - value written on ball
    # b - ball index in [0, n)
    # ct - number of times a value occurs

    # hist[v] = ct
    hist = Counter(balls)
    diff_counts = set(hist.values())
    combos1 = { ct: 0 if ct == 1 else (ct-1) * (ct-2) // 2 for ct in
            diff_counts }
    combos = { ct: ct * (ct-1) // 2 for ct in diff_counts  }

    tot = sum(combos[hist[v2]] for v2 in hist.keys())

    for b in range(n):
        v = balls[b]
        ct = hist[v]
        print(tot - combos[ct] + combos1[ct])

main()
Buggy python submission (verdict: Runtime Error):
n, a, b = [int(i) for i in input().split]

if a + b == 0:
  print(0)
else:
  c, r = n // (a + b), n % (a + b)
  nblue = c * a + min(a, r)
  print(nblue)


Fixed submission:
def main():
    n, a, b = [int(i) for i in input().split()]

    if a + b == 0:
        print(0)
    else:
        c, r = n // (a + b), n % (a + b)
        nblue = c * a + min(a, r)
        print(nblue)

main()
Buggy python submission (verdict: Runtime Error):
def main():
    n, m = list(map(int, input().split()))
    dcon = [set() for _ in range(n)]
    for _ in range(m):
        s, c = tuple(map(int, input().split()))
        dcon[s-1].add(c)

    if any(len(d) > 1 for d in dcon):
        print(-1)
        return
    
    digits = [0] if n == 1 else [1] + [0] * (n-1)
    for i in range(n):
        if d:
            digits[i] = d.pop()

    print(''.join(map(str, digits)))

main()


Fixed submission:
def main():
    n, m = list(map(int, input().split()))
    dcon = [set() for _ in range(n)]
    for _ in range(m):
        s, c = tuple(map(int, input().split()))
        dcon[s-1].add(c)

    if any(len(d) > 1 for d in dcon):
        print(-1)
        return
    
    digits = [0] if n == 1 else [1] + [0] * (n-1)
    for i in range(n):
        if dcon[i]:
            digits[i] = dcon[i].pop()

    if digits[0] == 0 and n != 1:
        print(-1)

    else:
        print(''.join(map(str, digits)))

main()

Buggy python submission (verdict: Runtime Error):
def main():
    n, m = list(map(int, input().split()))
    dcon = [set() for _ in range(n)]
    for _ in range(m):
        s, c = tuple(map(int, input().split()))
        dcon[s-1].add(c)

    if any(len(d) > 1 for d in dcon):
        print(-1)
        return
    
    # populate the digits with the constrained digit, if it exists,
    # or the minimum possible digit.  the min possible digit is
    # 1 if it's the leading digit, or zero otherwise
    digits = [d.pop() if d else 0 + int(i == 0) for i, d in enumerate(dcon)]

    if digit[0] == 0:
        print(-1)
    else:
        print(''.join(map(str, digits)))

main()


Fixed submission:
def main():
    n, m = list(map(int, input().split()))
    dcon = [set() for _ in range(n)]
    for _ in range(m):
        s, c = tuple(map(int, input().split()))
        dcon[s-1].add(c)

    if any(len(d) > 1 for d in dcon):
        print(-1)
        return
    
    digits = [0] if n == 1 else [1] + [0] * (n-1)
    for i in range(n):
        if dcon[i]:
            digits[i] = dcon[i].pop()

    if digits[0] == 0 and n != 1:
        print(-1)

    else:
        print(''.join(map(str, digits)))

main()
Buggy python submission (verdict: Runtime Error):
import math
N, K = map(int, input().split())

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(1, K + 1):
    b = combinations_count(K - 1, i - 1)
    r = combinations_count(N - K + 1, i)
    print((b * r) % (10 **9 + 7))

Fixed submission:
import math
N, K = map(int, input().split())

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(1, K + 1):
    b = combinations_count(K - 1, i - 1)
    if i > N - K + 1:
        r = 0
    else:
        r = combinations_count(N - K + 1, i)
        
    print((b * r) % (10 **9 + 7))
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for i in range(M)]

CB = []
for i in BC:
    CB.append([i[1], i[0]])

A.sort()
CB.sort(reverse=True)

cnt = 0
for i in CB:
    for j in range(i[1]):
        if A[cnt] < i[0] and cnt < N:
            A[cnt] = i[0]
            cnt += 1
        else:
            print(sum(A))
            exit()

print(sum(A))

Fixed submission:
N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for i in range(M)]

CB = []
for i in BC:
    CB.append([i[1], i[0]])

A.sort()
CB.sort(reverse=True)

cnt = 0
for i in CB:
    for j in range(i[1]):
        if cnt < N:
            if A[cnt] < i[0]:
                A[cnt] = i[0]
                cnt += 1
            else:
                print(sum(A))
                exit()
        else:
            print(sum(A))
            exit()

print(sum(A))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = [str(input()) for i in range(N)]

ans = 0
firstB = 0
lastA = 0
cnt = 0
for s in S:
    if s[0] == 'B':
        firstB += 1
    if s[-1:] == 'A':
        lastA += 1

    if s[0] == 'B' and s[-1:] == 'A':
        cnt += 1

    ans += s.count('AB')
    
if cnt == max([firstB,lastA]):
    print(ans + cnt -1)
else:
    print(ans+ min([firstB,lastA]))

Fixed submission:
N, K = map(int, input().split())

print(N - K + 1)
Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int, input().split())

ans = 0
for r in range(N//R + 1):
    for g in range( (N - r * R)//G + 1):
        if r * R + g * G < N and (N - r * R - g * G) % B == 0:
            ans += 1
        if r * R + g * G == N:
            ans += 1

print(ans)

Fixed submission:
R, G, B, N = map(int, input().split())

ans = 0
for r in range(N//R + 1):
    for g in range( (N - r * R)//G + 1):
        if (N - r * R - g * G) % B == 0:
            ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = str(input())

s0 = s[0]
a = [0]

s = s.replace('10', '1,0')
s = s.replace('01', '0,1')
s = s.split(',')
for i in s:
    a.append(a[-1] + len(i))

if len(a) == 2:
    print(a[1])
    exit()
ans = []
if s0 == '0':
    for i in range(2 * k,len(a)):
        ans.append(a[i] - a[i - (2 * k)])
else:
    for i in range(2 * k + 1,len(a)):
        ans.append(a[i] - a[i - (2 * k + 1)])

print(max(ans))

Fixed submission:
n, k = map(int, input().split())
s = str(input())

a = [0]

ls = s.replace('10', '1,0')
ls = ls.replace('01', '0,1')
ls = ls.split(',')
for i in ls:
    a.append(a[-1] + len(i))

ans = 0
res = 0
if s[0] == '1':
    for i in range(len(a)):
        if i % 2 == 0:
            ans = a[min(i + 2 * k + 1, len(a) - 1)] - a[i]
        else:
            ans = a[min(i + 2 * k, len(a) - 1)] - a[i]

        res = max(res, ans)

else:
    for i in range(len(a)):
        if i % 2 == 0:
            ans = a[min(i + 2 * k, len(a) - 1)] - a[i]
        else:
            ans = a[min(i + 2 * k + 1, len(a) - 1)] - a[i]

        res = max(res, ans)

print(res)
Buggy python submission (verdict: Time Limit Exceeded):
s = str(input())
s1 = len(s)
a = len(s)
b = 0

while a != b:
    a = len(s)
    s = s.replace('01','')
    s = s.replace('10','')

    b = len(s)

print(s1-b)


Fixed submission:
s = str(input())

a = s.count('0')
b = s.count('1')

print(len(s) - abs(a-b))
Buggy python submission (verdict: Runtime Error):
N = int(input())
d = []
for _ in range(N):
    d.append(list(map(int,input().split())))

for x in range(101):
    for y in range(101):
        flag = True
        h = d[0][2] + abs(d[0][0] - x) + abs(d[0][1] - y)
        for i in d:
            if i[2] != max(h - abs(i[0] - x) - abs(i[1] - y),0):
                flag = False
                break

        if flag:
            ansx = x
            ansy = y
            ansh = h

print(ansx,ansy,ansh)

Fixed submission:
N = int(input())
d = []
for j in range(N):
    X, Y, H = map(int,input().split())
    d.append([X, Y, H])
    if H != 0:
        a = [X, Y, H]
for x in range(101):
    for y in range(101):
        flag = True
        h = a[2] + abs(a[0] - x) + abs(a[1] - y)
        for i in d:
            if i[2] != max(h - abs(i[0] - x) - abs(i[1] - y), 0):
                flag = False
                break

        if flag:
            print(x, y, h)
            exit()
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

for i in make_divisors(M):
    if i < M // N:
        ans = i 
print(ans)

Fixed submission:
N, M = map(int, input().split())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

for i in make_divisors(M):
    if i <= M // N:
        ans = i 

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

if in.isupper():
  print("A")
else:
  print("a")

Fixed submission:
tmp = input()

if tmp.isupper():
    print("A")
else:
    print("a")
Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce


def combination(n, r, mod):
    r = min(r, n-r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)

    return (numer // denom) % mod


n = int(input())
s = input()

S = len(s)
ans = 0
mod = 10 ** 9 + 7

for i in range(0, n+1):
    com = combination(S-1+i, S-1, mod)
    exp26 = pow(26, n-i, mod)
    exp25 = pow(25, i, mod)

    ans += (com * exp26 * exp25) % mod

ans %= mod

print(ans)

Fixed submission:
n = int(input())
s = input()

S = len(s)
mod = 10 ** 9 + 7

tmp_ans = pow(26, n, mod)
div = pow(26, -1, mod)

ans = tmp_ans

for i in range(1, n+1):
    tmp_ans = (tmp_ans * 25 * div) % mod
    tmp_ans = ((tmp_ans * (S-1+i)) * pow(i, -1, mod)) % mod
    ans = (ans + tmp_ans) % mod

ans %= mod

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

mx = 1e18
pr = 1
done = True

for i in a:
	pr = pr*i

if pr <= mx:
	print(pr)
else:
	print(-1)

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

mx = 1e18
pr = 1
done = True
zero = False

for i in a:
	if i == 0:
		zero = True

if zero == False:
	for i in a:
		pr = pr*i
		if pr > mx:
			break
else:
	pr = 0
if zero or pr <= mx:
	print(pr)
else:
	print(-1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()

if n % 2 == 1:
    print("No")
else:
    if s[:(n//2)] == x[(n//2):]:
        print("Yes")
    else:
        print("No")

Fixed submission:
n = int(input())
s = input()

if n % 2 == 1:
    print("No")
else:
    if s[:(n//2)] == s[(n//2):]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
def mod_combination(n, k, mod):
    # nCk (mod m)
    def mod_permutation(n, k, mod):
        if n<=k:
            return 1
        else:
            return (n * mod_permutation(n-1,k,mod))%mod

    def mod_inv_permutation(k, mod):
        k, mod = int(k), int(mod)
        if k<=1:
            return 1
        else:
            return (pow(k,mod-2,mod) * mod_inv_permutation(k-1, mod))%mod

    return (mod_permutation(n,n-k,mod) * mod_inv_permutation(k, mod))%mod

x, y = map(int,input().split())

if not((x + y) % 3 == 0):
    print(0)
elif (x > 2*y) or (y > 2 * x):
    print(0)
else:
    k = (x + y) // 3
    i = x - k
    print(mod_combination(k, i, 10 ** 9 + 7))

Fixed submission:

# Python3 function to  
# calculate nCr % p 
def ncr(n, r, p): 
    # initialize numerator 
    # and denominator 
    num = den = 1 
    for i in range(r): 
        num = (num * (n - i)) % p 
        den = (den * (i + 1)) % p 
    return (num * pow(den,  
            p - 2, p)) % p 


x, y = map(int,input().split())

if not((x + y) % 3 == 0):
    print(0)
elif (x > 2*y) or (y > 2 * x):
    print(0)
else:
    k = (x + y) // 3
    i = x - k
    print(ncr(k, i, 10 ** 9 + 7))

Buggy python submission (verdict: Runtime Error):
from scipy.special import comb

x, y = map(int,input().split())

if not((x + y) % 3 == 0):
    print(0)
elif (x > 2*y) or (y > 2 * x):
    print(0)
else:
    k = (x + y) // 3
    i = x - k
    print(comb(k, i, exact=True) % (10 ** 9 + 7))


Fixed submission:

# Python3 function to  
# calculate nCr % p 
def ncr(n, r, p): 
    # initialize numerator 
    # and denominator 
    num = den = 1 
    for i in range(r): 
        num = (num * (n - i)) % p 
        den = (den * (i + 1)) % p 
    return (num * pow(den,  
            p - 2, p)) % p 


x, y = map(int,input().split())

if not((x + y) % 3 == 0):
    print(0)
elif (x > 2*y) or (y > 2 * x):
    print(0)
else:
    k = (x + y) // 3
    i = x - k
    print(ncr(k, i, 10 ** 9 + 7))

Buggy python submission (verdict: Runtime Error):
from scipy.special import comb

x, y = map(int,input().split())

if not((x + y) % 3 == 0):
    print(0)
elif (x > 2*y) or (y > 2 * x):
    print(0)
else:
    k = (x + y) // 3
    i = x - k
    print(comb(k, i, exact=True))

Fixed submission:

# Python3 function to  
# calculate nCr % p 
def ncr(n, r, p): 
    # initialize numerator 
    # and denominator 
    num = den = 1 
    for i in range(r): 
        num = (num * (n - i)) % p 
        den = (den * (i + 1)) % p 
    return (num * pow(den,  
            p - 2, p)) % p 


x, y = map(int,input().split())

if not((x + y) % 3 == 0):
    print(0)
elif (x > 2*y) or (y > 2 * x):
    print(0)
else:
    k = (x + y) // 3
    i = x - k
    print(ncr(k, i, 10 ** 9 + 7))
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n = int(input())
l = list(map(int,input().split()))

ls = sorted(l)

count = 0
for i in range(n):
    for j in range(i+1, n):
        x, y = ls[i], ls[j]
        index = bisect.bisect_left(ls[j+1:], x + y)
        count += index
print(count)

Fixed submission:
import bisect
n = int(input())
l = list(map(int,input().split()))
ls = sorted(l)

count = 0
for i in range(n):
    for j in range(i+1, n):
        index = bisect.bisect_left(ls[j+1:], ls[i] + ls[j])
        count += index
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n = int(input())
l = list(map(int,input().split()))
ls = sorted(l, reverse = True)

count = 0
for i in range(n):
    x = ls[i]
    comb = list(itertools.combinations(ls[i+1:], 2))
    for j in range(len(comb)):
        if sum(comb[j]) > x:
            count += 1
print(count)

Fixed submission:
import bisect
n = int(input())
l = list(map(int,input().split()))
ls = sorted(l)

count = 0
for i in range(n):
    for j in range(i+1, n):
        index = bisect.bisect_left(ls[j+1:], ls[i] + ls[j])
        count += index
print(count)

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

count = 0
for i in range(n):
    for j in range(i + 1, n):
        x, y = ls[i], ls[j]
        tri_xy = [k for k in ls[j + 1:] if k < x + y]
        count += len(tri_xy)
print(count)

Fixed submission:
import bisect
n = int(input())
l = list(map(int,input().split()))
ls = sorted(l)

count = 0
for i in range(n):
    for j in range(i+1, n):
        index = bisect.bisect_left(ls[j+1:], ls[i] + ls[j])
        count += index
print(count)

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

count = 0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            x, y, z = l[i], l[j], l[k]
            if x + y > z and x + z > y and y + z > x:
                count += 1
print(count)

Fixed submission:
import bisect
n = int(input())
l = list(map(int,input().split()))
ls = sorted(l)

count = 0
for i in range(n):
    for j in range(i+1, n):
        index = bisect.bisect_left(ls[j+1:], ls[i] + ls[j])
        count += index
print(count)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
n = min(a, b)
def get_primenumber(N):
    #素数リスト
    prime_list = [2]
    #3からNまでの数字を一つずつ取り出す
    for num in range(3,N+1,2):
      #取り出した数字が素数リストの要素で割れなければ素数リストに追加する
      if all( num % prime != 0 for prime in prime_list):
        prime_list.append(num)

    return prime_list
l = get_primenumber(n)
count = 1
for p in l:
    if a % p == 0 and b % p == 0:
        count += 1
print(count)

Fixed submission:
n = int(input())
if n % 2 == 0:
    odds = n // 2
else:
    odds = (n // 2)  + 1
ans = odds / n
print(ans)

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
n = min(a, b)
def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]
l = primes(n)
count = 1
for p in l:
    if a % p == 0 and b % p == 0:
        count += 1
print(count)

Fixed submission:
n = int(input())
if n % 2 == 0:
    odds = n // 2
else:
    odds = (n // 2)  + 1
ans = odds / n
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
odds = (n // 2)  + 1
ans = odds / n
return ans

Fixed submission:
n = int(input())
if n % 2 == 0:
    odds = n // 2
else:
    odds = (n // 2)  + 1
ans = odds / n
print(ans)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int, input().split()))
h_s = sort(h, reverse = True)
ans = n
for i in range(n):
    if h_s[i] > k:
        ans = i + 1
        break
print(ans)

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
h_s = sorted(h, reverse = True)
ans = n
for i in range(n):
    if h_s[i] < k:
        ans = i
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = []
for i in range(n):
    ans[a[i]] = i
print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
for i in range(n):
    ans[(a[i] - 1)] = i +1
print(' '.join(map(str, ans)))
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n, m = map(int, input().split())
a = list(map(int, input().split()))

a_sorted = sorted(a)

for i in range(m):
    maximum = a_sorted.pop(-1)
    bisect.insort_left(a_sorted, maximum//2)

ans = sum(a_sorted)
print(ans)

Fixed submission:
import heapq

n, m = map(int, input().split())
a = list(map(lambda x : int(x) * (-1), input().split()))
heapq.heapify(a)

for i in range(m):
    maximum = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-maximum//2))
print(-sum(a))

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

a_sorted = sorted(a)

while m > 0:
    maximum = a_sorted.pop(-1)
    if maximum % 2 == 0:
        bisect.insort_left(a_sorted, maximum//2)
    else:
        bisect.insort_left(a_sorted, maximum//2)
    m += -1
ans = sum(a_sorted)
print(ans)

Fixed submission:
import heapq

n, m = map(int, input().split())
a = list(map(lambda x : int(x) * (-1), input().split()))
heapq.heapify(a)

for i in range(m):
    maximum = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-maximum//2))
print(-sum(a))
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input.split())
if (a*b) % 2 == 1:
	print("Odd")
else:
	print("Even")

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

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

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