Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result


N=int(input())
A=list(input().split())
c=Counter(A)
itms=list(c.items())
lenC=len(c)
num=0

for i in range(lenC):
    itmsi=itms[i][1]
    if itmsi>=2:
        num+=cmb(itmsi,2)


for i in range(N):
    num2=c[A[i]]
    if num2>=3:
        print(num-cmb(num2,2)+cmb(num2-1,2))

    elif num2==2:
        print(num-1)
    else:
        print(num)



Fixed submission:
from collections import Counter
'''
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result
'''

def cmb(n,r):
    return n*(n-1)//2

N=int(input())
A=list(input().split())
c=Counter(A)
itms=list(c.items())#
lenC=len(c)
num=0

for i in range(lenC):
    itmsi=itms[i][1]
    if itmsi>=2:
        num+=cmb(itmsi,2)


for i in range(N):
    num2=c[A[i]]
    if num2>=3:
        print(num-cmb(num2,2)+cmb(num2-1,2))

    elif num2==2:
        print(num-1)
    else:
        print(num)
Buggy python submission (verdict: Time Limit Exceeded):
S=input()
Q=int(input())

st=False#順方向

for _ in range(Q):
    query=input()
    if len(query)==1:
        st= not st
    else:
        _,F,C=query.split()
        F=int(F)
        if st==False:
            if F==1:
                S=C+S
            else:
                S=S+C
        else:
            if F==1:
                S=S+C
            else:
                S=C+S

if st==False:
    ans=S
else:
    ans=S[::-1]
print(ans)
        
    

Fixed submission:
from collections import deque

S=deque(input())
Q=int(input())

st=False#順方向

for _ in range(Q):
    query=input()
    if len(query)==1:
        st= not st
    else:
        _,F,C=query.split()
        F=int(F)
        if st==False:
            if F==1:
                S.appendleft(C)
            else:
                S.append(C)
        else:
            if F==1:
                S.append(C)
            else:
                S.appendleft(C)

if st==False:
    ans=S
else:
    ans=reversed(S)

ans="".join(list(ans))
print(ans)
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
keta=[]
for i in range(N):
    keta.append('x')
ans=-1
for _ in range(M):
    si,ci=input().split()
    si=int(si)
    if keta[si-1]=='x':
        keta[si-1]=ci
    else:
        if keta[si-1]!=ci:
            break
else:
    if keta[0]=='0' and N!=1:#先頭要素が０かつ2桁以上の数なら
        print(-1)
        exit()
    
    if keta[0]=='x' and N==1:
        print(0)
        exit()
    
    if keta[0]=='x' and N>=2:
        keta[0]='1'
    for i in range(1,3):
        if keta[i]=='x':
            keta[i]='0'

    ans=int(''.join(keta))

print(ans)



Fixed submission:
N,M=map(int,input().split())
keta=[]
for i in range(N):
    keta.append('x')
ans=-1
for _ in range(M):
    si,ci=input().split()
    si=int(si)
    if keta[si-1]=='x':#sm
        keta[si-1]=ci
    else:
        if keta[si-1]!=ci:#sm
            break
else:
    if keta[0]=='0' and N!=1:#先頭要素が０かつ2桁以上の数なら
        print(-1)
        exit()
    
    if keta[0]=='x' and N==1:
        print(0)
        exit()
    
    if keta[0]=='x' and N>=2:
        keta[0]='1'
    for i in range(1,N):
        if keta[i]=='x':
            keta[i]='0'

    ans=int(''.join(keta))

print(ans)

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
keta=[]
for i in range(N):
    keta.append('x')
ans=-1
for _ in range(M):
    si,ci=input().split()
    si=int(si)
    if keta[si-1]=='x':
        keta[si-1]=ci
    else:
        if keta[si-1]!=ci:
            break
else:
    if keta[0]=='0' and N!=1:#先頭要素が０かつ2桁以上の数なら
        print(-1)
        exit()
    
    if keta[0]=='x' and N==1:
        print(0)
        exit()
    if keta[0]=='x' and N>=2:
        keta[0]=1
    for i in range(1,3):
        if keta[i]=='x':
            keta[i]='0'

    ans=int(''.join(keta))

