Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
C = list(map(int,input().split()))

def chose(A):
    s = 0
    t = 0
    for i in range(len(A)):
        t = A.count(i+1) 
        for q in range(t):
            s += q
    print(s)

for i in range(N):
    B = C[:]
    B.pop(i)
    chose(B)

Fixed submission:
N,M = map(int,input().split())
s = t = 0
for i in range(N):
    s += i
for i in range(M):
    t += i
print(s+t)
Buggy python submission (verdict: Time Limit Exceeded):
l = int(input())
sum = 0
c = 0

for i in range(1,l):
  for ii in range(1,l):
    sum = i * ii
    if sum >= l:
      break
    else:
      c+=1

print(c)

Fixed submission:
l = int(input())
sum = 0
c = 0

for i in range(1,l):
  for ii in range(i,l):
    sum = i * ii
    if sum >= l:
      break
    else:
      if i != ii:
        c+=2
      else:
        c+=1

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

sum = 0
num = 0
nm = [1,0,-1]
c = n[3]
cu =0


while c != 0:
    for i in n:
        if i <= c:
            sum += nm[num] * i
            c-=i
            num+=1




print(sum)


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

sum = 0
num = 0
nm = [1,0,-1]
c = n[3]
cu =0


for i in n:
    if c == 0:
        break
    if i > c:
        sum+= nm[num]*c
        break
    if i <= c:
        sum += nm[num] * i
        c-=i
        num+=1




print(sum)

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

sum = 0
num = 0
nm = [1,0,-1]

c = 0

while True:
    if n[num] == 0:
        num += 1
        continue
    sum += nm[num]
    n[num]-=1
    c+=1
    if c == n[3]:
        break


print(sum)


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

sum = 0
num = 0
nm = [1,0,-1]
c = n[3]
cu =0


for i in n:
    if c == 0:
        break
    if i > c:
        sum+= nm[num]*c
        break
    if i <= c:
        sum += nm[num] * i
        c-=i
        num+=1




print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
i = int(input())
ii = list(map(int,input().split()))

import collections

c = collections.Counter(ii)
k = list(c.keys())

for a in range(i):
    if k.count(a+1)==0:
        print(0)
    else:
        print(c[a+1])

Fixed submission:
i = int(input())
ii = list(map(int,input().split()))

import collections

c = collections.Counter(ii)
k = list(c.keys())

for a in range(1,i+1):
    print(c[a])

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

import collections

c = collections.Counter(ii)
k = list(c.keys())

for a in range(i):
    if k.count(a+1)==0:
        print(0)
    else:
        print(c[a+1])

Fixed submission:
i = int(input())
ii = list(map(int,input().split()))

import collections

c = collections.Counter(ii)
k = list(c.keys())

for a in range(1,i+1):
    print(c[a])
Buggy python submission (verdict: Runtime Error):
n = str(input())

for i in range(len(n)):
  if n[i]=="7":
    print("Yes")
  if i == n-1:
    print("No")


Fixed submission:
n = str(input())

for i in range(len(n)):
  if n[i]=="7":
    print("Yes")
    break
  if i == len(n)-1:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = 1
li = []
while l < n+1:
  if l % 3 == 0 and l % 5 == 0 or l % 3 == 0 or l % 5 == 0:
    li.append(l)
    l+=1
  else:
    li+=1

print(li)
    

Fixed submission:
n = int(input())
l = 1
li = []
while l < n+1:
  if l % 3 == 0 and l % 5 == 0 or l % 3 == 0 or l % 5 == 0:
    l+=1
  else:
    li.append(l)
    l+=1

print(sum(li))

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = 1
li = []
while l < n+1:
  if l % 3 == 0 and l % 5 == 0 or l % 3 == 0 or l % 5 == 0:
    li.append(l)
    l+=1
  else:
    li+-1

print(li)
    

Fixed submission:
n = int(input())
l = 1
li = []
while l < n+1:
  if l % 3 == 0 and l % 5 == 0 or l % 3 == 0 or l % 5 == 0:
    l+=1
  else:
    li.append(l)
    l+=1

