Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02630 (python)

Fixed submission:
from collections import Counter

N=int(input())
A=list(map(int,input().split()))
c=Counter(A)
commons=c.most_common()

ans=0

dic={}
for common in commons:
    dic[common[0]]=common[1]
    ans+=common[0]*common[1]
# print(dic)
# print(ans)

Q=int(input())
for i in range(Q):
    b,c=map(int,input().split())
    if b not in dic:
        print(ans)
        continue
    else:
        pass
    if c not in dic:
        ans+=(c-b)*dic[b]
        print(ans)
        dic[c]=dic[b]
        dic[b]=0
        continue
    else:
        pass
    ans+=(c-b)*dic[b]
    dic[c]+=dic[b]
    dic[b]=0
    print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter

N=int(input())
A=list(map(int,input().split()))
c=Counter(A)
commons=c.most_common()

ans=0

dic={}
for common in commons:
    dic[common[0]]=common[1]
    ans+=common[0]*common[1]
# print(dic)
# print(ans)

Q=int(input())
for i in range(Q):
    b,c=map(int,input().split())
    ans+=(c-b)*dic[b]
    dic[c]+=dic[b]
    dic[b]=0
    # print(dic)
    print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter

N=int(input())
A=list(map(int,input().split()))
c=Counter(A)
commons=c.most_common()

ans=0

dic={}
for common in commons:
    dic[common[0]]=common[1]
    ans+=common[0]*common[1]
# print(dic)
# print(ans)

Q=int(input())
for i in range(Q):
    b,c=map(int,input().split())
    ans+=(c-b)*dic[b]
    dic[b]=0
    dic[c]+=dic[b]
    # print(dic)
    print(ans)
Problem p02657 (python)

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

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

Ans=1

for A in range(N):
    NewAns=Ans*As[A]
    Ans=NewAns
if Ans>10**18:
    Ans=-1

print(Ans)
Problem p02675 (python)

Fixed submission:
N=str(input())
a=int(N[-1])
if a==3:
    print("bon")
else:
    if a==0 or a==1 or a==6 or a==8:
        print("pon")
    else:
        print("hon")

Buggy submission (verdict: Runtime Error):
A,B,H,M= map(int,input().split())

kakudo_H = H*30 +M*0.5
kakudo_M = M*6
if M==0:
    kakudo_M=360

kakudo_sa=abs(kakudo_H-kakudo_M)
# cはまずは2条している値としてセット
c=A**2 +B**2-2*A*B*(math.cos(math.radians(kakudo_sa)))
C=c**0.5
print(C)
Problem p02677 (python)

Fixed submission:
import math
A,B,H,M=input().split()

A=int(A)
B=int(B)
H=int(H)
M=int(M)

kakudo_H = H*30 +M*0.5
kakudo_M = M*6
if M==0:
    kakudo_M=360

kakudo_sa=abs(kakudo_H-kakudo_M)
# cはまずは2条している値としてセット
c=A**2 +B**2-2*A*B*(math.cos(math.radians(kakudo_sa)))
C=c**0.5
print(C)

Buggy submission (verdict: Runtime Error):
A,B,H,M=input().split()

A=int(A)
B=int(B)
H=int(H)
M=int(M)

kakudo_H = H*30 +M*0.5
kakudo_M = M*6
if M==0:
    kakudo_M=360

kakudo_sa=abs(kakudo_H-kakudo_M)
# cはまずは2条している値としてセット
c=A**2 +B**2-2*A*B*(math.cos(math.radians(kakudo_sa)))
C=c**0.5
print(C)

Buggy submission (verdict: Runtime Error):
arr = list(map(int,input().split()))
A=int(arr[0])
B=int(arr[1])
H=int(arr[2])
M=int(arr[3])

kakudo_H = H*30 +M*0.5
kakudo_M = M*6
if M==0:
    kakudo_M=360

kakudo_sa=abs(kakudo_H-kakudo_M)
# cはまずは2条している値としてセット
c=A**2 +B**2-2*A*B*(math.cos(math.radians(kakudo_sa)))
C=c**0.5
print(C)