print(ans)



Fixed submission:
N,M=map(int,input().split())
keta=[]
for i in range(N):
    keta.append('x')
ans=-1
for _ in range(M):
    si,ci=input().split()
    si=int(si)
    if keta[si-1]=='x':#sm
        keta[si-1]=ci
    else:
        if keta[si-1]!=ci:#sm
            break
else:
    if keta[0]=='0' and N!=1:#先頭要素が０かつ2桁以上の数なら
        print(-1)
        exit()
    
    if keta[0]=='x' and N==1:
        print(0)
        exit()
    
    if keta[0]=='x' and N>=2:
        keta[0]='1'
    for i in range(1,N):
        if keta[i]=='x':
            keta[i]='0'

    ans=int(''.join(keta))

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from math import factorial 

N,a,b=map(int,input().split())
mod=10**9+7


def rapid_comb(N,K):
    bunsi=bunbo=1
    for i in range(K):
        bunsi*=(N-i)%mod
        bunbo*=(i+1)%mod
    return bunsi*pow(bunbo,mod-2,mod)

ans=((pow(2,N,mod)-1)%mod-rapid_comb(N,a)-rapid_comb(N,b))%mod

#逆元の割り算のmodは、分子*逆元（分母)%modと等価　フェルマーの小定理から、 逆元はpow(b,mod-2,mod)となる

print(ans)

Fixed submission:
N,a,b=map(int,input().split())
mod=10**9+7

def cmb(N,K):
    r=1

    for i in range(K):
        r=r*(N-i)*pow(i+1,mod-2,mod)%mod

    return r
ans=((pow(2,N,mod)-1)%mod-cmb(N,a)-cmb(N,b))%mod
#逆元の割り算のmodは、分子*逆元（分母)%modと等価　フェルマーの小定理から、 逆元はpow(b,mod-2,mod)となる
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,a,b=map(int,input().split())
mod=10**9+7


def rapid_comb(N,K):
    bunsi=bunbo=1
    for i in range(K):
        bunsi*=(N-i)%mod
        bunbo*=(i+1)%mod
    return bunsi//bunbo

ans=((pow(2,N,mod)-1)%mod-rapid_comb(N,a)%mod-rapid_comb(N,b)%mod)%mod

print(ans%mod)

Fixed submission:
N,a,b=map(int,input().split())
mod=10**9+7

def cmb(N,K):
    r=1

    for i in range(K):
        r=r*(N-i)*pow(i+1,mod-2,mod)%mod

    return r
ans=((pow(2,N,mod)-1)%mod-cmb(N,a)-cmb(N,b))%mod
#逆元の割り算のmodは、分子*逆元（分母)%modと等価　フェルマーの小定理から、 逆元はpow(b,mod-2,mod)となる
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N,K=map(int,input().split())
p=list(map(int,input().split()))

res=[]

res.append((sum(np.arange(1,p[0]+1)))/p[0])

for i in range(1,N):
    res.append(res[i-1]+(np.sum(np.arange(1,p[i]+1)))/p[i])
ans=res[K-1]

for i in range(1,N-K+1):
    ans=max(ans,res[i+K-1]-res[i-1])
print(ans)

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

res=[]

res.append((sum(range(1,p[0]+1)))/p[0])

for i in range(1,N):
    res.append(res[i-1]+1+0.5*(p[i]-1))
ans=res[K-1]

for i in range(1,N-K+1):
    ans=max(ans,res[i+K-1]-res[i-1])
print(ans)

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

res=[]

res.append((sum(range(1,p[0]+1)))/p[0])

for i in range(1,N):
    res.append(res[i-1]+(sum(range(1,p[i]+1)))/p[i])
ans=res[K-1]

for i in range(1,N-K+1):
    ans=max(ans,res[i+K-1]-res[i-1])
print(ans)

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

res=[]

res.append((sum(range(1,p[0]+1)))/p[0])