print(sum(li))
Buggy python submission (verdict: Time Limit Exceeded):
n,b,r=map(int,input().split())

flag = True
count = 0
counts = 0
while flag == True:
  for i in range(b):
    count += 1
    counts += 1
    if counts == n:
      flag = False
      break
  for i in range(r):
    counts += 1
    if counts == n:
      flag = False
      break

print(count)

Fixed submission:
n,b,r=map(int,input().split())


count = n // (b+r)
counts = n % (b+r)

countss=b*count
if counts<= b:
  coun=counts
else:
  coun=b

print(countss+coun)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
nn = list(map(int,input().split()))

count = 1

for i in range(n):
  print(nn.index(count)+1)
  count += 1


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

import numpy as np

ll = np.array(nn)
p = list(ll.argsort())

for i in p:
  print(i+1)

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

l = sorted(nn)

for i in l:
  print(nn.index(i)+1)


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

import numpy as np

ll = np.array(nn)
p = list(ll.argsort())

for i in p:
  print(i+1)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
nn = list(map(int,input().split()))
import numpy as np

l = np.sort(nn)

for i in l:
  print(nn.index(i)+1)


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

import numpy as np

ll = np.array(nn)
p = list(ll.argsort())

for i in p:
  print(i+1)

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

l = sorted(nn)

for i in l:
  print(nn.index(i)+1)


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

import numpy as np

ll = np.array(nn)
p = list(ll.argsort())

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

ll = [int(input()) for i in range(a)]

l=[]
for i in range(n):
  l.append(p)

for j in ll:
  for i in range(n):
    if i != j-1:
      l[i] = l[i]-1
      
for i in l:
  if i <=0:
    print("No")
  else:
    print("Yes")

      

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

ll = [int(input()) for i in range(a)]


import collections

c = collections.Counter(ll)

for i in range(n):
  if c.get(i+1)==None:
    if p - a > 0:
      print("Yes")
    else:
      print("No")
    continue
  if a - c.get(i+1) >= p:
    print("No")
  else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
a,b = int(input())

a-=1
b-=1

print(a*b)

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

print((a-1)*(b-1))

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

a-=1
b-=1

print(a*b)

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

print((a-1)*(b-1))
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
if k % 2 == 0:
    print("-1")
else:
    seven = "7"
    point = False
    for i in range(1000000):
        if int(seven) % k == 0:
            point = True
            break
        else:
            seven += "7"
    if point:
        print(len(seven))
    else:
        print("-1")

Fixed submission:
k = int(input())
ans = -1
x = 7 % k
if not k%2 == 0:
    for i in range(1, k+1):
        if x == 0:
            ans = i
            break
        x = (x * 10 + 7) % k


print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
memo = []
for i in range(k,n+1):
    x = a[i-1] % mod
    for j in range(i-1, i-k, -1):
        y = a[j-1] % mod
        x *= y
    memo.append(x)

for test in range(1, len(memo)):
    if memo[test - 1] < memo[test]:
        print("Yes")
    else:
        print("No")

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

for i in range(k+1, n+1):
    if a[i-1] > a[i-k-1]:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
memo = []
for i in range(k,n+1):
    x = a[i-1] % mod
    for j in range(i-1, i-k, -1):
        y = a[j-1] % mod
        x *= y
    memo.append(x)

for test in range(1, len(memo)):
    if memo[test - 1] < memo[test]:
        print("Yes")
    else:
        print("No")

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

for i in range(k+1, n+1):
    if a[i-1] > a[i-k-1]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

def culc(number):
    count = 0
    num = int(number ** 0.5)
    for i in range(1, num+1):
        for j in range(1, num+1):
            for k in range(1, num+1):
                tmp = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
                if tmp == number:
                    count += 1
    return count

for i in range(1, n+1):
    if i < 6:
        print(0)
    elif i == 6:
        print(1)
    else:
        print(culc(i))



Fixed submission:
n = int(input())
ans = [0] * 1030302

for i in range(1, 101):
    for j in range(1, 101):
        for k in range(1, 101):
            number = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
            ans[number] += 1


for x in range(1, n+1):
    print(ans[x])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

