Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
a = list(map(int,input().split()))

score = [1 for _ in range(n-k+1)]
temp = 1
for i in range(k):
    temp *= a[i]
score[0] = temp
for j in range(1,n-k+1):
    score[j] = score[j-1]*a[j+k-1]//a[j-1]

#print(score)
for i in range(1,n-k+1):
    if score[i-1] < score[i]:
        print('Yes')
    else:
        print('No')
    

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

for i in range(k,n):
    if a[i-k] < a[i]:
        print('Yes')
    else:
        print('No')

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

score = 1

for i in range(k):
    score *= a[i]

for j in range(k,n):
    score_before = score
    score =  score * a[j] // a[j-k]
    #print('score_befor',score_before)
    #print('score',score)
    if score_before < score:
        print('Yes')
    else:
        print('No')
    

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

for i in range(k,n):
    if a[i-k] < a[i]:
        print('Yes')
    else:
        print('No')

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

score = 1

for i in range(k):
    score *= a[i]

for j in range(k,n):
    score_before = score
    score =  score * a[j] // a[j-k]
    #print('score_befor',score_before)
    #print('score',score)
    if score_before < score:
        print('Yes')
    else:
        print('No')
    

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

for i in range(k,n):
    if a[i-k] < a[i]:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
#D
import sys
sys.setrecursionlimit(10**7)
import sympy
n = int(input())

from functools import lru_cache

@lru_cache(maxsize=None)
def s(n,gokei):
    if n == 1:
        return gokei+1
    out = len(sympy.divisors(n))*n
    gokei += out
    return s(n-1,gokei)

print(s(n,0))

Fixed submission:
#D
n = int(input())