for i in range(1,N):
    res.append(res[i-1]+1+0.5*(p[i]-1))
ans=res[K-1]

for i in range(1,N-K+1):
    ans=max(ans,res[i+K-1]-res[i-1])
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())


def monum(H):
    if H==1:
        return 1
    else:
        return 1+monum(H//2)+monum(H//2)
print(monum(N))

Fixed submission:
H=int(input())
at=0

if H==1:
    print(1)
    
else:
    while H!=0:
        H=H//2
        at+=1
    ans=1
    preans=1
    for i in range(2,at+1):
        ans+=preans*2
        preans=preans*2
    print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())

X_t=[]
L_t=[]
ans=0

for _ in range(N):
    x,l=map(int,input().split())
    X_t.append(x)
    L_t.append(l)

tmp=zip(X_t,L_t)
XL=sorted(tmp)

X=[]
L=[]

for x,l in XL:
    X.append(x)
    L.append(l)
    

nls=[0]
for i in range(1,N-1):
    if (X[i]+L[i]>X[i+1]-L[i+1]) and (X[i]-L[i]<X[i-1]+L[i-1]):
        ans+=1
    else:
        nls.append(i)
nls.append(N-1)
        
for i in range(len(nls)-1):
    if nls==[]:
        break
    if len(nls)==1:
        break
    if (i-2)>len(nls):
        break
    
    if X[nls[i]]+L[nls[i]]>X[nls[i+1]]-L[nls[i+1]]:
        ans+=1

if X[-1]-L[-1]<X[-2]+L[-2]:
    ans+=1
print(N-ans)

Fixed submission:
N=int(input())
A=[]
ans=1
for i in range(N):
    Xi,Li=map(int,input().split())
    A.append([Xi-Li,Xi+Li])
A.sort(key=lambda x:x[1])

def interf(A1,A2):
    if A1[1]>A2[0]:
        return 1
    else:
        return 0
    
pre=A[0]
for i in range(1,N):
    if interf(pre,A[i])==0:
        ans+=1
        pre=A[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())

pn_num=0
AC_list=[0]*N

for _ in range(M):
    pi,Si=input().split()
    pi=int(pi-1)
        
    if Si=='AC':
        AC_list[pi]=1
    
    else:
        if AC_list[pi]==0:
            pn_num+=1
    
print(sum(AC_list),pn_num)

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

pn_num=0
WA_list=[0]*N
AC_list=[0]*N

for _ in range(M):
    pi,Si=input().split()
    pi=int(pi)
        
    if Si=='AC':
        if AC_list[pi-1]==0:
            pn_num+=WA_list[pi-1]
            AC_list[pi-1]=1
    
    else:
        WA_list[pi-1]+=1
    
print(sum(AC_list),pn_num)

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())

pn_num=0
WA_list=[0]*N
AC_list=[0]*N

for _ in range(M):
    pi,Si=input().split()
    pi=int(pi-1)
        
    if Si=='AC':
        pn_num+=WA_list[pi-1]
    
    else:
        WA_list[pi-1]+=1
    
print(sum(AC_list),pn_num)

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

pn_num=0
WA_list=[0]*N
AC_list=[0]*N

for _ in range(M):
    pi,Si=input().split()
    pi=int(pi)
        
    if Si=='AC':
        if AC_list[pi-1]==0:
            pn_num+=WA_list[pi-1]
            AC_list[pi-1]=1
    
    else:
        WA_list[pi-1]+=1
    
print(sum(AC_list),pn_num)

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())

pn_num=0
AC_list=[0]*N

for _ in range(M):
    pi,Si=input().split()
    pi=int(pi-1)
        
    if Si=='AC':
        AC_list[pi]=1
    
    else:
        if AC_list[pi]==0:
            pn_num+=1
    
print(sum(AC_list),pn_num)

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

pn_num=0
WA_list=[0]*N
AC_list=[0]*N