def culc(number):
    count = 0
    num = int(number ** 0.5)
    for i in range(1, num+1):
        for j in range(1, num+1):
            for k in range(1, num+1):
                tmp = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
                if tmp == number:
                    count += 1
    return count

for i in range(1, n+1):
    if i < 6:
        print(0)
    elif i == 6:
        print(1)
    else:
        print(culc(i))



Fixed submission:
n = int(input())
ans = [0] * 1030302

for i in range(1, 101):
    for j in range(1, 101):
        for k in range(1, 101):
            number = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
            ans[number] += 1


for x in range(1, n+1):
    print(ans[x])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 0
for i in range(1, n+1):
    for j in range(i, n+1, i):
        ans += j
    

print(ans)

Fixed submission:
n = int(input())
ans = 0
for i in range(1, n+1):
    for j in range(i, n+1, i):
        ans += j
    

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(input().split())
q = int(input())
for i in range(q):
    b, c = input().split()
    replace_a = [i.replace(b, c) if i == b else i for i in a]
    print(sum(map(int, replace_a)))
    a = replace_a


Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
sum_a = sum(a)
count_a = Counter(a)
q = int(input())
for i in range(q):
    b, c = map(int, input().split())
    tmp = count_a[b]
    new = {c : tmp}
    count_a.update(new)
    del count_a[b]
    sum_a = sum_a - b * tmp + c * tmp
    print(sum_a)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(input().split())
q = int(input())
for i in range(q):
    b, c = input().split()
    replace_a = [i.replace(b, c) if i == b else i for i in a]
    print(sum(map(int, replace_a)))
    a = [str(j) for j in replace_a]


Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
sum_a = sum(a)
count_a = Counter(a)
q = int(input())
for i in range(q):
    b, c = map(int, input().split())
    tmp = count_a[b]
    new = {c : tmp}
    count_a.update(new)
    del count_a[b]
    sum_a = sum_a - b * tmp + c * tmp
    print(sum_a)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(input().split())
q = int(input())
for i in range(q):
    b, c = input().split()
    replace_a = [int(i.replace(b, c)) if int(i) == int(b) else int(i) for i in a]
    print(sum(replace_a))
    a = [str(j) for j in replace_a]


Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
sum_a = sum(a)
count_a = Counter(a)
q = int(input())
for i in range(q):
    b, c = map(int, input().split())
    tmp = count_a[b]
    new = {c : tmp}
    count_a.update(new)
    del count_a[b]
    sum_a = sum_a - b * tmp + c * tmp
    print(sum_a)
Buggy python submission (verdict: Time Limit Exceeded):
import collections
s = input()
mod = 2019
mod_lst = [0]*mod
mod_lst[0] +=1
tmp = 0
t = 1
for i in reversed(s):
    x = int(i) * t
    y = (x % mod + tmp) % mod
    mod_lst[y] += 1
    tmp = y
    t = t*10


count = 0
for j in mod_lst:
    a = j*(j-1)//2
    count += a
print(count)

Fixed submission:
s = input()
mod = 2019
mod_lst = [0]*mod
mod_lst[0] =1
x = 0
t = 1
for i in reversed(s):
    x += int(i) * t
    y = x % mod
    t *= 10
    t %= mod
    mod_lst[y] += 1


count = 0
for j in mod_lst:
    a = j*(j-1)//2
    count += a
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
s = input()
mod = 2019
mod_lst = [0]
tmp = 0
t = 1
for i in reversed(s):
    x = int(i) * t
    y = (x % mod + tmp) % mod
    mod_lst.append(y)
    tmp = y
    t = t*10

lst_count = collections.Counter(mod_lst)
count = 0
for j in lst_count.values():
    a = j*(j-1)//2
    count += a
print(count)

Fixed submission:
s = input()
mod = 2019
mod_lst = [0]*mod
mod_lst[0] =1
x = 0
t = 1
for i in reversed(s):
    x += int(i) * t
    y = x % mod
    t *= 10
    t %= mod
    mod_lst[y] += 1


