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

p_num = t.count("P")
d_num = t.count("D")
h_num = t.count("?")

if p_num<d_num:
  p_num += h_num
else :
  d_num += h_num
  
if p_num>d_num:
  swap(p_num, d_num)
  
for i in range(p_num):
  print("PD", end='')

for i in range(d_num-p_num):
  print("D", end='')
print()


Fixed submission:
t = input()

t = t.replace('?', 'D')
print(t)

Buggy python submission (verdict: Runtime Error):
t = str(input())

p_num = t.count("P")
d_num = t.count("D")
h_num = t.count("?")

if p_num<d_num:
  p_num += h_num
else :
  d_num += h_num
  
if p_num>d_num:
  swap(p_num, d_num)
  
for i in range(p_num):
  print("PD")

for i in range(d_num-p_num):
  print("D")

Fixed submission:
t = input()

t = t.replace('?', 'D')
print(t)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
A = list(map(int, input().split()))
all = sum(A)

cnt = 0
for x in A:
  if 4 * m * x >= all:
    cnt++;
  
if cnt >= m:
  print("Yes")
else :
  print("No")


Fixed submission:
n, m = map(int, input().split())
A = list(map(int, input().split()))
all = sum(A)

cnt = 0
for x in A:
  if 4 * m * x >= all:
    cnt += 1
  
if cnt >= m:
  print("Yes")
else :
  print("No")

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
A = list(map(int, input().split()))
all = sum(A)

cnt = 0
for x in A:
  if 4 * m * A[i] >= all:
    cnt++;
  
if cnt >= m:
  print("Yes")
else :
  print("No")


Fixed submission:
n, m = map(int, input().split())
A = list(map(int, input().split()))
all = sum(A)

cnt = 0
for x in A:
  if 4 * m * x >= all:
    cnt += 1
  
if cnt >= m:
  print("Yes")
else :
  print("No")
Buggy python submission (verdict: Runtime Error):
from decimal import Decimal
a, b, c = map(int, input().split())

if Decimal(a)**0.5 + Decimal(b)**0.5 < Decimal(c)**0.5:
  print("Yes")
else:
  print("No")


Fixed submission:
from decimal import Decimal
import numpy as np
a, b, c = map(int, input().split())

if np.sqrt(Decimal(a)) + np.sqrt(Decimal(b)) < np.sqrt(Decimal(c)):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())

if (a!=b && a!=c && b!=c) || (a==b && a==c):
  print("No")
else :
  print("Yes")


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

if (a!=b and a!=c and b!=c) or (a==b and a==c):
  print("No")
else :
  print("Yes")
Buggy python submission (verdict: Runtime Error):
N = int(input())
M = int(input())

if N==M:
  print("Yes")
else:
  print("No")


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

if N==M:
  print("Yes")
else:
  print("No")

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

if N == M:
  print("Yes")
else:
  print("No")


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

if N==M:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a = input().rstrip()
ans = a % 1000
print(ans)

Fixed submission:
a = input().rstrip()
b = int(a) % 1000
if b == 0:
  ans = 0
else :
  ans = 1000 - b
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
A,B,H,M=map(int,input().split())

dA=(60*H+M)/2
dB=6*M
rad=dA-dB

C=math.radians(rad)

c=(A**2+B**2-2*A*B*math.cos(C))**0.5
print(format(c,'.10f'))


Fixed submission:
N=int(input())
s=N%10
Hon=[2,4,5,7,9]
Pon=[0,1,6,8]
Bon=[3]
if s in Hon:
  print('hon')
elif s in Pon:
  print('pon')
else:
  print('bon')
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=input()

P=[]
for i in range(N):
  for j in range(i+1,N):
    for k in range(j+1,N):
      t=S[i]+S[j]+S[k]
      if not(t in P):
        P.append(t)

print(len(P))


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

T=[]
c=0
for i in range(10):
  T=S
  i=str(i)
  if i in T[:N-2]:
    indx_i=T.index(i) 
    for j in range(10):
      j=str(j)
      if j in T[indx_i+1:N-1]:
        indx_j=indx_i+T[indx_i+1:].index(j)+1
        for k in range(10):
          k=str(k)
          if k in T[indx_j+1:]:
            c+=1