for _ in range(M):
    pi,Si=input().split()
    pi=int(pi)
        
    if Si=='AC':
        if AC_list[pi-1]==0:
            pn_num+=WA_list[pi-1]
            AC_list[pi-1]=1
    
    else:
        WA_list[pi-1]+=1
    
print(sum(AC_list),pn_num)
Buggy python submission (verdict: Runtime Error):
#ABC150_D

from fractions import gcd
N,M=map(int,input().split())
A=list(map(int,input().split()))
lcm=a[0]//2

for x in A:
    x//=2
    g=gcd(lcm,x)
    
    if (lcm//g)%2!=(x//g)%2:
        print(0)
        exit()
    
    lcm=lcm*x//g
print((M//lcm+1)//2)

Fixed submission:
#ABC150_D

from fractions import gcd
N,M=map(int,input().split())
A=list(map(int,input().split()))
lcm=A[0]//2

for x in A:
    x//=2
    g=gcd(lcm,x)
    
    if (lcm//g)%2!=(x//g)%2:
        print(0)
        exit()
    
    lcm=lcm*x//g
print((M//lcm+1)//2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [[] for _ in range(N)]
for i in range(N):
    for _ in range(int(input())):
        A[i].append([int(s) for s in input().split()])

ret = 0
for i in range(2 ** N):#2**Nだけ正解の候補がある
    bits = [i >> j & 1 for j in range(N)]#　N桁の２進数iについて、逆順に並べた配列が生成
    #print(bits)
    for i, a in enumerate(A):#i→人、a→人iの証言のリスト
        if bits[i] == 0:#人iが正直者じゃない場合、continueして次の人の証言に移行
            continue
        for x, y in a:
            # print(bits, bits[x - 1], y)
            if bits[x - 1] == y:#正解の候補と証言が一致する場合、その人の次の証言を参照
                continue
            break　　　　　　　　　#そうでない場合、その人の証言を聞くのをやめて次の人の証言を聞く
        else:#breakでループを抜けなかったときにのみ、elseが実行
            continue#このcontinueは２つ上のfor文のcontinueつまり、間違った証言がある場合、一つ下のbreakが評価されて、次の正解候補にうつる
        break
    else:#breakでループを抜けなかったときにのみ、elseが実行
        ret = max(ret, sum(bits))
print(ret)

Fixed submission:
N = int(input())
A = [[] for _ in range(N)]
for i in range(N):
    for _ in range(int(input())):
        A[i].append([int(s) for s in input().split()])

ret = 0
for i in range(2 ** N):#2**Nだけ正解の候補がある
    bits = [i >> j & 1 for j in range(N)]#　N桁の２進数iについて、逆順に並べた配列が生成
    #print(bits)
    for i, a in enumerate(A):#i→人、a→人iの証言のリスト
        if bits[i] == 0:#人iが正直者じゃない場合、continueして次の人の証言に移行
            continue
        for x, y in a:
            # print(bits, bits[x - 1], y)
            if bits[x - 1] == y:#正解の候補と証言が一致する場合、その人の次の証言を参照
                continue
            break#そうでない場合、その人の証言を聞くのをやめて次の人の証言を聞く
        else:#breakでループを抜けなかったときにのみ、elseが実行
            continue#このcontinueは２つ上のfor文のcontinueつまり、間違った証言がある場合、一つ下のbreakが評価されて、次の正解候補にうつる
        break
    else:#breakでループを抜けなかったときにのみ、elseが実行
        ret = max(ret, sum(bits))
print(ret)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
X=int(input())
ans=0

if (X%100==0)or(X%101==0)or(X%102==0)or(X%103==0)or(X%104==0)or(X%105==0):
    print(str(1))

else:
    for i0,i1,i2,i3,i4,i5 in itertools.product(
        list(range(int(X//100))),
        list(range(int(X//101))),
        list(range(int(X//102))),
        list(range(int(X//103))),
        list(range(int(X//104))),
        list(range(int(X//105)))):
    
        if (i0*100+i1*101+i2*102+i3*103+i4*104+i5*105)==X:
            ans=1
            break
    if ans==1:
        print(str(1))
    else:
        print(str(0))

Fixed submission:
import sys
X=int(input())
for c in range(X):
    if (100*c<=X) and (105*c>=X):
        print(1)
        sys.exit()
print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
X=int(input())
ans=0

for i0,i1,i2,i3,i4,i5 in itertools.product(
    list(range(int(X//100)+1)),
    list(range(int(X//101)+1)),
    list(range(int(X//102)+1)),
    list(range(int(X//103)+1)),
    list(range(int(X//104)+1)),
    list(range(int(X//105)+1))):
    
    if (i0*100+i1*101+i2*102+i3*103+i4*104+i5*105)==X:
        ans=1
        break
if ans==1:
    print(str(1))
else:
    print(str(0))

Fixed submission:
import sys
X=int(input())
for c in range(X):
    if (100*c<=X) and (105*c>=X):
        print(1)
        sys.exit()
print(0)
Buggy python submission (verdict: Runtime Error):
N=input()
S=list(input())
 
if len(N)%2!=0:
  print('No')
else:
  if S[:N/2]==S[N/2:]:
    print('Yes')
  else:
    print('No')

Fixed submission:
print(int(input())**2)
Buggy python submission (verdict: Runtime Error):
N=input()
S=list(input())
 
if N%2!=0:
    print('No')
else:
    if S[:N/2]==S[N/2:]:
        print('Yes')
    else:
        print('No')



Fixed submission:
N=int(input())
S=list(input())
 
if N%2!=0:
    print('No')
else:
    if S[:N//2]==S[N//2:]:
        print('Yes')
    else:
        print('No')

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

if len(N)%2!=0:
  print('No')
else:
  if S[:N/2]==S[N/2]:
    print('Yes')
  else:
    print('No')

Fixed submission:
N=int(input())
S=list(input())
 
if N%2!=0:
    print('No')
else:
    if S[:N//2]==S[N//2:]:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
ソースコード 拡げる

Copy
Copy
import math
import itertools
 
N=int(input())
P=[]
all_dist=[]
 
 
def Len(X,Y):
    return math.sqrt((X[0]-Y[0])**2+(X[1]-Y[1])**2)
 
for _ in range(N):
    a,b=map(int,input().split())
    P.append([a,b])
#print('townmap_is',P)
 
route=list(itertools.permutations(P))
#print(route)
 
for k in range(math.factorial(N)):
    B=0
    A=list(route[k])
    for i in range(len(A)-1):
        B+=Len(A[i],A[i+1])
    all_dist.append(B)
ans=sum(all_dist)/len(all_dist)
 
print(str(ans))

Fixed submission:
import math
import itertools
 
N=int(input())
P=[]
all_dist=[]
 
def Len(X,Y):
    return math.sqrt((X[0]-Y[0])**2+(X[1]-Y[1])**2)

for _ in range(N):
    a,b=map(int,input().split())
    P.append([a,b])
#print('townmap_is',P)
 
route=list(itertools.permutations(P))
#print(route)
 
for k in range(math.factorial(N)):
    B=0
    A=list(route[k])
    for i in range(len(A)-1):
        B+=Len(A[i],A[i+1])
    all_dist.append(B)
ans=sum(all_dist)/len(all_dist)
 
print(str(ans))
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())

if A=>1 and A<=9 and B=>1 and B<=9:
  print(A*B)
else:
  print(-1)

Fixed submission:
A,B=map(int,input().split())

if A>=1 and A<=9 and B>=1 and B<=9:
  print(A*B)
else:
  print(-1)

Buggy python submission (verdict: Runtime Error):
#ABC144_C
#素因数分解して、N＝なるべく差の小さい2つの因数の積、と考える
import math

init_N=int(input())
N=init_N
ans_list=[]
A=1
B=1

for i in range(2,int(math.sqrt(init_N))+1):
    while 1:  
        if N%i==0:
            ans_list.append(i)
            N=N//i
        else:
            break
if N==1:
    pass
else:
    ans_list.append(N)

if len(ans_list)==1:
    print(str(init_N-1))
else:
    while len(ans_list)>0:
        A=A*ans_list.pop(0)
        #print(A)
        if len(ans_list)!=0:
            B=B*ans_list.pop(0)
            #print(B)
    print(str(A+B-2))



Fixed submission:
A,B=map(int,input().split())

if A>=1 and A<=9 and B>=1 and B<=9:
  print(A*B)
else:
  print(-1)

Buggy python submission (verdict: Runtime Error):
#ABC144_C
#素因数分解して、N＝なるべく差の小さい2つの因数の積、と考える
import math

init_N=int(input())
N=init_N
ans_list=[]
A=1
B=1

for i in range(2,int(math.sqrt(init_N))+1):
    while 1:  
        if N%i==0:
            ans_list.append(i)
            N=N//i
        else:
            break
if N==1:
    pass
else:
    ans_list.append(N)

if len(ans_list)==1:
    print(str(init_N-1))
else:
    while len(ans_list)>0:
        A=A*ans_list.pop(0)
        print(A)
        if len(ans_list)!=0:
            B=B*ans_list.pop(0)
            print(B)
    print(str(A+B-2))



Fixed submission:
A,B=map(int,input().split())

if A>=1 and A<=9 and B>=1 and B<=9:
  print(A*B)
else:
  print(-1)
Buggy python submission (verdict: Runtime Error):
#ABC144_C
#素因数分解して、N＝なるべく差の小さい2つの因数の積、と考える
import math

init_N=int(input())
N=init_N
ans_list=[]
A=1
B=1

for i in range(2,int(math.sqrt(init_N))+1):
    while 1:  
        cnt+=1
        if N%i==0:
            ans_list.append(i)
            N=N//i
        else:
            break
if N==1:
    pass
else:
    ans_list.append(N)

if len(ans_list)==1:
    print(str(init_N-1))
else:
    while len(ans_list)>0:
        A=A*ans_list.pop(0)
        print(A)
        if len(ans_list)!=0:
            B=B*ans_list.pop(0)
            print(B)
    print(str(A+B-2))



Fixed submission:
import math

n=int(input())
n2=int(math.sqrt(n))

minimum=n-1
for i in range(1,n2+1):
    if(n%i==0):
        minimum=min(minimum,(n//i-1)+(i-1))

print(minimum)
Buggy python submission (verdict: Time Limit Exceeded):
#ABC142_C
from operator import itemgetter
N=int(input())
A=list(map(int,input().split()))

ans=[]

while len(ans)!=len(A):
    min_index=A.index(min(A))
    ans.append(int(min_index)+1)
    A[min_index]=int(1e+5+1)
print(*ans)

Fixed submission:
#ABC142_C
from operator import itemgetter
N=int(input())
A=list(map(int,input().split()))
ans=[i+1 for i,_ in sorted(enumerate(A),key=itemgetter(1))]

print(*ans)

Buggy python submission (verdict: Runtime Error):
#ABC142_C
N=int(input())
A=list(map(int,input().split()))
ans=[i+1 for i,_ in sorted(enumerate(A),key=itemgetter(1))]

print(*ans)

Fixed submission:
#ABC142_C
from operator import itemgetter
N=int(input())
A=list(map(int,input().split()))
ans=[i+1 for i,_ in sorted(enumerate(A),key=itemgetter(1))]

print(*ans)

Buggy python submission (verdict: Runtime Error):
#ABC142_C
N=int(input())
A=list(map(int,input().split()))
ans=[i+1 for i,_ in sorted(enumerate(A),key=itemgetter(1))]
print(*ans)

Fixed submission:
#ABC142_C
from operator import itemgetter
N=int(input())
A=list(map(int,input().split()))
ans=[i+1 for i,_ in sorted(enumerate(A),key=itemgetter(1))]

print(*ans)

Buggy python submission (verdict: Time Limit Exceeded):
#ABC142_C
N=int(input())
A=list(map(int,input().split()))

ans=[]

while len(ans)!=len(A):
    min_index=A.index(min(A))
    ans.append(int(min_index)+1)
    A[min_index]=int(1e+5+1)
print(*ans)

Fixed submission:
#ABC142_C
from operator import itemgetter
N=int(input())
A=list(map(int,input().split()))
ans=[i+1 for i,_ in sorted(enumerate(A),key=itemgetter(1))]

print(*ans)
Buggy python submission (verdict: Runtime Error):
#ABC141_C
N,K,Q=map(int,input().split())
ans=[K-Q]*N
for _ in range(Q):
    ans[int(input())-1]+=1
for i in range(Q):
    if ans[i]>0:
        print('Yes')
    else:
        print('No')    

Fixed submission:
#ABC141_C
import numpy as np
N,K,Q=map(int,input().split())
ans=(K-Q)*np.ones((1,N),dtype='int32')

for _ in range(Q):
    idx=int(input())
    ans[0,idx-1]+=1
ans=ans.tolist()[0]
for i in range(len(ans)):
    if ans[i]>0:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Runtime Error):
#ABC141_C
N,K,Q=map(int,input().split())
ans=(K-Q)*np.ones((1,N),dtype='int32')

for _ in range(Q):
    idx=int(input())
    ans[0,idx-1]+=1
ans=ans.tolist()[0]
for i in range(len(ans)):
    if ans[i]>0:
        print('Yes')
    else:
        print('No')    

Fixed submission:
#ABC141_C
import numpy as np
N,K,Q=map(int,input().split())
ans=(K-Q)*np.ones((1,N),dtype='int32')

for _ in range(Q):
    idx=int(input())
    ans[0,idx-1]+=1
ans=ans.tolist()[0]
for i in range(len(ans)):
    if ans[i]>0:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Runtime Error):
#ABC141_C
N,K,Q=map(int,input().split())
ans=(K-Q)*np.ones((1,N),dtype='int32')
print(ans)
for _ in range(Q):
    idx=int(input())
    ans[0,idx-1]+=1
ans=ans.tolist()[0]
for i in range(len(ans)):
    if ans[i]>0:
        print('Yes')
    else:
        print('No') 

Fixed submission:
#ABC141_C
import numpy as np
N,K,Q=map(int,input().split())
ans=(K-Q)*np.ones((1,N),dtype='int32')

for _ in range(Q):
    idx=int(input())
    ans[0,idx-1]+=1
ans=ans.tolist()[0]
for i in range(len(ans)):
    if ans[i]>0:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
#ABC140_C
N=int(input())
A=[0]*N
B=[int(i) for i in input().split()]
A[0]=B[0]

for i in range(1,N):
    A[i]=max(A[i-1],B[i-1],B[i])
print(*A)

Fixed submission:
#ABC140_C
N=int(input())
A=[0]*N
B=[int(i) for i in input().split()]
A[0]=B[0]

for i in range(1,N-1):
    A[i]=min(B[i-1],B[i])
A[N-1]=B[N-2]

print(sum(A))

Buggy python submission (verdict: Runtime Error):
#ABC140_C
N=int(input())
A=[0]*N
B=[]
for _ in range(N-1):
    B.append(int(input()))
A[0]=B[0]

for i in range(1,N):
    A[i]=max(A[i-1],B[i-1],B[i])
print(*A)

Fixed submission:
#ABC140_C
N=int(input())
A=[0]*N
B=[int(i) for i in input().split()]
A[0]=B[0]

for i in range(1,N-1):
    A[i]=min(B[i-1],B[i])
A[N-1]=B[N-2]

print(sum(A))

Buggy python submission (verdict: Runtime Error):
#ABC140_C
N=int(input())
A=[0]*N
for _ in range(N-1):
    B.append(int(input()))
A[0]=B[0]

for i in range(1,N):
    A[i]=max(A[i-1],B[i-1],B[i])
print(*A)

Fixed submission:
#ABC140_C
N=int(input())
A=[0]*N
B=[int(i) for i in input().split()]
A[0]=B[0]

for i in range(1,N-1):
    A[i]=min(B[i-1],B[i])
A[N-1]=B[N-2]

print(sum(A))