ans = 0
for i in range(1,n+1):
    tmp = n // i
    ans += tmp * (i + n//i * i) // 2
    
print(ans)

Buggy python submission (verdict: Runtime Error):
#D
import sympy
n = int(input())

from functools import lru_cache

@lru_cache
def s(n,gokei):
    if n == 1:
        return gokei+1
    out = len(sympy.divisors(n))*n
    gokei += out
    return s(n-1,gokei)

print(s(n,0))

Fixed submission:
#D
n = int(input())

ans = 0
for i in range(1,n+1):
    tmp = n // i
    ans += tmp * (i + n//i * i) // 2
    
print(ans)
Buggy python submission (verdict: Runtime Error):
#C
import bisect
alphabet = "abcdefghijklmnopqrstuvwxyz"
n = int(input())
cnt = 0
amari = []

#下処理
niroku = [1]
for i in range(1,15):
    a = niroku[-1]
    niroku.append(a + 26**i)

idx = bisect.bisect_left(niroku, n)

n = n - niroku[idx-1] + 1
z_cnt = idx-1
#print(n)
while n // 26 > 0:
    n_before = n
    amari.append(str(n%26))
    a = n % 26
    n = n // 26
    cnt += 1
#print(a)
#print(n)
#print(cnt)

if int("".join(amari)) != 0: 
    amari.append(str(n))
amari.reverse()
#print(amari)
result = []

for i in range(len(amari)):
    result.append(alphabet[int(amari[i])-1])

for i in range(z_cnt):
    result[i] = "z"

print("".join(result))


Fixed submission:
n = int(input())
ans = ""
while n > 0:
    n -= 1
    ans += chr(ord('a') + n%26)
    #print(ans)
    n = n // 26
print(ans[::-1])
Buggy python submission (verdict: Runtime Error):
a,b = map(float,input().split())
c = b * 100
print(math.floor(a*c // 100))

Fixed submission:
#C
from decimal import *
import math
a,b = map(Decimal,input().split())

print(math.floor(a*b))
Buggy python submission (verdict: Runtime Error):
#D
from collections import deque
n,k = map(int,input().split())
a = list(map(int,input().split()))
tel = deque()
tel.append(1)
visit = [False for _ in range(n)]
visit[0] = True
for i in range(n):
    nx = a[tel[i]-1]
    if visit[nx-1] == True :
        tel.append(nx)
        #ループの始まりのindexをidxに格納
        idx = tel.index(nx)
        break
    tel.append(nx)
    visit[nx-1] == True
    
#print(tel)
if k - idx <=0:
    print(tel[k-1])
else:
    k -= idx
    loop_num = len(tel) - idx - 1
    #print('idx:',idx)
    #print('loop_num:',loop_num)
    goal = tel[idx + k%loop_num]
    
    print(goal)

Fixed submission:
#D
from collections import deque
n,k = map(int,input().split())
a = list(map(int,input().split()))
tel = deque()
tel.append(1)
visit = [False for _ in range(n)]
visit[0] = True
for i in range(n):
    nx = a[tel[i]-1]
    if visit[nx-1] == True :
        tel.append(nx)
        #ループの始まりのindexをidxに格納
        idx = tel.index(nx)
        break
    tel.append(nx)
    visit[nx-1] = True
    
#print(tel)
#print(visit)
if k <= idx:
    goal = tel[k]
else:
    k -= idx
    loop_num = len(tel) - idx - 1
    #print('idx:',idx)
    #print('loop_num:',loop_num)
    goal = tel[idx + k%loop_num]
    
print(goal)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
n = int(input())
a = list(map(int,input().split()))

r = []
l = []

for i,j in enumerate(a):
    r.append(i+j)
    l.append(i-j)
    
ans = 0
for i in l:
    ans += r.count(i)
    
print(ans)

Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int,input().split()))

r = []
l = []

for i,j in enumerate(a):
    r.append(i+j)
    l.append(i-j)
    
ans = 0
#Counterで{'要素':'個数'}の連想配列(辞書型)をつくり、そこから取り出す
b = Counter(r)
for i in l:
    ans += b.get(i,0)
    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math

k = int(input())
cnt = 0

for l in range(1,k+1):
    for m in range(1,k+1):
        for n in range(1,k+1):
            tmp = math.gcd(l,m)
            if tmp == 1:
                cnt += 1
            else:
                cnt += math.gcd(tmp,n)
            
print(cnt)


Fixed submission:
#C

import math

k = int(input())
cnt = 0

for i in range(1,k+1):
    for j in range(i,k+1):
        tmp = math.gcd(i,j)
        for l in range(1,k+1):
            if i != j:
                cnt += 2 * math.gcd(tmp,l)
            else:
                cnt += math.gcd(tmp,l)
            
print(cnt)

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

k = int(input())
cnt = 0

for l in range(1,k+1):
    for m in range(1,k+1):
        for n in range(1,k+1):
            tmp = math.gcd(l,m)
            if tmp == 1:
                cnt += 1
            else:
                cnt += math.gcd(tmp,n)
            
print(cnt)

Fixed submission:
#C

import math

k = int(input())
cnt = 0

for i in range(1,k+1):
    for j in range(i,k+1):
        tmp = math.gcd(i,j)
        for l in range(1,k+1):
            if i != j:
                cnt += 2 * math.gcd(tmp,l)
            else:
                cnt += math.gcd(tmp,l)
            
print(cnt)

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

k = int(input())
cnt = 0

for l in range(1,k+1):
    for m in range(1,k+1):
        for n in range(1,k+1):
            tmp = math.gcd(l,m)
            cnt += math.gcd(tmp,n)
            
print(cnt)

Fixed submission:
#C

import math

k = int(input())
cnt = 0

for i in range(1,k+1):
    for j in range(i,k+1):
        tmp = math.gcd(i,j)
        for l in range(1,k+1):
            if i != j:
                cnt += 2 * math.gcd(tmp,l)
            else:
                cnt += math.gcd(tmp,l)
            
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n,x,y = map(int,input().split())
dist = []

for i in range(1,n):
    for j in range(i+1,n+1):
        dist.append(min(j - i,abs(i-x) + 1 + abs(y-j),abs(y-i)+ 1 + abs(j-x)))

for i in range(1,n):
    print(dist.count(i))

Fixed submission:
n,x,y = map(int,input().split())
dist = [[0] for i in range(n)]

for i in range(1,n):
    for j in range(i+1,n+1):
        dist[min(j - i,abs(i-x) + 1 + abs(y-j),abs(y-i)+ 1 + abs(j-x))][0] += 1

for i in range(1,n):
    print(dist[i][0])

Buggy python submission (verdict: Time Limit Exceeded):
n,x,y = map(int,input().split())
dist = []

for i in range(1,n):
    for j in range(i+1,n+1):
        dist.append(min(j - i,abs(i-x) + 1 + abs(y-j)))
for i in range(1,n):
    print(dist.count(i))

Fixed submission:
n,x,y = map(int,input().split())
dist = [[0] for i in range(n)]

for i in range(1,n):
    for j in range(i+1,n+1):
        dist[min(j - i,abs(i-x) + 1 + abs(y-j),abs(y-i)+ 1 + abs(j-x))][0] += 1

for i in range(1,n):
    print(dist[i][0])

Buggy python submission (verdict: Time Limit Exceeded):
n,x,y = map(int,input().split())
dist = []

for i in range(1,n):
    for j in range(i+1,n+1):
        dist.append(min(j - i,abs(i-x) + 1 + abs(y-j)))
for i in range(1,n):
    print(dist.count(i))

Fixed submission:
n,x,y = map(int,input().split())
dist = [[0] for i in range(n)]

for i in range(1,n):
    for j in range(i+1,n+1):
        dist[min(j - i,abs(i-x) + 1 + abs(y-j),abs(y-i)+ 1 + abs(j-x))][0] += 1

for i in range(1,n):
    print(dist[i][0])

Buggy python submission (verdict: Time Limit Exceeded):
n,x,y = map(int,input().split())
dist = {}

for i in range(1,n):
    for j in range(i+1,n+1):
        name = "{}-{}".format(i,j)
        if i <= x and j < y:
            dist[name] = min(j - i,x-i + 1 + y-j)
        elif i <= x and j >=  y:
            dist[name] = x-i + 1 + j-y
        elif i > x:
            dist[name] = min(j - i,i-x + 1 + abs(y-j))

for i in range(1,n):
    print(list(dist.values()).count(i))

Fixed submission:
n,x,y = map(int,input().split())
dist = [[0] for i in range(n)]

for i in range(1,n):
    for j in range(i+1,n+1):
        dist[min(j - i,abs(i-x) + 1 + abs(y-j),abs(y-i)+ 1 + abs(j-x))][0] += 1

for i in range(1,n):
    print(dist[i][0])
Buggy python submission (verdict: Time Limit Exceeded):
import collections
n = int(input())
a = list(map(int,input().split()))
tmp = {}
for i in range(n):
    a_copy = a[:]
    a_copy.remove(a[i])
    k = a[i]
    if k in tmp:
        print(tmp[k])
    else:
        c = collections.Counter(a_copy)
        cnt = 0
        for i in c.values():
            cnt += i * (i-1) // 2
    
        tmp[k] = cnt
    
        print(cnt)

Fixed submission:
import collections
n = int(input())
a = list(map(int,input().split()))
cnt = 0
c = collections.Counter(a)
for i in c.values():
    cnt += i*(i-1) // 2
for j in range(n):
    print(cnt - c[a[j]] + 1)

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

for i in range(n):
    a_copy = a[:]
    a_copy.remove(a[i])
    c = collections.Counter(a_copy)
    cnt = 0
    for i in c.values():
        cnt += i * (i-1) // 2

    
    print(cnt)

Fixed submission:
import collections
n = int(input())
a = list(map(int,input().split()))
cnt = 0
c = collections.Counter(a)
for i in c.values():
    cnt += i*(i-1) // 2
for j in range(n):
    print(cnt - c[a[j]] + 1)

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

for i in range(n):
    a_copy = a[:]
    del a_copy[i]
    c = collections.Counter(a_copy)
    cnt = 0
    for i in c.values():
        cnt += i * (i-1) // 2

    
    print(cnt)

Fixed submission:
import collections
n = int(input())
a = list(map(int,input().split()))
cnt = 0
c = collections.Counter(a)
for i in c.values():
    cnt += i*(i-1) // 2
for j in range(n):
    print(cnt - c[a[j]] + 1)

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

for i in range(n):
    a_copy = copy.copy(a)
    del a_copy[i]
    c = collections.Counter(a_copy)
    cnt = 0
    for i in c.values():
        cnt += i * (i-1) // 2

    
    print(cnt)

Fixed submission:
import collections
n = int(input())
a = list(map(int,input().split()))
cnt = 0
c = collections.Counter(a)
for i in c.values():
    cnt += i*(i-1) // 2
for j in range(n):
    print(cnt - c[a[j]] + 1)

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

for i in range(n):
    a_copy = copy.copy(a)
    del a_copy[i]
    c = collections.Counter(a_copy)
    cnt = 0
    for i in c.values():
        cnt += i * (i-1) // 2

    
    print(cnt)

Fixed submission:
import collections
n = int(input())
a = list(map(int,input().split()))
cnt = 0
c = collections.Counter(a)
for i in c.values():
    cnt += i*(i-1) // 2
for j in range(n):
    print(cnt - c[a[j]] + 1)
Buggy python submission (verdict: Runtime Error):
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
        

money = min(listA[1]) + min(listA[2]) 

for k in range(listA[0][2]):
    wari = 1000
    a = listA[k+3][0]
    b = listA[k+3][1]
    if wari > listA[1][a-1] + listA[2][b-1] - listA[k+3][2]:
        wari = listA[1][a-1] + listA[2][b-1] - listA[k+3][2]

if money <= wari:
    print(money)
        
else:
    print(wari)


Fixed submission:
listA=[]

while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
        

money = min(listA[1]) + min(listA[2]) 
wari = 100000000

for k in range(listA[0][2]):
    a = listA[k+3][0]
    b = listA[k+3][1]
    if wari > listA[1][a-1] + listA[2][b-1] - listA[k+3][2]:
        wari = listA[1][a-1] + listA[2][b-1] - listA[k+3][2]

if money <= wari:
    print(money)
        
else:
    print(wari)

Buggy python submission (verdict: Time Limit Exceeded):
listA=[] #appendのために宣言が必要
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
        
money = listA[1][0] + listA[2][0]

for i in range(listA[0][0]):
    for j in range(listA[0][1]):
        if listA[1][i] + listA[2][j] < money:
            money = listA[1][i] + listA[2][j] 

for k in range(listA[0][2]):
    a = listA[k+3][0]
    b = listA[k+3][1]
    wari = listA[1][a-1] + listA[2][b-1] - listA[k+3][2]
    if wari < money:
        money = wari
        
        
print(money)


Fixed submission:
listA=[]

while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
        

money = min(listA[1]) + min(listA[2]) 
wari = 100000000

for k in range(listA[0][2]):
    a = listA[k+3][0]
    b = listA[k+3][1]
    if wari > listA[1][a-1] + listA[2][b-1] - listA[k+3][2]:
        wari = listA[1][a-1] + listA[2][b-1] - listA[k+3][2]

if money <= wari:
    print(money)
        
else:
    print(wari)
Buggy python submission (verdict: Time Limit Exceeded):
#累積和の利用！！！！！！！！
from itertools import accumulate
n,k = map(int,input().split())
p = list(map(int,input().split()))

def expect_dice(n):
    return sum(range(1,n+1))/n 

for i in range(len(p)):
    p[i] = expect_dice(p[i])
    
p = [0] + p
p = list(accumulate(p))

ans = []
for i in range(n-k+1):
    ans.append(p[i+k] - p[i])
    
print(max(ans))

Fixed submission:
#累積和の利用！！！！！！！！
from itertools import accumulate
n,k = map(int,input().split())
p = list(map(int,input().split()))

m = [(e + 1) / 2 for e in p]
    
m = [0] + m
m = list(accumulate(m))

ans = []
for i in range(n-k+1):
    ans.append(m[i+k] - m[i])
    
print(max(ans))

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

def expect_dice(n):
    s = 0
    for i in range(1,n+1):
        s += i
    return s/n 
for i in range(len(p)):
    p[i] = expect_dice(p[i])
    
p = [0] + p
p = list(accumulate(p))

ans = []
for i in range(n-k+1):
    ans.append(p[i+k] - p[i])
    
print(max(ans))

Fixed submission:
#累積和の利用！！！！！！！！
from itertools import accumulate
n,k = map(int,input().split())
p = list(map(int,input().split()))

m = [(e + 1) / 2 for e in p]
    
m = [0] + m
m = list(accumulate(m))

ans = []
for i in range(n-k+1):
    ans.append(m[i+k] - m[i])
    
print(max(ans))

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

def expect_dice(n):
    s = 0
    for i in range(1,n+1):
        s += i
    return s/n 

sum_cnt = []

for i in range(len(p)-k+1):
    out = 0
    for j in range(i,i+k):
        out += p[j]
    sum_cnt.append(out)
sum_cnt = np.array(sum_cnt)
result = 0
for k in range(k):
    result += expect_dice(p[np.argmax(sum_cnt)+k])

print(result)

Fixed submission:
#累積和の利用！！！！！！！！
from itertools import accumulate
n,k = map(int,input().split())
p = list(map(int,input().split()))

m = [(e + 1) / 2 for e in p]
    
m = [0] + m
m = list(accumulate(m))

ans = []
for i in range(n-k+1):
    ans.append(m[i+k] - m[i])
    
print(max(ans))

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

def expect_dice(n):
    s = 0
    for i in range(1,n+1):
        s += i
    return s/n 

result = []

for i in range(len(p)-k+1):
    out = 0
    for j in range(i,i+k):
        out += expect_dice(p[j])
    result.append(out)
    
print(max(result))

Fixed submission:
#累積和の利用！！！！！！！！
from itertools import accumulate
n,k = map(int,input().split())
p = list(map(int,input().split()))

m = [(e + 1) / 2 for e in p]
    
m = [0] + m
m = list(accumulate(m))

ans = []
for i in range(n-k+1):
    ans.append(m[i+k] - m[i])
    
print(max(ans))
Buggy python submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())

def lcm(a,b):
    return (a*b)//math.gcd(a,b)

print(lcm(a,b))

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

def lcm(a,b):
    import math
    return (a*b) // fractions.gcd(a,b)

print(lcm(a,b))
Buggy python submission (verdict: Runtime Error):
a,b,x = map(int,input().split())
import math
if a**2*b / 2 <  x:
    alpha = math.degrees(math.atan(2 * (a**2 * b - x) / a**3))
else:
    alpha =  math.degrees(math.acos(2*x / (a*b**2)))
    
print(alpha)

Fixed submission:
a,b,x = map(int,input().split())
import math
if a**2*b / 2 <=  x:
    alpha = math.degrees(math.atan(2 * (a**2 * b - x) / a**3))
else:
    alpha =  math.degrees(math.atan(a*b**2 / (2*x) ))
    
print(alpha)

Buggy python submission (verdict: Runtime Error):
a,b,x = map(int,input().split())
import math
if a**2*b / 2 <=  x:
    alpha = math.degrees(math.atan(2 * (a**2 * b - x) / a**3))
else:
    alpha =  math.degrees(math.acos(2*x / (a*b**2)))
    
print(alpha)

Fixed submission:
a,b,x = map(int,input().split())
import math
if a**2*b / 2 <=  x:
    alpha = math.degrees(math.atan(2 * (a**2 * b - x) / a**3))
else:
    alpha =  math.degrees(math.atan(a*b**2 / (2*x) ))
    
print(alpha)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
cnt = 0
l.sort()

for i in range(n):
    for j in range(i+1,n):
        k = bisect.bisect_left(l,l[i]+l[j])
        if k > j:
            cnt += k - j - 1
        else:
            continue
            
print(cnt)

Fixed submission:
import bisect
n = int(input())
l = list(map(int,input().split()))
cnt = 0
l.sort()

for i in range(n):
    for j in range(i+1,n):
        k = bisect.bisect_left(l,l[i]+l[j])
        if k > j:
            cnt += k - j - 1
        else:
            pass
            
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
#D
n = int(input())
l = list(map(int,input().split()))
cnt = 0
l.sort(reverse=True)



for i in range(len(l)-2):
    for j in range(i+1,len(l)-1):
        x = l[i]-l[j]
        right = n-1
        left = j
 
        while left <= right:
            mid = (right + left) //2
            if l[mid] == x:
                mid -= 1
                break
                
        
            elif l[mid] > x:
                left = mid+1
            elif l[mid] < x:
                right = mid-1
        if (mid - j) > 0:
            cnt += mid - j
 
        
print(cnt)

Fixed submission:
import bisect
n = int(input())
l = list(map(int,input().split()))
cnt = 0
l.sort()

for i in range(n):
    for j in range(i+1,n):
        k = bisect.bisect_left(l,l[i]+l[j])
        if k > j:
            cnt += k - j - 1
        else:
            pass
            
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int,input().split()))
cnt = 0
for i in range(n-2):
    for j in range(i,n-1):
        for k in range(j,n):
            if i != j != k and l[i] < l[j]+l[k] and l[j] < l[i]+l[k] and l[k] < l[i]+l[j]:
                cnt += 1
                