Buggy submission (verdict: Runtime Error):
arr = list(map(int,input().split()))
A=int(arr[0])
B=int(arr[1])
H=int(arr[3])
M=int(arr[4])

kakudo_H = H*30 +M*0.5
kakudo_M = M*6
if M==0:
    kakudo_M=360

kakudo_sa=abs(kakudo_H-kakudo_M)
# cはまずは2条している値としてセット
c=A**2 +B**2-2*A*B*(math.cos(math.radians(kakudo_sa)))
C=c**0.5
print(C)

Buggy submission (verdict: Runtime Error):
arr = list(map(int,input().split()))
A=arr[0]
B=arr[1]
H=arr[3]
M=arr[4]

kakudo_H = H*30 +M*0.5
kakudo_M = M*6
if M==0:
    kakudo_M=360

kakudo_sa=abs(kakudo_H-kakudo_M)
# cはまずは2条している値としてセット
c=A**2 +B**2-2*A*B*(math.cos(math.radians(kakudo_sa)))
C=c**0.5
print(C)

Buggy submission (verdict: Runtime Error):
A,B,H,M= list(map(int,input().split()))

kakudo_H = H*30 +M*0.5
kakudo_M = M*6
if M==0:
    kakudo_M=360

kakudo_sa=abs(kakudo_H-kakudo_M)
# cはまずは2条している値としてセット
c=A**2 +B**2-2*A*B*(math.cos(math.radians(kakudo_sa)))
C=c**0.5
print(C)

Buggy submission (verdict: Runtime Error):
A,B,H,M=[int(input()) for i in range (4)]

kakudo_H = H*30 +M*0.5
kakudo_M = M*6
if M==0:
    kakudo_M=360

kakudo_sa=abs(kakudo_H-kakudo_M)
# cはまずは2条している値としてセット
c=A**2 +B**2-2*A*B*(math.cos(math.radians(kakudo_sa)))
C=c**0.5
print(C)
Problem p02681 (python)

Fixed submission:
a= [input() for i in range(2)]
S=a[0]
T=a[1]

def CK(S,T):

    m=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
    for a in range(len(m)):
        Sa=S+m[a]
        if(T == Sa):
            return True
            break
        else:
            a=a+1

reslt=CK(S,T)
# print(reslt)

if(reslt==True):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S=input()
T=input()

if T[:-1]==S:
	print("Yes")
    exit()

print("No")
Problem p02683 (python)

Fixed submission:
def CanIGetEnoughSkills(SkillPoints,M,X):
    for _ in range(M):
        if SkillPoints[_]<X:
            return False
        else:
            pass
    return True


N,M,X=map(int,input().split())
books=[]
for n in range(N):
    array= list(map(int,input().split()))
    books.append(array)
# print(books)

BookCost=[]
GetSkillPoints=[]
for i in range (N):
    BookCost.append(int(books[i][0]))
    GetSkillPoints.append(books[i][1:])

temp_cost=10**9

for Cart in range (2**len(GetSkillPoints)):
    TotalCost=0
    SkillPoints=[0]*M
    
    for book in range(len(GetSkillPoints)):
        if (Cart>>book)&1==0:
            continue
        TotalCost+= BookCost[book]
        for skillelement in range(M):
            SkillPoints[skillelement]+=GetSkillPoints[book][skillelement]

    # print(TotalCost,SkillPoints)
    if CanIGetEnoughSkills(SkillPoints,M,X)== True:
        temp_cost=min(temp_cost,TotalCost)

Answer=temp_cost
if Answer==10**9:
    Answer=-1
    
print(Answer)

Buggy submission (verdict: Runtime Error):
def CanIGetEnoughSkills(SkillPoints,M,X):
    for _ in range(M):
        if SkillPoints[_]<X:
            return False
        else:
            pass
    return True


N,M,X=map(int(input()).split())
books=[input() for _ in range (N)]

BookCost=[]
GetSkillPoints=[]
for i in range (N):
    BookCost.append(books[i][0])
    GetSkillPoints.append(books[i][1:])

temp_cost=10**9

