Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
import decimal

roota = decimal.Decimal.sqrt(a)
rootb = decimal.Decimal.sqrt(b)
rootc = decimal.Decimal.sqrt(c)
if roota + rootb < rootc:
  print("Yes")
else:
  print("No")

Fixed submission:
import decimal
a,b,c = map(decimal.Decimal,input().split())
roota = decimal.Decimal.sqrt(a)
rootb = decimal.Decimal.sqrt(b)
rootc = decimal.Decimal.sqrt(c)
if roota + rootb < rootc:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c = map(float,input().split())
import decimal

roota = decimal.Decimal.sqrt(a)
rootb = decimal.Decimal.sqrt(b)
rootc = decimal.Decimal.sqrt(c)
if roota + rootb < rootc:
  print("Yes")
else:
  print("No")

Fixed submission:
import decimal
a,b,c = map(decimal.Decimal,input().split())
roota = decimal.Decimal.sqrt(a)
rootb = decimal.Decimal.sqrt(b)
rootc = decimal.Decimal.sqrt(c)
if roota + rootb < rootc:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c = map(float,input().split())
from decimal import *

roota = Decimal.sqrt(a)
rootb = Decimal.sqrt(b)
rootc = Decimal.sqrt(c)
if roota + rootb < rootc:
  print("Yes")
else:
  print("No")

Fixed submission:
import decimal
a,b,c = map(decimal.Decimal,input().split())
roota = decimal.Decimal.sqrt(a)
rootb = decimal.Decimal.sqrt(b)
rootc = decimal.Decimal.sqrt(c)
if roota + rootb < rootc:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
from decimal import *

roota = Decimal(a) ** Decimal(0.5)
rootb = Decimal(b) ** Decimal(0.5)
rootc = Decimal(c) ** Decimal(0.5)
n = 24
root_a = Decimal(str(roota)).quantize(Decimal(str(10**(n*-1))), rounding=ROUND_DOWN)
root_b = Decimal(str(rootb)).quantize(Decimal(str(10**(n*-1))), rounding=ROUND_DOWN)
root_c = Decimal(str(rootc)).quantize(Decimal(str(10**(n*-1))), rounding=ROUND_DOWN)

if root_a + root_b < root_c:
  print("Yes")
else:
  print("No")

Fixed submission:
import decimal
a,b,c = map(decimal.Decimal,input().split())
roota = decimal.Decimal.sqrt(a)
rootb = decimal.Decimal.sqrt(b)
rootc = decimal.Decimal.sqrt(c)
if roota + rootb < rootc:
  print("Yes")
else:
  print("No")

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

Fixed submission:
import decimal
a,b,c = map(decimal.Decimal,input().split())
roota = decimal.Decimal.sqrt(a)
rootb = decimal.Decimal.sqrt(b)
rootc = decimal.Decimal.sqrt(c)
if roota + rootb < rootc:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N,A,B = map(int,input().split())
a = ""
b = ""
for i in range(A):
  a += "a"
for j in range(B):
  b += "b"
c = a+b
while len(c) <= N:
  c += c

d = c[:N]
print(d.count("a"))

Fixed submission:
import math
N,A,B = map(int,input().split())
c = N%(A+B)
p = math.floor(N/(A+B))
if c >= A:
  print((A*p)+A)
else:
  print((A*p)+c)
Buggy python submission (verdict: Runtime Error):
from collections import deque
S = list(map(str,input().split()))
Q = int(input())
Query = [list(map(str,input().split())) for _ in range(Q)]
d = deque(S)
for i in range(Q):
  if Query[i][0] == "1":
    d = d.rotate()
  elif Query[i][0] == "2":
    if Query[i][1] == "1":
      d.append(Query[i][2])
    elif Query[i][1] == "2":
      d.appendleft(Query[i][2])
ans = ''.join(d)
print(ans)

Fixed submission:
from collections import deque
S = str(input())
Q = int(input())
d = deque()
reverse = 1
for i in S:
    d.append(i)
for j in range(Q):
  Query = input().split()
  if len(Query) == 1:
    reverse *= -1
  else:
    F = int(Query[1])
    C = str(Query[2])
    if reverse == 1:
      if F == 1:
        d.appendleft(C)
      elif F == 2:
        d.append(C)
    elif reverse == -1:
      if F == 1:
        d.append(C)
      elif F == 2:
        d.appendleft(C)