print(cnt)

Fixed submission:
import bisect
n = int(input())
l = list(map(int,input().split()))
cnt = 0
l.sort()

for i in range(n):
    for j in range(i+1,n):
        k = bisect.bisect_left(l,l[i]+l[j])
        if k > j:
            cnt += k - j - 1
        else:
            pass
            
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
#C
n = int(input())
a = list(map(int,input().split()))

ans = [0 for _ in range(n)]
for i in range(1,n+1):
    tmp = a.index(i)
    ans[i-1] = (tmp+1)
    
print(*ans)
    

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

ans = [0 for _ in range(n)]

for i in range(n):
    ans[a[i] - 1] = i + 1
print(*ans)

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

ans = []
for i in range(1,n+1):
    tmp = a.index(i)
    ans.append(tmp+1)
    
print(*ans)

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

ans = [0 for _ in range(n)]

for i in range(n):
    ans[a[i] - 1] = i + 1
print(*ans)

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

ans = []
for i in range(1,n+1):
    tmp = a.index(i)
    ans.append(tmp+1)
    
ans = [str(x) for x in ans]
print(" ".join(ans))
    

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

ans = [0 for _ in range(n)]

for i in range(n):
    ans[a[i] - 1] = i + 1
print(*ans)
Buggy python submission (verdict: Runtime Error):
#D
import math
a,b = map(int,input().split())