count = 0
for j in mod_lst:
    a = j*(j-1)//2
    count += a
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
if len(s) <= 4 and int(s) != 2019 and int(s) < 4038:
    print(0)
elif len(s) <= 4 and int(s) == 2019:
    print(1)
else:
    count = 0
    for i in range(len(s)-3):
        for j in range(4,len(s)+1):
            x = s[i:j]
            if x != "" and int(x) % 2019 == 0:
                count += 1
    print(count)

Fixed submission:
s = input()
mod = 2019
mod_lst = [0]*mod
mod_lst[0] =1
x = 0
t = 1
for i in reversed(s):
    x += int(i) * t
    y = x % mod
    t *= 10
    t %= mod
    mod_lst[y] += 1


count = 0
for j in mod_lst:
    a = j*(j-1)//2
    count += a
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
for i in range(1,n+1):
    if i in a:
        print(a.count(i))
    else:
        print(0)

Fixed submission:
import math
r = int(input())
x = math.pi
print(r*2*x)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
for i in range(1,n+1):
    if i in a:
        print(a.count(i))
    else:
        print(0)

Fixed submission:
import collections
n = int(input())
a = list(map(int, input().split()))
x = collections.Counter(a)
for i in range(1,n+1):
    print(x[i])

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

Fixed submission:
import collections
n = int(input())
a = list(map(int, input().split()))
x = collections.Counter(a)
for i in range(1,n+1):
    print(x[i])

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

Fixed submission:
import collections
n = int(input())
a = list(map(int, input().split()))
x = collections.Counter(a)
for i in range(1,n+1):
    print(x[i])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(input().split())
subordinate = []
for i in range(1,n+1):
    i = str(i)
    count = a.count(i)
    subordinate.append(count)
for j in subordinate:
    print(j)

Fixed submission:
import collections
n = int(input())
a = list(map(int, input().split()))
x = collections.Counter(a)
for i in range(1,n+1):
    print(x[i])
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import fractions
from functools import reduce
k = int(input())
num = []
for i in range(1, k+1):
    num.append(i)
    num.append(i)
    num.append(i)
permutation_num = set(itertools.permutations(num, 3))
x = []
for j in permutation_num:
    y = reduce(fractions.gcd, j)
    x.append(y)

print(sum(x))

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

Buggy python submission (verdict: Runtime Error):
import itertools
import fractions
from functools import reduce
k = int(input())
num = []
for i in range(1, k+1):
    num.append(i)
    num.append(i)
    num.append(i)
permutation_num = set(itertools.permutations(num, 3))
x = []
for j in s:
    y = reduce(fractions.gcd, j)
    x.append(y)

print(sum(x))

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

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import fractions
from functools import reduce
k = int(input())
num = []
for i in range(1, k+1):
    num.append(i)
    num.append(i)
    num.append(i)
permutation_num = list(itertools.permutations(num, 3))
s = set(permutation_num)
x = []
for j in s:
    y = reduce(fractions.gcd, j)
    x.append(y)

print(sum(x))

Fixed submission:
import math
k = int(input())
a = []
for i in range(1, k+1):
    for j in range(1, k+1):
        x = math.gcd(i, j)
        for l in range(1, k+1):
            y = math.gcd(l, x)
            a.append(y)
print(sum(a))
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = abs(n - k)
if k == 1:
    print(0)
elif a > n:
    print(n)
else:
    while n // k > 0:
        tmp = n % k
        n = n // k
    print(abs(tmp - k))

Fixed submission:
n, k = map(int, input().split())
a = n % k
b = k - a
print(min(a, b))

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = abs(n - k)
tmp = a
if k == 1:
    print(0)
elif a > n:
    print(n)
else:
    while n > tmp:        
        n = abs(n - k)
        tmp = abs(n - k)
    print(n)

Fixed submission:
n, k = map(int, input().split())
a = n % k
b = k - a
print(min(a, b))
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
ans = n // (a + b) * a
x = n % (a + b)
ans += min(a, x)
print(ans)

Fixed submission:
s = input()
if "A" in s and "B" in s:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
x = n - (a + b)
y = x % b
print(a + y)