for Cart in range (2**len(GetSkillPoints)):
    TotalCost=0
    SkillPoints=[0]*M

    for book in range(len(GetSkillPoints)):
        if (Cart>>book)&1==0:
            continue
        TotalCost+= BookCost[book]
        for skillelement in range(M):
            SkillPoints[skillelement]+=GetSkillPoints[book][skillelement]

    # print(TotalCost,SkillPoints)
    if CanIGetEnoughSkills(SkillPoints,M,X)== True:
        temp_cost=min(temp_cost,TotalCost)

Answer=temp_cost
if Answer==10**9:
    Answer=-1
    
print(Answer)
Problem p02687 (python)

Fixed submission:
n=input()

if (n =="ABC"):
    print("ARC")
else:
    print("ABC")

Buggy submission (verdict: Runtime Error):
a=input()
if a="ABC":
  print("ARC")
else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
X=int(input())

Xkon=X**0.2
if(Xkon==int(Xkon)):
    print(str(0)+" "+str(int(-Xkon)))
    #break
else:
    m=-(10**3)
    while m<0:
        A=X+(m**)
        check=(A**0.2)
        # print(type(check))
        if(type(check)!=complex):
            if(check==int(check)):
                AnsA=-check
                AnsB=-m
                print(str(int(AnsB))+" "+str(int(AnsA)))
                break
            else:
                pass
        else:
            m=m+1
    n=1
    while n<10**3:
        A=X+(n**5)
        check=(A**0.2)
        if(check==int(check)):
            AnsA=check
            AnsB=n
            print(str(int(AnsB)+" "+str(int(-AnsA))))
            break
        else:
            n=n+1

Buggy submission (verdict: Runtime Error):
X=int(input())

Xkon=X**0.2
if(Xkon==int(Xkon)):
    print(str(0)+" "+str(int(-Xkon)))
    #break
else:
    m=-(10**2)
    while m<0:
        A=X+(m**5)
        check=(A**0.2)
        # print(type(check))
        if(type(check)!=complex):
            if(check==int(check)):
                AnsA=-check
                AnsB=-m
                print(str(int(AnsB))+" "+str(int(AnsA)))
                break
            else:
                pass
        else:
            m=m+1
    n=1
    while n<10**2:
        A=X+(n**5)
        check=(A**0.2)
        if(check==int(check)):
            AnsA=check
            AnsB=n
            print(str(int(AnsB)+" "+str(int(-AnsA))))
            break
        else:
            n=n+1

Buggy submission (verdict: Runtime Error):
X=int(input())

Xkon=X**0.2
if(Xkon==int(Xkon)):
    print(str(0)+" "+str(int(-Xkon)))
    #break
else:
    m=-(10**2)
    while m<0:
        A=X+(m**5)
        check=(A**0.2)
        # print(type(check))
        if(type(check)!=complex):
            if(check==int(check)):
                AnsA=-check
                AnsB=-m
                print(str(int(AnsB))+" "+str(int(AnsA)))
                break
            else:
                pass
        else:
            m=m+1
    n=1
    while n<10**2:
        A=X+(n**5)
        check=(A**0.2)
        if(check==int(check)):
            AnsA=check
            AnsB=n
            print(str(int(AnsB)+" "+str(int(-AnsA))))
            break
        else:
            n=n+1

Buggy submission (verdict: Runtime Error):
N=input()

if (N ="ABC"):
    print("ARC")
else:
    print("ABC")

Buggy submission (verdict: Runtime Error):
N=input()

if (N ="ABC"):
    print("ARC")
else:
    print(ABC)
Problem p02690 (python)

Fixed submission:
X=int(input())

for A in range(-1000,1000):
    for B in range (-1000,1000):
        if(A**5-B**5==X):
            print(A,B)
            break
    else:
        continue
    break

Buggy submission (verdict: Runtime Error):
X=int(input())
n=0
while n<10**5:
    A=X-(n**5)
    check=(A**0.2)**5
    if(int(check)==check):
        AnsA=A**0.2
        AnsB=-n
        print(str(int(AnsA))+" "+str(int(AnsB)))
        break
    else:
        n=n+1
m=0
while m<10**5:
    A=X+(m**5)
    check=(A**0.2)**5
    if(int(check)==check):
        AnsA=A**0.2
        AnsB=-m
        print(str(int(AnsA))+" "+str(int(AnsB)))
        break
    else:
        m=m+1