if reverse == -1:
    d.reverse()
ans = ''.join(d)
print(ans)

Buggy python submission (verdict: Runtime Error):
from collections import deque
S = list(map(str,input().split()))
Q = int(input())
Query = [list(map(str,input().split())) for _ in range(Q)]
d = deque(S)
for i in range(Q):
  if Query[i][0] == "1":
    d = ''.join(list(reversed(d)))
  elif Query[i][0] == "2":
    if Query[i][1] == "1":
      d.append(Query[i][2])
    elif Query[i][1] == "2":
      d.appendleft(Query[i][2])
ans = ''.join(d)
print(ans)

Fixed submission:
from collections import deque
S = str(input())
Q = int(input())
d = deque()
reverse = 1
for i in S:
    d.append(i)
for j in range(Q):
  Query = input().split()
  if len(Query) == 1:
    reverse *= -1
  else:
    F = int(Query[1])
    C = str(Query[2])
    if reverse == 1:
      if F == 1:
        d.appendleft(C)
      elif F == 2:
        d.append(C)
    elif reverse == -1:
      if F == 1:
        d.append(C)
      elif F == 2:
        d.appendleft(C)
if reverse == -1:
    d.reverse()
ans = ''.join(d)
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
X = list(map(int,input()))
import math
P = sum(X)/len(X)
count = 0
for i in range(N):
  count += (X[i] - P)**2
print(math.ceil(count))

Fixed submission:
N = int(input())
X = list(map(int,input().split()))
P = sum(X)/len(X)
P = round(P)
count = 0
for i in range(N):
  count += (X[i] - P)**2
print(count)
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
count = 0
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
    

for i in range(2, n + 1):
  g1.append( ( g1[-1] * i ) % mod )
  inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
  g2.append( (g2[-1] * inverse[-1]) % mod )
for j in range(2,n + 1):
  if j == a or i == b:
    pass
  else:
    count += cmb(n, j, p)
print(count)


Fixed submission:
mod = 10**9 + 7
def cmb(n,r,mod):
	a=1
	b=1
	r = min(r,n-r)
	for i in range(r):
		a = a*(n-i)%mod
		b = b*(i+1)%mod
	return a*pow(b,mod-2,mod)%mod

n,a,b = map(int,input().split())
count = 0
all = pow(2,n,mod) - 1
nCa = cmb(n,a,mod)
nCb = cmb(n,b,mod)
ans = all - (nCa + nCb)
while (ans < 0):
  ans += mod
print(ans)
Buggy python submission (verdict: Runtime Error):
rom collections import Counter
N = int(input())
S = [input() for _ in range(N)]
CS = Counter(S)
v = 0
ans = []
for i  in CS.values():
  v = max(v,i)
for i,j in CS.items():
  if v == j:
    ans.append(i)
ans.sort()
print(ans[i] for i in range(len(ans)))

Fixed submission:
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
CS = Counter(S)
v = 0
ans = []
for i  in CS.values():
  v = max(v,i)
for j,k in CS.items():
  if v == k:
    ans.append(j)
ans.sort()
print(*ans,sep="\n")

Buggy python submission (verdict: Runtime Error):
rom collections import Counter
N = int(input())
S = [input() for _ in range(N)]
CS = Counter(S)
v = 0
ans = []
for i  in CS.values():
  v = max(v,i)
for i,j in CS.items():
  if v == j:
    ans.append(i)
ans.sort
print(ans[i] for i in range(len(ans)))

Fixed submission:
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
CS = Counter(S)
v = 0
ans = []
for i  in CS.values():
  v = max(v,i)
for j,k in CS.items():
  if v == k:
    ans.append(j)
ans.sort()
print(*ans,sep="\n")

Buggy python submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
CS = Counter(S)
math = 0
ans = []
for i  in CS.values():
  v = max(v,i)
for i,j in CS.items():
  if v == j:
    ans.append(i)
ans.sort
print(ans[i] for i in range(len(ans)))



Fixed submission:
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
CS = Counter(S)
v = 0
ans = []
for i  in CS.values():
  v = max(v,i)
for j,k in CS.items():
  if v == k:
    ans.append(j)
ans.sort()
print(*ans,sep="\n")
Buggy python submission (verdict: Runtime Error):
S = str(input())
for i in range(S):
  S = "x"*len(S)