Fixed submission:
n, a, b = map(int, input().split())
ans = n // (a + b) * a
x = n % (a + b)
ans += min(a, x)
print(ans)

Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
x = n - a
y = x % b
print(a + y)

Fixed submission:
n, a, b = map(int, input().split())
ans = n // (a + b) * a
x = n % (a + b)
ans += min(a, x)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))
count = 0
for i in range(len(p)):
    tmp = p[i]
    a = min(p[:i+1])
    if tmp == a:
        count+=1
print(count)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
count = 1
tmp = p[0]
for i in p:
    a = min(tmp, i)
    if tmp != a:
        count+=1
        tmp = a
print(count)
Buggy python submission (verdict: Runtime Error):
from bisect import bisect_left
n = int(input())
l = list(map(int, input().split()))
sort_l = sorted(l)
count = 0

for a in range(n-1):
    for b in range(i+1, n):
        c = bisect_left(sort_l, sort_l[a] + sort_l[b])
        if c > b:
            count += c - b -1
        else:
            pass     
        

print(count)



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

for a in range(n):
    for b in range(a+1, n):
        c = bisect.bisect_left(sort_l, sort_l[a] + sort_l[b])
        if c > b:
            count += c - b -1
        else:
            pass     
        

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int, input().split()))
sort_l = sorted(l)
count = 0
for i in range(n-2):
    for j in range(i+1, n-1):        
        for k in range(j+1, n):
            two_line = sort_l[i] + sort_l[j]
            one_line = sort_l[k]
            if two_line > one_line:
                count += 1

print(count)



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

for a in range(n):
    for b in range(a+1, n):
        c = bisect.bisect_left(sort_l, sort_l[a] + sort_l[b])
        if c > b:
            count += c - b -1
        else:
            pass     
        

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations
n = int(input())
l = list(map(int, input().split()))
combination_line = list(combinations(l, 3))
count = 0
for i in combination_line:
    line1 = i[0]
    line2 = i[1]
    line3 = i[2]
    if line1 < line2 + line3 and line2 < line1 + line3 and line3 < line1 + line2:
        count += 1

print(count)


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

for a in range(n):
    for b in range(a+1, n):
        c = bisect.bisect_left(sort_l, sort_l[a] + sort_l[b])
        if c > b:
            count += c - b -1
        else:
            pass     
        

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations
n = int(input())
l = list(map(int, input().split()))
combination_line = list(combinations(l, 3))
count = 0
for i in combination_line:
    line1 = i[0]
    line2 = i[1]
    line3 = i[2]
    if line1 < line2 + line3 and line2 < line1 + line3 and line3 < line1 + line2:
        count += 1

print(count)


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

for a in range(n):
    for b in range(a+1, n):
        c = bisect.bisect_left(sort_l, sort_l[a] + sort_l[b])
        if c > b:
            count += c - b -1
        else:
            pass     
        

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

attend = [str(a.index(i) + 1) for i in range(1, n+1)]

print(" ".join(attend))

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

ans = [""]*n

for i in range(n):
    x = a[i]
    b = ans[a[i] - 1]
    c = str(i+1)
    ans[a[i]-1] = str(i+1)

print(" ".join(ans))

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

attend = [str(a.index(i) + 1) for i in range(1, n+1)]

print(" ".join(attend))

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

ans = [""]*n

for i in range(n):
    x = a[i]
    b = ans[a[i] - 1]
    c = str(i+1)
    ans[a[i]-1] = str(i+1)

print(" ".join(ans))

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

ans = ""
for i in sort_a:
    attend = str(a.index(i) + 1) + " "
    ans += attend
    

print(ans)

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

ans = [""]*n

for i in range(n):
    x = a[i]
    b = ans[a[i] - 1]
    c = str(i+1)
    ans[a[i]-1] = str(i+1)

print(" ".join(ans))

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

attend = [str(a.index(i)+1) for i in sort_a]

ans = " ".join(attend)
print(ans)

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

ans = [""]*n

for i in range(n):
    x = a[i]
    b = ans[a[i] - 1]
    c = str(i+1)
    ans[a[i]-1] = str(i+1)

print(" ".join(ans))