Buggy submission (verdict: Runtime Error):
X=int(input())
n=0
while n<10**9:
    A=X-(n**5)
    check=(A**0.2)**5
    if(int(check)==check):
        AnsA=A**0.2
        AnsB=-n
        print(str(int(AnsA))+" "+str(int(AnsB)))
        break
    else:
        n=n+1
Problem p02732 (python)

Fixed submission:
import numpy as np

N=int(input())
A=np.array(list(map(int,input().split())))
'''
以下、方針
・Aから、各要素の出現回数を取得する。
・出現回数から、組み合わせを計算する。
'''
uni,cou=np.unique(A,return_counts=True)

# print(uni)
# print(cou)
dic0={}
dic1={}
dic={} #回答用

com=[]
for i in range(len(cou)):
    c=cou[i]*(cou[i]-1)//2
    dic0[uni[i]]=cou[i]
    dic1[uni[i]]=c
    com.append(c)
    dic.setdefault(uni[i])

# print(com)
totalcombination=sum(com)

# print(com)
# print(dic1)

'''
以下方針
・Aから数字を取得
・その数字に対応する組み合わせを減らす。
・その数字の出現回数を1減らした状態の組み合わせの数を足す。
'''

for j in range (N):
    n=A[j] #nはAの数列の数字
    if dic[n]==None:
        e=(dic0[n]-1)*(dic0[n]-2)//2
        t=totalcombination-dic1[n]+e
        dic[n]=t
        print(t)
    else:
        print(dic[n])

Buggy submission (verdict: Runtime Error):
import numpy as np

N=int(input())
A=np.array(list(map(int,input().split())))

'''
以下、方針
・Aから、各要素の出現回数を取得する。
・出現回数から、組み合わせを計算する。
'''
unique_num, counts =np.unique(A,return_counts=True) #Aから、各要素の出現回数を取得する。

# print(unique_num)
# print(counts)
dic0={} #数字と出現回数の組合わせ辞書
dic1={} #数字と組合わせ個数の組合わせ辞書
dic2={} #回答用の辞書

Combination_pattern　= []
for i in range(len(counts)):
    Combination = counts[i] * (counts[i]-1) // 2 #出現回数から、組み合わせを計算する。
    dic0[unique_num[i]]=counts[i]
    dic1[unique_num[i]]=Combination
    dic2.setdefault(unique_num[i])
    Combination_pattern.append(Combination)

totalcombination=sum(Combination_pattern)

# print(dic0)
# print(dic1)
# print(dic2)
# print(Combination_pattern)

'''
以下方針
・Aから数字を取得
・その数字の出現回数を1減らした状態の組み合わせの数を調べる。
・その数字に対応する元の組み合わせの数を減らし、1個前で計算した組合わせを足す。
・同じ数字を引いたときように答えを辞書に登録しておく。
・もし、過去に同じ数字を引いていたら、登録しておいた答えを回答する。
'''

for j in range (N):
    n=A[j] #Aから数字を取得
    if dic2[n]==None:
        reduced_pattern = (dic0[n]-1) * (dic0[n]-2) // 2 #その数字の出現回数を1減らした状態の組み合わせの数を調べる。
        ans=totalcombination-dic1[n]+reduced_pattern #その数字に対応する元の組み合わせの数を減らし、1個前で計算した組合わせを足す。
        dic2[n] = ans #同じ数字を引いたときように答えを辞書に登録しておく。
        print(ans)
    else:
        print(dic2[n]) #もし、過去に同じ数字を引いていたら、登録しておいた答えを回答する。

Buggy submission (verdict: Runtime Error):
import numpy as np

N=int(input())
A=np.array(list(map(int,input().split())))
'''
以下、方針
・Aから、各要素の出現回数を取得する。
・出現回数から、組み合わせを計算する。
'''
uni,cou=np.unique(A,return_counts=True)
# print(uni)
# print(cou)
com=[]
for i in range(len(cou)):
    c=(cou[i]*(cou[i]-1))//2
    com.append(c)