print(c)
Buggy python submission (verdict: Runtime Error):
SN,LN=map(int,input().split())
S=[list(map(int,input().split())) for _ in range(LN)]
p=list(map(int,input().split()))

c=0
for i in range(1<<SN):
  tmp=[0]*SN
  for j in range(SN):
    if (i>>j)&1==1:
      tmp[j]=1
      judge=True
  for k in range(LN):
    sum=0
    for x in S[k][1:]:
      if tmp[x-1]==1:
        sum+=1
    if sum%2!=p[k]:
      judge=False
  if judge:
    c+=1

print(c)

  


Fixed submission:
SN,LN=map(int,input().split())
S=[list(map(int,input().split())) for _ in range(LN)]
p=list(map(int,input().split()))

c=0
for i in range(1<<SN):
  tmp=[0]*SN
  judge=True
  for j in range(SN):
    if (i>>j)&1==1:
      #tmpにon/offの情報を0/1で入れる
      tmp[j]=1
      
  for k in range(LN):
    sum=0
    #ある電球のスイッチの番号を取得
    for x in S[k][1:]:
      # その番号のスイッチがonか否かを判定
      if tmp[x-1]==1:
        #onの個数を記録
        sum+=1
    #k番目の電球がonでなければその時点でfalse
    if sum%2!=p[k]:
      judge=False
  #あるtmpの状態で全ての電球がonならcにカウント
  if judge:
    c+=1

print(c)
Buggy python submission (verdict: Runtime Error):
A,B,K=map(int,input().split())

S=[]
for i in range(1,B+1):
  if A % i==0 and B%i==0:

    S.append(i)

print(S[K+1])

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

S=[]
for i in range(1,B+1):
  if A % i==0 and B%i==0:

    S.append(i)

print(S[-K])
Buggy python submission (verdict: Time Limit Exceeded):
import math
def factorization(num):
    factor = []
    flag = True
    is_Prime= True
    if num == 1:
        is_Prime = False
    while num > 1 and flag:
        flag = False
        for i in range(int(math.sqrt(num))+2):
            k = i + 2
            if num % k == 0:
                factor.append(k)
                num = int(num / k)
                is_Prime = False
                flag = True
                break
    if is_Prime or num > 1:
        factor.append(num)
    return factor

from collections import Counter

n = int(input())
result = 0
for k in range(1, n+1):
    f_k = factorization(k)
    co_f_k = Counter(f_k)
    fk = 1
    for item in co_f_k.values():
        fk *= item+1
    result += k * fk


print(result)


Fixed submission:
import math

n = int(input())
result = 0

for i in range(1, n+1):
    sub = n//i
    result += (sub+1)*sub*i/2


print(int(result))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a=list(map(int,input().split()))
result = ''
for i in range(n):
    t = 0
    for j in range(n):
        if j != i:
            t ^= a[j]
    result += str(t) + ' '

print(result)


Fixed submission:
n = int(input())
a=list(map(int,input().split()))
forward = []
back = []
result = ''
t = 0
for i in range(n):
    t ^= a[i]
    forward.append(t)
t = 0
for i in range(n-1, -1, -1):
    t ^= a[i]
    back.append(t)

for i in range(n):
    if i == 0:
        t = back[n-2]
    elif i == n-1:
        t = forward[n-2]
    else:
        t = forward[i-1] ^ back[n-2-i]
    result += str(t) + ' '

print(result)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = [0] + list(map(int, input().split()))

repeat = [0] * (n+1)
circle = [1]
point = 1
flag = 0
for _ in range(k):
    circle.append(a[point])
    repeat[point] = 1
    point = a[point]
    if(repeat[point] == 1):
        flag = 1
        break

if flag == 0:
    print(circle[-1])
else:
    index = circle.index(point)
    circle_cut = circle[index:-1]
    k = (k-index) % len(circle_cut)
    print(circle_cut[k])


Fixed submission:
a = input()
b = input()
a = str(a)
b = str(b)
length = len(a)
if a == b[0:length]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
while(True):
    a = input()
    b = input()
    a = str(a)
    b = str(b)
    length = len(a)
    if a == b[0:length]:
        print("Yes")
    else:
        print("No")