print(S)

Fixed submission:
S = str(input())
S = "x"*len(S)
print(S)

Buggy python submission (verdict: Runtime Error):
S = input()
for i in range(S):
  S[i] = "x"
print(S)

Fixed submission:
S = str(input())
S = "x"*len(S)
print(S)
Buggy python submission (verdict: Time Limit Exceeded):
N = map(int,input())
A = list(map(int,input().split()))
dup = [i for i in set(A) if A.count(i) > 1]
print("NO" if dup else "YES")

Fixed submission:
def has_duplicates(seq):
    return len(seq) != len(set(seq))
    
N = map(int,input())
A = list(map(int,input().split()))
print("NO" if has_duplicates(A) else "YES")

Buggy python submission (verdict: Runtime Error):
N = map(int,input())
A = [list(map(int,input().split())) for i in range(N)]
dup = [i for i in set(A) if A.count(i) > 1]
print("NO" if dup else "YES")


Fixed submission:
def has_duplicates(seq):
    return len(seq) != len(set(seq))
    
N = map(int,input())
A = list(map(int,input().split()))
print("NO" if has_duplicates(A) else "YES")

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [list(map(int,input().split())) for i in range(N)]
dup = [i for i in set(A) if A.count(i) > 1]
if not dup:
  print("YES")
else:
  print("NO")

Fixed submission:
def has_duplicates(seq):
    return len(seq) != len(set(seq))
    
N = map(int,input())
A = list(map(int,input().split()))
print("NO" if has_duplicates(A) else "YES")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
dup = [i for i in set(A) if A.count(i) > 1]
if not dup:
  print("YES")
else:
  print("NO")

Fixed submission:
def has_duplicates(seq):
    return len(seq) != len(set(seq))
    
N = map(int,input())
A = list(map(int,input().split()))
print("NO" if has_duplicates(A) else "YES")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
dup = [i for i in set(A) if A.count(i) > 1]
if dup:
  print("NO")
else:
  print("YES")

Fixed submission:
def has_duplicates(seq):
    return len(seq) != len(set(seq))
    
N = map(int,input())
A = list(map(int,input().split()))
print("NO" if has_duplicates(A) else "YES")

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [input().split() for i in range(N)]
dup = [j for j in set(A) if A.count(j) > 1]
if dup == True:
  print("NO")
else:
  print("YES")

Fixed submission:
def has_duplicates(seq):
    return len(seq) != len(set(seq))
    
N = map(int,input())
A = list(map(int,input().split()))
print("NO" if has_duplicates(A) else "YES")

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(input().split() for i in range(N))]
dup = [j for j in set(A) if A.count(j) > 1]
if dup == True:
  print("NO")
else:
  print("YES")

Fixed submission:
def has_duplicates(seq):
    return len(seq) != len(set(seq))
    
N = map(int,input())
A = list(map(int,input().split()))
print("NO" if has_duplicates(A) else "YES")
Buggy python submission (verdict: Runtime Error):
import math
 
H,A = list(map(int, input().split()))
 