# com=np.array(com)
# print(com)
totalcombination=sum(com)

'''
以下方針
・Aから数字を取得
・その数字に対応する組み合わせを減らす。
・その数字の出現回数を1減らした状態の組み合わせの数を足す。
'''
for j in range (N):
    n=A[j] #nはAの数列の数字
    f=np.where(uni==n)[0][0]
    t=com[f]
    e=(cou[f]-1)*(cou[f]-2)//2
    print(totalcombination-t+e)
Problem p02741 (python)

Fixed submission:
a=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K=int(input())
print(a[K-1])

Buggy submission (verdict: Runtime Error):
a=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K=int(input())
print(a[K])

Buggy submission (verdict: Runtime Error):
H,M=map(int,input().split())
if H==1:
  print("1")
elif M==1:
  print("1")
else:
  if H*M%2==0:
  	print(H*M//2)
  else:
  	print((H*M)//2+1)
Problem p02761 (python)

Fixed submission:
N,M=map(int,input().split())
ans=[-1]*(N+1)
for i in range(M):
    s,c=map(int,input().split())
    if ans[s]==-1 :
        ans[s]=c
    elif ans[s]==c :
        pass
    else:
        print('-1')
        exit()

if N>=2 and ans[1]==0:
    print('-1')
    exit()
elif N>=2 and ans[1]==-1: #ここが間違ってた。
    ans[1]=1
else:
    pass

for j in range(len(ans)):
    if ans[j] == -1:
        ans[j] = 0

if N==1:
    FA=ans[-1]
elif N==2:
    FA=10*ans[-2]+ans[-1]
else:
    FA=100*ans[-3]+10*ans[-2]+ans[-1]
print(FA)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
ans=[-1]*(N+1)
for i in range(M):
    s,c=map(int,input().split())
    if ans[s]==-1 :
        ans[s]=c
    elif ans[s]==c :
        pass
    else:
        print('-1')
        exit()

if N>=2 and ans[1]==0:
    print('-1')
    exit()    
elif N>=2 and ans[1]==-1: #ここが間違ってた。
    ans[1]==1
elif N==1:
    if ans[1]==-1 0r ans[1]==0:
        print(0)

else:
    pass

for j in range(len(ans)):
    if ans[j] == -1:
        ans[j] = 0

if N==1:
    FA=ans[-1]
elif N==2:
    FA=10*ans[-2]+ans[-1]
else:
    FA=100*ans[-3]+10*ans[-2]+ans[-1]
print(FA)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
ans=['A']*(N+1)
for i in range(M):
    s,c=map(str,input().split())
    s=int(s)
    if ans[s]=='A' or ans[s]==c :
        ans[s]=c
    else:
        print('-1')
        exit()
if N>1 and ans[1]=='A':
    print('-1')
FA=''.join(FA)
FA=FA[1:]
if FA.count('A')>0:
    print(FA.replace('A','0'))
print(int(FA))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
ans=['A']*(N+1)
for i in range(M):
    s,c=map(str,input().split())
    s=int(s)
    if ans[s]=='A' or ans[s]==c :
        ans[s]=c
    else:
        print('-1')
        exit()
if N>1 and ans[1]=='0':
    print('-1')
FA=ans[1:]
FA=''.join(FA)
if FA.count('A')>0:
    print(FA.replace('A','0'))
print(int(FA))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
ans=['A']*(N+1)
for i in range(M):
    s,c=map(str,input().split())
    s=int(s)
    if ans[s]=='A' or ans[s]==c :
        ans[s]=c
    else:
        print('-1')
        exit()
FA=ans[1:]
FA=''.join(FA)
if FA.count('A')>0:
    print(FA.replace('A','0'))
print(int(FA))
Problem p02772 (python)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
arr=[]
for A in a:
    if A%2==0:
        arr.append(A)
    else:
        pass

for n in arr:
    if n%3==0 or n%5==0:
        pass
    else:
        print('DENIED')
        exit()
print('APPROVED')

Buggy submission (verdict: Runtime Error):
N=int(input())
a=list(map(int,input().split()))
arr=[]
for A in a:
    if A%2==0:
        arr.append(A)
    else:
        pass

for n in arr:
    if n%3==0 or n%%==0:
        pass
    else:
        print('DENIED')
        exit()
print('APPROVED')
Problem p02780 (python)

Fixed submission:
N,K=map(int,input().split())
_=input().split()
S=[]
for s in _:
    S.append((int(s)+1)/2) #初めから期待値で配列作成

maxsum=sum(S[0:K])
tempsum=maxsum

for i in range(N-K):
    tempsum=tempsum-S[i]+S[i+K]
    if maxsum<tempsum:
        maxsum=tempsum
    else:
        pass

print(maxsum)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
_=input().split()
S=[]
for s in _:
    S.append((int(_)+1)/2)

maxsum=0

for i in range(len(S)):
    tempsum=sum(S[i:i+K])
    if maxsum<tempsum:
        maxsum=tempsum
    else:
        pass
      
print(maxsum)
Problem p02789 (python)

Fixed submission:
N,M=map(int,input().split())
if N==M:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N,M==map(int,input().split())
if N==M:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N,M==map(int,input().split)
if N==M:
  print('Yes')
else:
  print('No')
Problem p02801 (python)

Fixed submission:
c=input()
l=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
print(l[l.index(c)+1])

Buggy submission (verdict: Runtime Error):
c=input()
l=[a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]
print(l[l.index(c)+1])
Problem p02802 (python)

Fixed submission:
N,M=map(int,input().split())
L1=[0]*(N+1) #正解判定、iは問題分中と一致
L2=[0]*(N+1) #WAのカウント用、iは問題分中と一致

for i in range(M):
    p,S=input().split()
    if L1[int(p)]==1:
        pass
    else:
        if S=='AC':
            L1[int(p)]=1
        else:
            L2[int(p)]+=1

for j in range (N+1):
    if L1[j]==0 and L2[j]>0:
        L2[j]=0

print(sum(L1),sum(L2))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
L1=[0]*(N+1) #正解判定、iは問題分中と一致
L2=[0]*(N+1) #WAのカウント用、iは問題分中と一致

for i in range(M):
    p,S=input().split()
    if L1[int(p)]==1:
        pass
    else:
        if S=='AC':
            L1[int(p)]=1
        else:
            L2[int(p)]+=1

for j in range (M):
    if L1[j]==0 and L2[j]>0:
        L2[j]=0

print(sum(L1),sum(L2))
Problem p02811 (python)

Fixed submission:
K,N=map(int,input().split())
if 500*K>=N:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
K,N=map(int,input().split())
if 500*K>=X:
    print('Yes')
else:
    print('No')
Problem p02813 (python)

Fixed submission:
import itertools

N=int(input())
p=list(map(str,input().split()))
q=list(map(str,input().split()))
P=''.join(p)
Q=''.join(q)

ns=list(itertools.permutations(range(1,N+1)))
Ns=[]
for i in range(len(ns)):
    temparr=[]
    for j in range(N):
        a=ns[i][j]
        temparr.append(str(a))
    b=''.join(temparr)
    Ns.append(b)

PO=Ns.index(P)
QO=Ns.index(Q)
print(abs(PO-QO))

Buggy submission (verdict: Runtime Error):
import itertools

N=int(input())
P=list(map(int,input().split()))
Q=list(map(int,input().split()))


Ns=list(itertools.permutations(range(1,N+1)))
PO=Ns.index(P)
QO=Ns.index(Q)
print(abs(PO-QO))

Buggy submission (verdict: Runtime Error):
import itertools

N=int(input())
P=list(map(int,input().split()))
Q=list(map(int,input().split()))


Ns=list(itertools.permutations(range(1,N+1)))
PO=Ns.index(P)
QO=Ns.index(Q)
print(abs(Po-QO))
Problem p02842 (python)

Fixed submission:
# N=1079
N=int(input())

a=int(N*100/110)-1

flg=False

for i in range (N-a+1):
    if ((a+i)*1.08)//1==N:
        print(a+i)
        exit()
    else:
        pass
print(':(')

Buggy submission (verdict: Runtime Error):
# N=1079
N=int(input())

a=str(N*100/108)
b=str((N+1)*100/108)

if a+1 <=b:
    print(round(a+0.5))
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
# N=1079
N=int(input())

a=str(N*100/108)
b=str((N+1)*100/108)

print(a,b)

if a+1 <=b:
    print(round(a+0.5))
else:
    print(":(")
Problem p02848 (python)

Fixed submission:
N=int(input())
S=input()

a=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
anslist=[]

for i in range(len(S)):
    b=a.index(S[i])
    anslist.append(a[b+N])

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

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

a=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
anslist=[]

for i in range(len(S)):
    b=a.index(S[i])
    ans.append(a[b+N])

ans="".join(anslist)
Problem p02886 (python)

Fixed submission:
from itertools import combinations

N=int(input())
d=list(map(int,input().split()))

c=list(combinations(d,2))

ans=0

for i in range(len(c)):
    a=c[i][0]*c[i][1]
    ans+=a

print(ans)

Buggy submission (verdict: Runtime Error):
from itertools import combinations

N=int(input())
d=list(map(int,input()))

c=combinations(d,2)
print(d)
Problem p02898 (python)

Fixed submission:
import numpy as np

N,K=map(int,input().split())
h=list(map(int,input().split()))
# N,K=4,150
# h=[150, 140, 100, 200]

harry=np.array(h)
ans=np.count_nonzero(harry>=K)

print(ans)


# import sys
# print(sys.version_info)

Buggy submission (verdict: Runtime Error):
import numpy as np

N,K=map(int,input().split())
h=list(map(int,input().split()))
# N,K=4,150
# h=[150, 140, 100, 200]

harry=np.array(h)
ans=np.where(harry>=K)

print(ans[0][1])


# import sys
# print(sys.version_info)

Buggy submission (verdict: Runtime Error):
import numpy as np

N,K=map(int,input().split())
h=list(map(int,input().split()))
# N,K=4,150
# h=[150, 140, 100, 200]

harry=np.array(h)
ans=np.where(harry>=K)


print(harry)
print(ans[0][1])
print(type(ans))
Problem p02899 (python)

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

# ans=[]
ans=[0]*N

# for i in range(1,N+1):
    # a=Ai.index(i)+1
    # ans.append(str(a))
for i in range (N):
    ans[Ai[i]-1]=str(i+1)

print(' '.join(ans))

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

# ans=[]
ans=[]*N

# for i in range(1,N+1):
    # a=Ai.index(i)+1
    # ans.append(str(a))
for i in range (N):
    ans[Ai[i]-1]=str(i+1)

print(' '.join(ans))
Problem p02909 (python)

Fixed submission:
s=input()
w=('Sunny','Cloudy','Rainy','Sunny')
n=w.index(s)
print(w[n+1])

Buggy submission (verdict: Runtime Error):
s=input()
w=(Sunny,Cloudy,Rainy,Sunny)
n=w.index(s)
print(w[n+1])
Problem p02921 (python)

Fixed submission:
S=input()
T=input()

ans=0

for i in range(3):
    if S[i]==T[i]:
        ans+=1

print(ans)

Buggy submission (verdict: Runtime Error):
S=input()
T=input()

ans=0

for in in range(3):
    if S[i]==T[i]:
        ans+=1

print(ans)
Problem p02923 (python)

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

# ans=[0]*N

# for i in range (N):
#     a=0
#     # if Hi[i]<Hi[i-1]:
#     #     continue
#     for j in range(N-i-1):
#         if Hi[i+j]>=Hi[i+j+1]:
#             a+=1
#         else:
#             break
#     ans[i]=a

# print(max(ans))

ans=0
temp=0

for i in range(1,N):
    if Hi[i]<=Hi[i-1]:
        temp+=1
    else:
        if temp>ans:
            ans=temp
        else:
            pass
        temp=0
else:
    if temp>ans:
        ans=temp

print(ans)

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

ans=[0]*N

for i in range (N):
    a=0
    # if Hi[i]<Hi[i-1]:
    #     continue
    for j in range(N-i-1):
        if Hi[i+j]>=Hi[i+j+1]:
            a+=1
        else:
            break
    ans[i]=a
    i=i+j

print(max(ans))