Fixed submission:
a = input()
b = input()
a = str(a)
b = str(b)
length = len(a)
if a == b[0:length]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
while(True):
    a = raw_input()
    b = raw_input()
    a = str(a)
    b = str(b)
    length = len(a)
    if a == b[0:length]:
        print("Yes")
    else:
        print("No")


Fixed submission:
a = input()
b = input()
a = str(a)
b = str(b)
length = len(a)
if a == b[0:length]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a = raw_input()
b = raw_input()
a = str(a)
b = str(b)
length = len(a)
if a == b[0:length]:
    print("Yes")
else:
    print("No")


Fixed submission:
a = input()
b = input()
a = str(a)
b = str(b)
length = len(a)
if a == b[0:length]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
c = input()
k = input()

if(k<a):
    print(k)
elif(k>a and k<a+b):
    print(a)
elif(k>a+b and k<a+b+c):
    print(a-(k-(a+b)))


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

if(k<=a):
    print(k)
elif(k>a and k<=a+b):
    print(a)
else:
    print(a-(k-(a+b)))
Buggy python submission (verdict: Time Limit Exceeded):
import math
A,B,N= map(int,input().split())

if N>=B:
  N=B
  
max=0
for i in reversed(range(1, N+1)):
  y=math.floor(A*i/B)-A*math.floor(i/B)
  if max < y :
    max=y
print(int(max))

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

max=0
if N>B:
  N=B-1
  y=math.floor(A*N/B)-A*math.floor(N/B)
  print(int(y))
elif N==B:
  N=B-1
  y=math.floor(A*N/B)-A*math.floor(N/B)
  print(int(y))
else:
	y=math.floor(A*N/B)-A*math.floor(N/B)
	print(int(y))
Buggy python submission (verdict: Runtime Error):
N= int(input())
list(N)

if N in 7:
  print("yes")
else:
  print("no")
  

Fixed submission:
N=input()
n=list(N)
x= '7' in n
if x is True:
  print("Yes")
else:
  print("No")

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

if N in 7:
  print("yes")
else:
  print("no")
  

Fixed submission:
N=input()
n=list(N)
x= '7' in n
if x is True:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
import numpy as np

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

As = np.array(list(map(int,input().split())))
Bs = np.array(list(map(int,input().split())))

As_selected = []
Bs_selected = []

answer = 0

for i in range(N+1):
    if(As[0:i].sum() <= K):
         As_selected.append(As[0:i].sum())
    else:
        break
for i in range(M+1):
    if(Bs[0:i].sum() <= K):
         Bs_selected.append(Bs[0:i].sum())
    else:
        break

answer = 0

for i in np.arange(len(As_selected))+1:
    for j in np.arange(len(Bs_selected))+1:
        if(As_selected[-i] > K):
            break

        if(As_selected[-i] + Bs_selected[-j] <= K):
            answer = max(len(As_selected)+len(Bs_selected) -i - j, answer)
            break

print(answer)

Fixed submission:

a = int(input())

print(a + a**2 + a**3)

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

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

As = np.array(list(map(int,input().split())))
Bs = np.array(list(map(int,input().split())))

As_selected = []
Bs_selected = []

answer = 0

for i in range(N+1):
    if(As[0:i].sum() <= K):
         As_selected.append(As[0:i].sum())
    else:
        break
for i in range(M+1):
    if(Bs[0:i].sum() <= K):
         Bs_selected.append(Bs[0:i].sum())
    else:
        break

answer = 0

for i in np.arange(len(As_selected))+1:
    for j in np.arange(len(Bs_selected))+1:
        if(As_selected[-i] + Bs_selected[-j] <= K):
            answer = max(len(As_selected)+len(Bs_selected) -i - j, answer)
            break

print(answer)

Fixed submission:

a = int(input())

print(a + a**2 + a**3)
Buggy python submission (verdict: Runtime Error):

 k=0