print(math.ceil(H/A)

Fixed submission:
import math
 
H,A = list(map(int, input().split()))
 
print(math.ceil(H/A))

Buggy python submission (verdict: Runtime Error):
A,H= map(int, input().split())
count = 0
while H <= 0:
  H -= A
  count+=1
 print(count)

Fixed submission:
import math
 
H,A = list(map(int, input().split()))
 
print(math.ceil(H/A))
Buggy python submission (verdict: Runtime Error):
H,N,A = list(map(int, input().split()))
for i in A[N]:
  if H <= 0:
    break
  else:
    H -= A[i]
if set(A):
  print("Yes")
else:
  print("No")

Fixed submission:
H,N = map(int, input().split())
A = list(map(int, input().split()))
damage = sum(A)
if damage >= H:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
H = list(map(int,input().split()))
h = H.sort()
i = 0
count = 0
while sum(h[N-K]) == 0:
  while h[N-K] == 0:
    count += 1
    while i <= N-K:
      i += 1
print(count)

Fixed submission:
N,K = map(int,input().split())
H = list(map(int,input().split()))
H.sort(reverse=True)
 
sum = 0
for count in range(N):
        if count >= K:
            sum += H[count]
 
print(sum)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
H = list(map(int,input().split()))
i = 0
count = 0
while sum(H[N-K]) == 0:
  while H[N-K] == 0:
    count += 1
    while i <= N-K:
      i += 1
print(count)

Fixed submission:
N,K = map(int,input().split())
H = list(map(int,input().split()))
H.sort(reverse=True)
 
sum = 0
for count in range(N):
        if count >= K:
            sum += H[count]
 
print(sum)
Buggy python submission (verdict: Runtime Error):
from math import ceil
H = int(input())
print(2**(ceil(H/2)+1)-1)

Fixed submission:
H = int(input())
enemy = 1
count = 0
while H >= 1:
  count += enemy
  enemy *= 2
  H //= 2
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
H = int(input())
count = 0
P = [H]
while H > 0:
  H //= 2
  P.pop(0)
  P.append(H)
  P.append(H)
  H = P[0]
  count += 1
print(count)

Fixed submission:
H = int(input())
enemy = 1
count = 0
while H >= 1:
  count += enemy
  enemy *= 2
  H //= 2
print(count)

Buggy python submission (verdict: Runtime Error):
H = map(int, input().split())
enemy = 1
count = 0
while H >= 1:
  count += enemy
  enemy *= 2
  H //= 2
print(count)

Fixed submission:
H = int(input())
enemy = 1
count = 0
while H >= 1:
  count += enemy
  enemy *= 2
  H //= 2
print(count)
Buggy python submission (verdict: Runtime Error):
H,N = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(N)]
dp = [0]*(H+1)
for i in range(1,H + 1):
  dp[i] = min(dp[i-a]+b for a,b in AB)
print(dp[H])

Fixed submission:
H,N = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(N)]
maxA = max(a for a,b in AB)
dp = [0]*(H+maxA)
for i in range(1,H + maxA):
  dp[i] = min(dp[i-a]+b for a,b in AB)
print(dp[H])
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
if M >= N:
  print("Yes")
else
  print("No")

Fixed submission:
N,M = map(int,input().split())
if M >= N:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
la = []
lb = []
i = 0
map_la = map(str, la)
map_lb = map(str, lb)
while i <= b:
  la.append(a)
  map_la = ''.join(map_la)
  i += 1
while i <= a:
  la.append(b)
  map_lb = ''.join(map_lb)
  i += 1
if map_la <= map_lb:
  print(map_la)
else:
  print(map_lb)

Fixed submission:
a,b = map(str,input().split())
if a > b:
  print(b*int(a))
else:
  print(a*int(b))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int,input().split()))
ans = 1
Pj = []
Pj.append(P[0])
for i in range(1,N):
  Pj.append(P[i])
  if P[i] <= min(Pj):
    ans += 1
  else:
    pass
print(ans)

Fixed submission:
N = int(input())
P = list(map(int,input().split()))
ans = 1
Pj = P[0]
for i in range(1,N):
  Pj = min(Pj,P[i])
  if P[i] <= Pj:
    ans += 1
  else:
    pass
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int,input().split()))
ans = 1
for i in range(1,N):
  minP = min(P[j] for j in range(0,i+1))
  if P[i] <= minP:
    ans += 1
  else:
    pass
print(ans)

Fixed submission:
N = int(input())
P = list(map(int,input().split()))
ans = 1
Pj = P[0]
for i in range(1,N):
  Pj = min(Pj,P[i])
  if P[i] <= Pj:
    ans += 1
  else:
    pass
print(ans)

Buggy python submission (verdict: Runtime Error):
N,j = map(int,input().split())
P = list(map(int,input().split()))
count = 0
i = 0
while i < N:
  if P[i] <= P[j]:
    count += 1
print(count)

Fixed submission:
N = int(input())
P = list(map(int,input().split()))
ans = 1
Pj = P[0]
for i in range(1,N):
  Pj = min(Pj,P[i])
  if P[i] <= Pj:
    ans += 1
  else:
    pass
print(ans)
Buggy python submission (verdict: Runtime Error):
N,A,B= map(int,input().split())
count = 0
for A in range(N):
  for B in range(N):
    if A[0:] == B[:-1] and A[:-1] == B[0]:
      count += 1
print(count)

Fixed submission:
N = int(input())
count = [10*[0]for _ in range(10)]
ans = 0
for i in range(1,N+1):
  s = str(i)
  if s[0] == '0' or s[-1] == '0':
    pass
  else:
    count[int(s[0])][int(s[-1])] += 1