gcd = math.gcd(a,b)

def prime_factorize(n):
    result = []
    for i in range(2,int(n**0.5)+1):
        while n % i == 0:
            n //= i
            result.append(i)
    if n != 1:
        result.append(n)
    return result

ans = len(set(prime_factorize(gcd)))

print(ans+1)

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

gcd = fractions.gcd(a,b)

def prime_factorize(n):
    result = []
    for i in range(2,int(n**0.5)+1):
        while n % i == 0:
            n //= i
            result.append(i)
    if n != 1:
        result.append(n)
    return result

ans = len(set(prime_factorize(gcd)))

print(ans+1)
Buggy python submission (verdict: Time Limit Exceeded):

#D
import bisect


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

a.sort()

for i in range(m):
    a[-1] //= 2
    tmp = a.pop(-1)
    k = bisect.bisect_left(a,tmp)
    a.insert(k,tmp)
        
    
print(sum(a))

Fixed submission:
#優先度付きキュー -> 最小値をO(logN)で取り出す
import heapq

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

a = [-x for x in a]

#aを優先度付きキューに変更
heapq.heapify(a)

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

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

a.sort(reverse=True)

while m>0:
    a[0] //= 2
    m -= 1
    a.sort(reverse=True)
    
print(sum(a))

Fixed submission:
#優先度付きキュー -> 最小値をO(logN)で取り出す
import heapq

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

a = [-x for x in a]

#aを優先度付きキューに変更
heapq.heapify(a)

for _ in range(m):
   
    tmp = heapq.heappop(a)
    tmp = (-tmp // 2) * -1
    heapq.heappush(a,tmp)
        
    
print(sum(a) * -1)
Buggy python submission (verdict: Runtime Error):
#B
a = int(input())
b = int(input())
if b == 1:
    print(0)
elif a >= b:
    print(1)
else:
    print((b-a)//a + 2)

Fixed submission:
#B
import math
a,b = map(int,input().split())

k = math.ceil((b-1)/(a-1))

if b == 1:
    print(0)
elif a == b:
    print(1)
else:
    print(k)