ans=[]
while k<1:
    if num<=26:
        ans.append((chr(96+num)))
        k=1
    elif num%26==0:
        num=(num//26-1)
        ans.append((chr(96+26)))
    else:
        ans.append((chr(96+num%26)))
        num=(num//26)

for i in range(len(ans)-1,-1,-1):
    if i ==0:
        print(ans[i])
    else:
        print(ans[i], end="")

Fixed submission:
num = int(input())
k=0
ans=[]
while k<1:
    if num<=26:
        ans.append((chr(96+num)))
        k=1
    elif num%26==0:
        num=(num//26-1)
        ans.append((chr(96+26)))
    else:
        ans.append((chr(96+num%26)))
        num=(num//26)

for i in range(len(ans)-1,-1,-1):
    if i ==0:
        print(ans[i])
    else:
        print(ans[i], end="")
Buggy python submission (verdict: Runtime Error):
num = []
num = input().split(" ")
#print(num)

for i in range(5):
    if int(num[i]) == 0:
        print(int(num[i+1])-1)

Fixed submission:
# coding: utf-8
# Your code here!
num = []
num = input().split(" ")
#print(num)

for i in range(5):
    if i != 4:
        if int(num[i]) == 0:
            print(int(num[i+1])-1)
    elif int(num[4]) == 0:
        print(int(num[i-1])+1)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
count = int(input())
num = []
num = input().split()

total = 1
for i in range(count):
    if total == 0:
        break
    total = int(num[i])*total
    
if total > 10**18:
    total = -1
    
print(total)

Fixed submission:
# coding: utf-8
# Your code here!

count = int(input())
num = []
num = input().split()

hantei = 0
for i in range(count):
    if int(num[i]) == 0:
        hantei = 1
        total = 0
    else:
        continue
      #print("z")
      
if hantei == 0:
    total = 1
    for i in range(count):
        total = int(num[i])*total
        if total > 10**18:
            total = -1
            break
    
print(total)

Buggy python submission (verdict: Time Limit Exceeded):

count = int(input())
num = []
num = input().split()

total = 1
for i in range(count):
    if total == 0:
        break
    total = int(num[i])*total
    
if total > 10**18:
    total = -1
    
print(total)

Fixed submission:
# coding: utf-8
# Your code here!

count = int(input())
num = []
num = input().split()

hantei = 0
for i in range(count):
    if int(num[i]) == 0:
        hantei = 1
        total = 0
    else:
        continue
      #print("z")
      
if hantei == 0:
    total = 1
    for i in range(count):
        total = int(num[i])*total
        if total > 10**18:
            total = -1
            break
    
print(total)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
count = int(input())
num = []
num = input().split()

total = 1
for i in range(count):
    total = int(num[i])*total
    
if total > 10**18:
    total = -1
    
print(total)

Fixed submission:
# coding: utf-8
# Your code here!

count = int(input())
num = []
num = input().split()

hantei = 0
for i in range(count):
    if int(num[i]) == 0:
        hantei = 1
        total = 0
    else:
        continue
      #print("z")
      
if hantei == 0:
    total = 1
    for i in range(count):
        total = int(num[i])*total
        if total > 10**18:
            total = -1
            break
    
print(total)
Buggy python submission (verdict: Runtime Error):
a, b = int(input().split())
print(a * b)


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

Buggy python submission (verdict: Runtime Error):
a, b = input().split()
print(a * b)


Fixed submission:
a, b = map(int, input().split())
print(a * b)
Buggy python submission (verdict: Runtime Error):

def main():
    K = int(input())
    S = input()
    diff = K - len(S)
    if diff >= 0:
        print(S)
    else:
        print(S[:K]+'...')

if __name__ == "__main__":
    main()


Fixed submission:
def main():
    N = input()
    hon = (2, 4, 5, 7, 9)
    pon = (0, 1, 6, 8)
    bon = (3,)
    if int(N[-1]) in hon:
        print('hon')
    elif int(N[-1]) in pon:
        print('pon')
    elif int(N[-1]) in bon:
        print('bon')

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import math
A, B, N = map(int,input().split(' '))

def f(x):
    return math.floor(A*x/B)-A*math.floor(x/B)


def main():
    
    ans = 0
    i = 0
    while B > i and i <= N:
        fi = f(i)
        ans = f(i) if ans < fi else ans
        i += 1 
    
    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
import math
A, B, N = map(int,input().split(' '))

def f(x):
    return math.floor(A*x/B)-A*math.floor(x/B)


def main():
    if N >= B:
        print(f(B-1))
    else:
        print(f(N))

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import math
A, B, N = map(int,input().split(' '))

def f(x):
    return math.floor(A*x/B)-A*math.floor(x/B)


def main():
    
    ans = 0
    for i in range(N+1):
        fi = f(i)
        ans = f(i) if ans < fi else ans

    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
import math
A, B, N = map(int,input().split(' '))

def f(x):
    return math.floor(A*x/B)-A*math.floor(x/B)


def main():
    if N >= B:
        print(f(B-1))
    else:
        print(f(N))

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import numpy
n= int(input())
Number=list(map(int,input().split())
print(numpy.prod(Number)
            

Fixed submission:
n = int(input())
nums = list(map(int,input().split()))
limit = 10**18
res = 1
i = 0
if 0 in nums:
    print(0)
    exit()
while i<n:
    res *= nums[i]
    i += 1
    if res > limit:
        res = -1
        break
print(res)
Buggy python submission (verdict: Runtime Error):
K=int(input())
A,B=map(int,input().split())
for i in range(A,B+1):
  if(i%K==0):
    print("ok")
    break
  if(i==B and i%K !=0)
    print("NG")
  
 


Fixed submission:
K = int(input())
A, B = map(int, input().split())
mul = 0
for i in range(A, B + 1):
    if i % K == 0:
        mul += 1
print("OK" if mul > 0 else "NG")

Buggy python submission (verdict: Runtime Error):
K=int(input())
A,B=map(int,input().split())
for i in range(A,B):
  if(i%K==0):
    print("ok")
    break
  if(i==B and i%K not ==0)
    print("NG")
  
 


Fixed submission:
K = int(input())
A, B = map(int, input().split())
mul = 0
for i in range(A, B + 1):
    if i % K == 0:
        mul += 1
print("OK" if mul > 0 else "NG")

Buggy python submission (verdict: Runtime Error):
K=int(input())
A,B=map(int,input().split())
for i in range(A,B):
  if(i%K==0):
    print("ok")
  if(i==B and i%K!=0)
    print("NG")
  
 


Fixed submission:
K = int(input())
A, B = map(int, input().split())
mul = 0
for i in range(A, B + 1):
    if i % K == 0:
        mul += 1
print("OK" if mul > 0 else "NG")

Buggy python submission (verdict: Runtime Error):
K=int(input())
A,B=map(int,input().split())
for i in range(A,B):
  if(i%K==0):
    print("ok")
  if(i==B and i%K not ==0)
    print("NG")
  
 

Fixed submission:
K = int(input())
A, B = map(int, input().split())
mul = 0
for i in range(A, B + 1):
    if i % K == 0:
        mul += 1
print("OK" if mul > 0 else "NG")
Buggy python submission (verdict: Runtime Error):
if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else : 
    print("No")


Fixed submission:
S=input()
if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else : 
    print("No")

Buggy python submission (verdict: Runtime Error):

S1=list(S)
if S1[2]==S1[3] and S1[4]==S1[5]:
    print("Yes")
else : 
    print("No")



Fixed submission:
S=input()
if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else : 
    print("No")

Buggy python submission (verdict: Runtime Error):

S1=list(S)
print(S1)
if S1[2]==S1[3] and S1[4]==S1[5]:
    print("Yes")
else : 
    print("No")



Fixed submission:
S=input()
if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else : 
    print("No")
Buggy python submission (verdict: Runtime Error):
S=map(str,input())
if "A" in S:
    print("Yes")
elif :
    S="AAA"
    print("No")
else :
    print("No")

Fixed submission:




s = input()

if s == 'AAA' or s == 'BBB':
  print('No')
else:
  print('Yes')

Buggy python submission (verdict: Runtime Error):
S=map(str,input())
if "A" in S:
    print("Yes")
elif :
    S="AAA"
else :
    print("No")

Fixed submission:




s = input()

if s == 'AAA' or s == 'BBB':
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
N, A, B=map(int,input().split())
llist=[N]
for i in range(N-1):
    if i<A or (i>B+1) and A>1  :
       llist.append("blue")
    else :
        llist.append("red")
print(llist.count("blue"))

Fixed submission:

n, a, b = map(int, input().split())
period = a+b
times = n//period
k = n%period
n =  a if k >a else k
print(times*a + n)

Buggy python submission (verdict: Time Limit Exceeded):
N, A, B=map(int,input().split())
llist=[N]
for i in range(N-1):
    if i<A:
       llist.append("blue")
    elif (i>B+1) and A>1 :
       llist.append("blue")
    else :
        llist.append("red")

print(llist.count("blue"))

Fixed submission:

n, a, b = map(int, input().split())
period = a+b
times = n//period
k = n%period
n =  a if k >a else k
print(times*a + n)
Buggy python submission (verdict: Runtime Error):
K=int(input())
X=int(input())
if K*500>=X:
  print("Yes")
else : 
  print("No")
 

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

Buggy python submission (verdict: Runtime Error):
X,K=int(input())
if K*500>=X:
  print("Yes")
else : 
  print("No")
 

Fixed submission:
K, X=map(int,input().split())
if K*500>=X:
  print("Yes")
else : 
  print("No")
Buggy python submission (verdict: Runtime Error):
N,S=input()
print(S.count("abc"))

Fixed submission:
N=int(input())
S=input()
print(S.count("ABC",0,N))
Buggy python submission (verdict: Runtime Error):
import itertools
import math
N=int(input())
P=list(map,int,input().split())
Q=list(map,int,input().split())
L=list(map(list,list(itertools.permutations(list(i for i in range(1,N+1)),N))))
a=L.index(P)
b=L.index(Q)
print(abs(a-b))




Fixed submission:
import itertools
import math
N = int(input())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))
L = list(map(list,list(itertools.permutations(list(i for i in range(1,N+1)),N))))
a = L.index(P)
b = L.index(Q)
print(abs(a-b))
Buggy python submission (verdict: Runtime Error):
function sort(S,T){
  var str1=S;
  
  var str2 =T;
  var res=(str1.split("")).concat(str2.split(""));
  return res;
}

Fixed submission:
S,T=input().split()
print(T+S)
Buggy python submission (verdict: Runtime Error):
X=int(input())
for i in range(2,X+2):
  if(X%i==0):
    X+=1
    continue
  else:
    if(i<X):
      continue
    else if(i<=X):
      print(X)

Fixed submission:
def isPrime(x):
  if x < 2:
    return False
  for i in range(2,x):
    if x%i == 0:
      return False
  return True

num = int(input())

for i in range(num,100004):
  if isPrime(i):
    print(i)
    break

Buggy python submission (verdict: Runtime Error):
X=int(input())
for i in range(2,X):
  if(X%i==0):
    X+=1
    break
  else:
    if(i<X):
      continue
    else
      print(X)

Fixed submission:
def isPrime(x):
  if x < 2:
    return False
  for i in range(2,x):
    if x%i == 0:
      return False
  return True

num = int(input())

for i in range(num,100004):
  if isPrime(i):
    print(i)
    break

Buggy python submission (verdict: Runtime Error):
Source Code 

Copy
Copy
X=int(input())
for i in range(2,X):
  if(X%i==0):
    X+=1
    break
  else :
  	print(X)

Fixed submission:
def isPrime(x):
  if x < 2:
    return False
  for i in range(2,x):
    if x%i == 0:
      return False
  return True

num = int(input())

for i in range(num,100004):
  if isPrime(i):
    print(i)
    break

Buggy python submission (verdict: Runtime Error):

X=int(input())
for i in range(2,X):
  if(X%i==0):
    X+=1
    break
  else :
  	print X

Fixed submission:
def isPrime(x):
  if x < 2:
    return False
  for i in range(2,x):
    if x%i == 0:
      return False
  return True

num = int(input())

for i in range(num,100004):
  if isPrime(i):
    print(i)
    break

Buggy python submission (verdict: Runtime Error):
X=int(input())
for i in rage(2,X):
  if(X%i==0):
    X+=1
    break
  else :
  	print X


Fixed submission:
def isPrime(x):
  if x < 2:
    return False
  for i in range(2,x):
    if x%i == 0:
      return False
  return True

num = int(input())

for i in range(num,100004):
  if isPrime(i):
    print(i)
    break
Buggy python submission (verdict: Runtime Error):
import math as m
a,b=list(map(float,input().split()))
print(m.floor(a*(b*10**5)/10**5)

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