for j in range(1,10):
  for k in range(1,10):
    ans += count[j][k]*count[k][j]
print(ans)
Buggy python submission (verdict: Runtime Error):
C = [chr(i) for i in range(ord('a'), ord('z'))]
print(C.sort(C))

Fixed submission:
x=input()
print(chr(ord(x)+1))
Buggy python submission (verdict: Time Limit Exceeded):
def cmb(n,r,mod):
  a=1
  b=1
  r = min(r,n-r)
  for i in range(r):
    a = a*(n-i)%mod
    b = b*(i+1)%mod
  return a*pow(b,mod-2,mod)%mod



N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
mod = 10**9+7
ans = 0
if K == 1:
  print(0)
else:
  for i in range(0,N-K+1):
    ans -= A[i]*cmb(N-i-1,K-1,10**9+7)
  for i in range(K-1,N):
    ans += A[i]*cmb(i,K-1,10**9+7)
  print(ans%mod)

Fixed submission:
# kurimu_usamaro様のメソッドを拝借しています。
class Combi():
    def __init__(self, N, mod):
        self.power = [1 for _ in range(N+1)]
        self.rev = [1 for _ in range(N+1)]
        self.mod = mod
        for i in range(2, N+1):
            self.power[i] = (self.power[i-1]*i) % self.mod
        self.rev[N] = pow(self.power[N], self.mod-2, self.mod)
        for j in range(N, 0, -1):
            self.rev[j-1] = (self.rev[j]*j) % self.mod
 
    def com(self, K, R):
        if K < R:
            return 0
        else:
            return ((self.power[K])*(self.rev[K-R])*(self.rev[R])) % self.mod
 
    def pom(self, K, R):
        if K < R:
            return 0
        else:
            return (self.power[K])*(self.rev[K-R]) % self.mod
 
def main():
  mod = 10**9+7
  N,K = map(int,input().split())
  A = list(map(int,input().split()))
  A.sort()
  c = Combi(N,mod)

  ans = 0
  if K == 1:
    print(0)
  else:
    for i, a in enumerate(A):
      ans += c.com(i, K-1)*a
      ans -= c.com(N-1-i, K-1)*a
      ans %= mod
    print(ans%mod)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def cmb(n,r,mod):
  a=1
  b=1
  r = min(r,n-r)
  for i in range(r):
    a = a*(n-i)%mod
    b = b*(i+1)%mod
  return a*pow(b,mod-2,mod)%mod



N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
mod = 10**9+7
ans = 0
if K == 1:
  print(0)
else:
  for i in range(0,N-K+1):
    ans -= A[i]*cmb(N-i-1,K-1,10**9+7)
  for i in range(K-1,N):
    ans += A[i]*cmb(i,K-1,10**9+7)
  print(ans%mod)

Fixed submission:
# kurimu_usamaro様のメソッドを拝借しています。
class Combi():
    def __init__(self, N, mod):
        self.power = [1 for _ in range(N+1)]
        self.rev = [1 for _ in range(N+1)]
        self.mod = mod
        for i in range(2, N+1):
            self.power[i] = (self.power[i-1]*i) % self.mod
        self.rev[N] = pow(self.power[N], self.mod-2, self.mod)
        for j in range(N, 0, -1):
            self.rev[j-1] = (self.rev[j]*j) % self.mod
 
    def com(self, K, R):
        if K < R:
            return 0
        else:
            return ((self.power[K])*(self.rev[K-R])*(self.rev[R])) % self.mod
 
    def pom(self, K, R):
        if K < R:
            return 0
        else:
            return (self.power[K])*(self.rev[K-R]) % self.mod
 
def main():
  mod = 10**9+7
  N,K = map(int,input().split())
  A = list(map(int,input().split()))
  A.sort()
  c = Combi(N,mod)

  ans = 0
  if K == 1:
    print(0)
  else:
    for i, a in enumerate(A):
      ans += c.com(i, K-1)*a
      ans -= c.com(N-1-i, K-1)*a
      ans %= mod
    print(ans%mod)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
N = int(input().split())
S = str(input().split())
i = 0
count = 0
for i in range(N-2):
  if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
    count += 1
print(count)

Fixed submission:
N = int(input())
S = str(input())
i = 0
count = 0
for i in range(N-2):
  if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
    count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
N = map(int,input().split())
S = str(input().split())
i = 0
count = 0
for i in range(N-1):
  if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
    count += 1
print(count)

Fixed submission:
N = int(input())
S = str(input())
i = 0
count = 0
for i in range(N-2):
  if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
P,Q = list(map(int,input().split()))
import itertools
L = [list(i) for i in itertools.permutations(range(1, N+1), r=N)]
print(abs(L.index(P) - L.index(Q)))

Fixed submission:
N = int(input())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))
import itertools
L = [list(i) for i in itertools.permutations(range(1, N+1), r=N)]
print(abs(L.index(P) - L.index(Q)))

Buggy python submission (verdict: Runtime Error):
import itertools
P,Q = list(map(int,input().split()))
N = int(input())
L = [list(i) for i in itertools.permutations(range(1, N+1), r=N)]
print(abs(L.index(P) - L.index(Q)))

Fixed submission:
N = int(input())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))
import itertools
L = [list(i) for i in itertools.permutations(range(1, N+1), r=N)]
print(abs(L.index(P) - L.index(Q)))
Buggy python submission (verdict: Runtime Error):
S = str,input().split()
T = str,input().split()

print(T + S)

Fixed submission:
S,T = map(str,input().split())
print(T + S)
Buggy python submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
if K <= A:
  print(A-K,B)
elif K > A:
  print(0,A+B-K) 
elif K == A+B
  print(0,0)

Fixed submission:
A,B,K = map(int,input().split())
if K <= A:
  print(A-K,B)
else:
  if K <= A + B:
    print(0, A+B-K)
  else:
    print(0, 0)

Buggy python submission (verdict: Time Limit Exceeded):
A,B,K = map(int,input().split())
i = 0
for i in range(K):
  if A >= 1:
    A -= 1
  elif A < 1 and B >= 1:
    B -= 1
  i += 1
print(A)
print(B)

Fixed submission:
A,B,K = map(int,input().split())
if K <= A:
  print(A-K,B)
else:
  if K <= A + B:
    print(0, A+B-K)
  else:
    print(0, 0)

Buggy python submission (verdict: Time Limit Exceeded):
A,B,K = map(int,input().split())
i = 0
while i < K:
  if A >= 1:
    A -= 1
  elif A < 1 and B >= 1:
    B -= 1
  i += 1
print(A)
print(B)

Fixed submission:
A,B,K = map(int,input().split())
if K <= A:
  print(A-K,B)
else:
  if K <= A + B:
    print(0, A+B-K)
  else:
    print(0, 0)
Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())
def price(n):
  if n == 1:
    return False
  for i in range(2, int(n**0.5)+1):
    if n%i == 0:
      return False
  return True

while 1:
  if price(X):
    print(X)
  else:
    X += 1

Fixed submission:
X = int(input())
def price(n):
  if n == 1:
    return False
  for i in range(2, int(n**0.5)+1):
    if n%i == 0:
      return False
  return True

while(1):
  if price(X):
    print(X)
    break
  else:
    X += 1

Buggy python submission (verdict: Runtime Error):
X = int(input())
from sympy import primerange, sieve
L = list(sieve.primerange(X, 10**5))
print(L[0])

Fixed submission:
X = int(input())
def price(n):
  if n == 1:
    return False
  for i in range(2, int(n**0.5)+1):
    if n%i == 0:
      return False
  return True

while(1):
  if price(X):
    print(X)
    break
  else:
    X += 1

Buggy python submission (verdict: Runtime Error):
X = int(input())
from sympy import sieve
L = [i for i in sieve.primerange(X,10**5)]
print(L[0])

Fixed submission:
X = int(input())
def price(n):
  if n == 1:
    return False
  for i in range(2, int(n**0.5)+1):
    if n%i == 0:
      return False
  return True

while(1):
  if price(X):
    print(X)
    break
  else:
    X += 1

Buggy python submission (verdict: Runtime Error):
X = map(int,input().split())
from sympy import sieve
L = [i for i in sieve.primerange(X,23)]
print(L[0])

Fixed submission:
X = int(input())
def price(n):
  if n == 1:
    return False
  for i in range(2, int(n**0.5)+1):
    if n%i == 0:
      return False
  return True

while(1):
  if price(X):
    print(X)
    break
  else:
    X += 1