Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
# スコアが高い順に右端 or 左端に置く事を考える
# dp[i][l] : l番目まで左に子がいる状態でi番目の子を動かす時の最大値
n = int(input())
tmp = [int(x) for x in input().split()]

aList=[]
for i in range(n):
    aList.append([tmp[i],i])

aList.sort(reverse=True)

dp=[[int(-1) for i in range(n+1)] for j in range(n+1)]
dp[0][0] = 0

# スコアが高い順にi人動かす
for i in range(n):
    # 左側に置いた人数。i番目のループでは0〜i人まで左端に置く可能性がある
    for l in range(i+1):
        activity = aList[i][0]
        pos = aList[i][1]

        # 右端の今のポジション
        # totalで置いた数-左側に置いた数(i-l)を計算し、右端(n-1)から引く
        r = n-1-(i-l)

        # 左に置いた場合
        dp[i+1][l+1] = max(dp[i+1][l+1],dp[i][l] + abs(l-pos) * activity)

        # 右に置いた場合
        dp[i+1][l]   = max(dp[i+1][l],dp[i][l] + abs(r-pos) * activity)

print(max(dp[n]))


Fixed submission:
# スコアが高い順に右端 or 左端に置く事を考える
# dp[i][l] : l番目まで左に子がいる状態でi番目の子を動かす時の最大値
n = int(input())
tmp = [int(x) for x in input().split()]

aList=[]
for i in range(n):
    aList.append([tmp[i],i])

aList.sort(reverse=True)

dp=[[int(-1) for i in range(n+1)] for j in range(n+1)]
dp[0][0] = 0

# スコアが高い順にi人動かす
for i in range(n):
    # 左側に置いた人数。i番目のループでは0〜i人まで左端に置く可能性がある
    for l in range(i+1):
        activity = aList[i][0]
        pos = aList[i][1]

        # 右端の今のポジション
        # totalで置いた数-左側に置いた数(i-l)を計算し、右端(n-1)から引く
        r = n-1-(i-l)

        # 左に置いた場合
        dp[i+1][l+1] = max(dp[i+1][l+1],dp[i][l] + abs(l-pos) * activity)

        # 右に置いた場合
        dp[i+1][l]   = max(dp[i+1][l],dp[i][l] + abs(r-pos) * activity)

print(max(dp[n]))
Buggy python submission (verdict: Runtime Error):
# countBcd[i] : 最大公約数がiとなる数列の個数
# 全てiの倍数である数列の数はint(K/i) ** N ただし、全てi*2,i*3・・・の場合を除く

N, K = [int(x) for x in input().split()]
countBcd = [0]*(K+1)
mod=10**9+7
sumTotal=0
for i in range(K,0,-1):
    countBcd[i] = int(K/i) ** N

    for j in range(i*2,K+1,i):
        countBcd[i] += mod - countBcd[j]
        countBcd[i] %= mod

    sumTotal += i*countBcd[i]
    sumTotal %= mod

print(sumTotal)


Fixed submission:
input_str=input()

if '7' in input_str:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
# countBcd[i] : 最大公約数がiとなる数列の個数
# 全てiの倍数である数列の数はint(K/i) ** N ただし、全てi*2,i*3・・・の場合を除く

N, K = [int(x) for x in input().split()]
countBcd = [0]*(K+1)
mod=10**9+7
sumTotal=0
for i in range(K,0,-1):
    countBcd[i] = int(K/i) ** N

    for j in range(i*2,K+1,i):
        countBcd[i] += mod - countBcd[j]
        countBcd[i] %= mod

    sumTotal += i*countBcd[i]
    sumTotal %= mod

print(sumTotal)


Fixed submission:
# countBcd[i] : 最大公約数がiとなる数列の個数
# 全てiの倍数である数列の数はint(K/i) ** N ただし、全てi*2,i*3・・・の場合を除く

N, K = [int(x) for x in input().split()]
countBcd = [0]*(K+1)
mod=10**9+7
sumTotal=0
for i in range(K,0,-1):
    countBcd[i] = pow(K//i,N,mod)

    for j in range(i*2,K+1,i):
        countBcd[i] -= countBcd[j]

    sumTotal += i*countBcd[i]%mod

print(sumTotal%mod)
Buggy python submission (verdict: Runtime Error):
X,Y,A,B,C = map(int,input().split())
pList = [int(x) for x in input().split()]
qList = [int(x) for x in input().split()]
rList = [int(x) for x in input().split()]

pList.sort(reverse=True)
qList.sort(reverse=True)
rList.sort(reverse=True)

stackX=[]
stackY=[]
stackR=[]

for i in range(X):
    stackX.append(pList[i])

for i in range(Y):
    stackY.append(qList[i])

for i in range(C):
    if len(stackX)==0:
        x = pow(10,9)
    else:
        x = stackX[-1]

    if len(stackY)==0:
        y = pow(10,9)
    else:
        y = stackY[-1]
    r = rList[i]

    if r < x and r < y:
        break
    elif x < y:
        stackX.pop()
        stackR.append(r)
    else:
        stackY.pop()
        stackR.append(r)
print(sum(stackX) + sum(stackY) + sum(stackR))


Fixed submission:
X,Y,A,B,C = map(int,input().split())
pList = [int(x) for x in input().split()]
qList = [int(x) for x in input().split()]
rList = [int(x) for x in input().split()]

pList.sort(reverse=True)
qList.sort(reverse=True)
rList.sort(reverse=True)

stackX=[]
stackY=[]
stackR=[]

for i in range(X):
    stackX.append(pList[i])

for i in range(Y):
    stackY.append(qList[i])

for i in range(C):
    if len(stackX)>0:
        x = stackX[-1]
    else:
        x = pow(10,10)

    if len(stackY)>0:
        y = stackY[-1]
    else:
        y = pow(10,10)

    r = rList[i]

    if r <= x and r <= y:
        break
    elif x < y:
        stackX.pop()
        stackR.append(r)
    else:
        stackY.pop()
        stackR.append(r)
print(sum(stackX) + sum(stackY) + sum(stackR))

Buggy python submission (verdict: Runtime Error):
X,Y,A,B,C = map(int,input().split())
pList = [int(x) for x in input().split()]
qList = [int(x) for x in input().split()]
rList = [int(x) for x in input().split()]

pList.sort(reverse=True)
qList.sort(reverse=True)
rList.sort(reverse=True)

stackX=[]
stackY=[]
stackR=[]

for i in range(X):
    stackX.append(pList[i])

for i in range(Y):
    stackY.append(qList[i])

for i in range(C):
    x = stackX[-1]
    y = stackY[-1]
    r = rList[i]

    if r < x and r < y:
        break
    elif x < y:
        stackX.pop()
        stackR.append(r)
    else:
        stackY.pop()
        stackR.append(r)
print(sum(stackX) + sum(stackY) + sum(stackR))


Fixed submission:
X,Y,A,B,C = map(int,input().split())
pList = [int(x) for x in input().split()]
qList = [int(x) for x in input().split()]
rList = [int(x) for x in input().split()]

pList.sort(reverse=True)
qList.sort(reverse=True)
rList.sort(reverse=True)

stackX=[]
stackY=[]
stackR=[]

for i in range(X):
    stackX.append(pList[i])

for i in range(Y):
    stackY.append(qList[i])

for i in range(C):
    if len(stackX)>0:
        x = stackX[-1]
    else:
        x = pow(10,10)

    if len(stackY)>0:
        y = stackY[-1]
    else:
        y = pow(10,10)

    r = rList[i]

    if r <= x and r <= y:
        break
    elif x < y:
        stackX.pop()
        stackR.append(r)
    else:
        stackY.pop()
        stackR.append(r)
print(sum(stackX) + sum(stackY) + sum(stackR))
Buggy python submission (verdict: Runtime Error):
A,B = map(int, input().split())
ans = []

taxfree = A/0.08
while taxfree*0.08 < A+1:
    if B <= taxfree*0.1 < B+1:
        ans.append(int(taxfree))
        break
    taxfree += 1

taxfree = B/0.1
while taxfree*0.1 < B+1:
    if B <= taxfree*0.08 < A+1:
        ans.append(int(taxfree))
        break
    taxfree += 1

if len(ans) != 0:
    print(min(ans))
else:
    print(-1)

Fixed submission:
S = input()

if all(i == "A" for i in S) or all(i == "B" for i in S):
    print("No")
else:
    print("Yes")

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

if all(S == "A") or all(S == "B"):
    print("No")
else:
    print("Yes")

Fixed submission:
S = input()

if all(i == "A" for i in S) or all(i == "B" for i in S):
    print("No")
else:
    print("Yes")

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

if all(S == "A") or all(S == "B"):
    print("No")
else:
    print("Yes")

Fixed submission:
S = input()

if all(i == "A" for i in S) or all(i == "B" for i in S):
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
N,R = map(int, input().split())

if N < 10:
    print(R)
else:
    print(100*(10-K))

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

if N >= 10:
    print(R)
else:
    print((100*(10-N))+R)
Buggy python submission (verdict: Runtime Error):
count = 0
N = int(input())
S = input()

for i in range(N):
    if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
        count += 1

print(count)

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

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):
A = [map(int, input().split())]
print("win" if sum(A) < 22 else "bust")

Fixed submission:
A = list(map(int, input().split()))
print("win" if sum(A) < 22 else "bust")

Buggy python submission (verdict: Runtime Error):
A = [map(int, input().split())]
print("win" if sum(A) >= 22 else "bust")

Fixed submission:
A = list(map(int, input().split()))
print("win" if sum(A) < 22 else "bust")
Buggy python submission (verdict: Time Limit Exceeded):
K,S = map(int, input().split())
ans = 0

for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if S == x+y+z:
                ans += 1
                break

print(ans)

Fixed submission:
K,S = map(int, input().split())
ans = 0

for x in range(K+1):
    for y in range(K+1):
        if 0 <= S-x-y <= K:
            ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
K,S = map(int, input().split())
ans = 0

for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if S == x+y+z:
                ans += 1

print(ans)

Fixed submission:
K,S = map(int, input().split())
ans = 0

for x in range(K+1):
    for y in range(K+1):
        if 0 <= S-x-y <= K:
            ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
N = input()
n = [int(c) for c in s]
for ni in n:
  if ni == 7:
    print("Yes")
    exit()
print("No")
    

Fixed submission:
N = input()
n = [int(c) for c in N]
for ni in n:
  if ni == 7:
    print("Yes")
    exit()
print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

d = {}

for i in range(N - 1):
    if A[i] in d:
        d[A[i]].append(i + 2)
    else:
        d[A[i]] = [i + 2]

for i in range(1, N + 1):
    if i in d:
        print(len(d[i]))
    else:
        print(0)

Fixed submission:
num = int(input())
print(3.14 * 2 * num)

Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a = list(map(int, input().split()))
b = np.zeros(n)
for i in range(1,n):
    b[i-1] = a.count(i)
for i in b:
    print(int(i))

Fixed submission:
num = int(input())
print(3.14 * 2 * num)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
a = list(map(int, input().split()))
b = np.zeros(n)
for i in range(1,n):
    b[i-1] = a.count(i)
    print(int(b[i-1]))
print(int(b[n-1]))


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

d = {}

for i in range(N - 1):
    if A[i] in d:
        d[A[i]].append(i + 2)
    else:
        d[A[i]] = [i + 2]

for i in range(1, N + 1):
    if i in d:
        print(len(d[i]))
    else:
        print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
a = list(map(int, input().split()))
b = np.zeros(n)
for i in range(1,n):
    b[i-1] = a.count(i)
for i in b:
    print(int(i))

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

d = {}

for i in range(N - 1):
    if A[i] in d:
        d[A[i]].append(i + 2)
    else:
        d[A[i]] = [i + 2]

for i in range(1, N + 1):
    if i in d:
        print(len(d[i]))
    else:
        print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
line = []
for i in range(1,n):
    line.append(a.count(i))
line.append(0)
for i in range(len(line)):
    print(int(line[i]))


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

d = {}

for i in range(N - 1):
    if A[i] in d:
        d[A[i]].append(i + 2)
    else:
        d[A[i]] = [i + 2]

for i in range(1, N + 1):
    if i in d:
        print(len(d[i]))
    else:
        print(0)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
a = list(map(int, input().split()))
b = np.zeros(n-1)
for i in range(1,n):
    b[i-1] = a.count(i)
b = np.append(b,0)
for i in b:
    print(int(i))

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

d = {}

for i in range(N - 1):
    if A[i] in d:
        d[A[i]].append(i + 2)
    else:
        d[A[i]] = [i + 2]

for i in range(1, N + 1):
    if i in d:
        print(len(d[i]))
    else:
        print(0)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = sorted(list(map(int,input().split())) reverse=True)
print(sum(a[::2]) - sum(a[1::2]))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a_min = min(a)
alice = 0
bob = 0
while max(a) != 0:
    alice += max(a)
    for i in range(len(a)):
        if a[i] == max(a):
            a[i] = 0
            break
    bob += max(a)
    for i in range(len(a)):
        if a[i] == max(a):
            a[i] = 0
            break
if alice > bob:
    print(alice-bob)
else:
    print(bob-alice)
Buggy python submission (verdict: Runtime Error):
num = line(map(int,input().split()))
count = 0
for i in range(3):
    if num[i] == 1:
        count += 1
print(count)

Fixed submission:
num = input()
count = 0
for i in range(3):
    if num[i] == '1':
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
num = int(input())
line = list(map(int,input().split()))
count = True
count_num = 0
while count:
    for i in range(num):
        if line[i] % 2 != 0:
            count = False
    if count:
        for i in range(num):
            line[i] /= 2
     count_num += 1     
print(count_num)

Fixed submission:
num = int(input())
line = list(map(int,input().split()))
count = True
count_num = 0
while count:
    for i in range(num):
        if line[i] % 2 != 0:
            count = False
    if count:
        for i in range(num):
            line[i] /= 2
    count_num += 1
print(count_num-1)
Buggy python submission (verdict: Runtime Error):
s = input().replace("eraser","").replace("erase"."").replace("dreamer"."").replace("dream","")
if s:
    print("NO")
else:
    print("YES")

Fixed submission:
s = input().replace("eraser","").replace("erase","").replace("dreamer","").replace("dream","")
if s:
    print('NO')
else:
    print('YES')
Buggy python submission (verdict: Runtime Error):
        n = int(input())
        a = list(map(int, input().split()))
        from collections import Counter
        x=Counter(a)
        for i in range(1,n+1):
          print(x[i])

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
from collections import Counter
x=Counter(a)
for i in range(1,n+1):
  print(x[i])

Buggy python submission (verdict: Runtime Error):
        n = int(input())
        a = list(map(int, input().split()))
        from collections import Counter
        x=Counter(a)
        for i in range(1,n+1):
          print(x[i])

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
from collections import Counter
x=Counter(a)
for i in range(1,n+1):
  print(x[i])

Buggy python submission (verdict: Runtime Error):
    n = int(input())
    a = list(map(int, input().split()))
    import Counter
    x=Counter(a)
    for i in range(1,n+1):
      print(x[i])

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
from collections import Counter
x=Counter(a)
for i in range(1,n+1):
  print(x[i])

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
import Counter
x=Counter(a)
for i in range(1,n+1):
  print(a[x])

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
from collections import Counter
x=Counter(a)
for i in range(1,n+1):
  print(x[i])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
for i in range(1,n+1):
    print(a.count(i))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
from collections import Counter
x=Counter(a)
for i in range(1,n+1):
  print(x[i])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    print(a.count(i+1))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
from collections import Counter
x=Counter(a)
for i in range(1,n+1):
  print(x[i])
Buggy python submission (verdict: Runtime Error):

N, M = map(int, input().split()) 
A = list(map(int, input().split()))
for i in range (M)
	N = N -A[i]
if N>=0
	print (N)
else
	print (-1)

Fixed submission:
N, M = map(int, input().split()) 
A = list(map(int, input().split()))
for i in range (M):
	N = N -A[i]
if N>=0:
	print (N)
else:
	print (-1)
Buggy python submission (verdict: Runtime Error):
s,t = input().split
ans = t + s
print(ans)


Fixed submission:
s,t = input().split()
ans = t + s
print(ans)

Buggy python submission (verdict: Runtime Error):
s,t = input().split
print(s + t)

Fixed submission:
s,t = input().split()
ans = t + s
print(ans)
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
array = (1,2,3)
array.remove(A,B)
print (array)

Fixed submission:
a = int(input())
b = int(input())
print (6 - a - b)

Buggy python submission (verdict: Runtime Error):
def Amondai(A, B):
	newArray = {1, 2, 3}
    newArray.clear(A)
    newArray.clear(B)
    retern newArray

Fixed submission:
a = int(input())
b = int(input())
print (6 - a - b)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s,t = input().split()
new = ''
for i in range(0, n):
	new += s[i]
  	new += t[i]
print (new)

Fixed submission:
n = int(input())
s,t = input().split()
new = ''
for i in range(n):
  new += s[i]
  new += t[i]
print (new)

Buggy python submission (verdict: Runtime Error):
n = int(input())
str_s, str_t = input().split()
new = ''
for i in range(0, n)
	new += str_s[i]
  	new += str_t[i]
print (new)


Fixed submission:
n = int(input())
s,t = input().split()
new = ''
for i in range(n):
  new += s[i]
  new += t[i]
print (new)

Buggy python submission (verdict: Runtime Error):
n = int(input())
str_s, str_t = input.split
new = ''
for i in range(0, n)
	new += str_s[i]
  	new += str_t[i]
print (new)

Fixed submission:
n = int(input())
s,t = input().split()
new = ''
for i in range(n):
  new += s[i]
  new += t[i]
print (new)

Buggy python submission (verdict: Runtime Error):
n = int(input())
strs, strt = [s for s in range(n)]
new = ''
for i in range(0, n)
	new += strs[i]
  	new += strt[i]
print (new)

Fixed submission:
n = int(input())
s,t = input().split()
new = ''
for i in range(n):
  new += s[i]
  new += t[i]
print (new)

Buggy python submission (verdict: Runtime Error):
n, strs, strt = [s for s in input().split()]
new = []
for i in range(0, n)
	new.append(strs[i])
  	new.append(strt[i])
print (new)

Fixed submission:
n = int(input())
s,t = input().split()
new = ''
for i in range(n):
  new += s[i]
  new += t[i]
print (new)
Buggy python submission (verdict: Runtime Error):
# N,Aを入力
N = int(input)
A = int(input)
if (N % 500) > A:# Nを500で割った余りがAより大きいとき
  	print('No')
else: # Nを500で割った余りがAと等しいまたはAより小さいとき
  	print('Yes')
  

Fixed submission:
N = int(input())
A = int(input())
if (N % 500) > A:
  print('No')
else:
  print('Yes')

Buggy python submission (verdict: Runtime Error):
# n,aを入力
n, a = map(int, input().split())
# nを500で割った余りを計算
if n % 500 == 0:
    print('Yes')
elif (n % 500) == a:
    print('yes')
else:
    print('No')
    


Fixed submission:
N = int(input())
A = int(input())
if (N % 500) > A:
  print('No')
else:
  print('Yes')

Buggy python submission (verdict: Runtime Error):
# n,aを入力
n, a = map(int, input().split())
# nを500で割り余りを計算
if n % 500 == 0: # nが500の倍数
	print('Yes')
elif (n % 500) == a: # nを500で割った余りがaと等しい
 	print('yes')
else:
  	print('No')


Fixed submission:
N = int(input())
A = int(input())
if (N % 500) > A:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

syain = []

for i in range(N):
    print(A.count(i+1))

Fixed submission:
import math
R = int(input())
print(2 * R * math.pi)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 正の整数の入力
a = int(input())
b = int(input())

if a*b % 2 == 1:
    ans = 'Even'
else:
    ans = 'Odd'

print("{}".format(ans))

Fixed submission:
# -*- coding: utf-8 -*-
# 正の整数の入力
a, b = map(int, input().split())

if a*b % 2 == 0:
    ans = 'Even'
else:
    ans = 'Odd'

print("{}".format(ans))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 正の整数の入力
a = int(input())
b = int(input())

if a*b % 2 == 1:
    ans = 'Even'
else:
    ans = 'Odd'

print(str(ans))

Fixed submission:
# -*- coding: utf-8 -*-
# 正の整数の入力
a, b = map(int, input().split())

if a*b % 2 == 0:
    ans = 'Even'
else:
    ans = 'Odd'

print("{}".format(ans))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 正の整数の入力
a = int(input())
b = int(input())

if a*b % 2 == 1:
    ans = 'Even'
else:
    ans = 'Odd'

print(ans)

Fixed submission:
# -*- coding: utf-8 -*-
# 正の整数の入力
a, b = map(int, input().split())

if a*b % 2 == 0:
    ans = 'Even'
else:
    ans = 'Odd'

print("{}".format(ans))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 正の整数の入力
a = int(input())
b = int(input())

if a*b % 2 == 1:
    ans = 'Even'
else:
    ans = 'Odd'

print(ans)

Fixed submission:
# -*- coding: utf-8 -*-
# 正の整数の入力
a, b = map(int, input().split())

if a*b % 2 == 0:
    ans = 'Even'
else:
    ans = 'Odd'

print("{}".format(ans))
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math

# 正の整数の入力
a = int(input())
b = int(input())

ab = int(str(a) + str(b))

if ab / math.sqrt(ab) == math.sqrt(ab):
    ans = 'Yes'
else:
    ans = 'No'

print(ans)

Fixed submission:
import math

a, b = map(int, input().split())

ab = int(str(a) + str(b)) 
root = math.sqrt(ab)

#print(ab)

#print(math.sqrt(ab))

#print(isinstance(root, float))
#print('1')
if isinstance(root, int) == True:
    ans = 'Yes' 
    #print('2')
elif isinstance(root, float) == True:
    #print('3')
    #print('float')
    #print(root.is_integer())
    if root.is_integer() == True:
        #print('4')
        ans = 'Yes' 
    #print(root.is_integer())
    else:
        ans = 'No'
        #print('5')

print(ans)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = list(map(int,input().split()))
for i in a:
    n -= i
    if n<0:
        print(-1)
        exit()
print(n)

Fixed submission:
R = int(input())

a = 2*3.1426*R

print(a)
Buggy python submission (verdict: Runtime Error):
import math

k = int(imput())
n = 0

for i in range(1,k+1)
    for j in range(1,k+1)
        a=math.gcd(i,j)
        for l in range(1,k+1)
            b=math.gcd(a,l)
            n += b

print(n)

Fixed submission:
import math

k = int(input())
n = 0

for i in range(1,k+1):
    for j in range(1,k+1):
        a = math.gcd(i,j)
        for l in range(1,k+1):
            b = math.gcd(a,l)
            n += b

print(n)
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
initial_length = len(S)

if initial_length == 1:
    print("0")
else:
    len_S = 0
    while len_S != len(S):
        len_S = len(S)
        S = S.replace("10", "")
        S = S.replace("01", "")
    print(initial_length - len(S))

Fixed submission:
S = input()
nof_0 = S.count("0")
nof_1 = S.count("1")
print(min(nof_0, nof_1) * 2)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N, M = map(int, input().split())
X = list(map(int, input().split()))

if M <= N:
    print(0)
else:
    X.sort()
    # print("X =", X)
    dX = np.diff(X)
    # print("dX =", dX)
    dX.sort()
    print(sum(dX[:M-N]))

f.close()

Fixed submission:
import numpy as np
N, M = map(int, input().split())
X = list(map(int, input().split()))

if M <= N:
    print(0)
else:
    X.sort()
    # print("X =", X)
    dX = np.diff(X)
    # print("dX =", dX)
    dX.sort()
    print(sum(dX[:M-N]))

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

if M <= N:
    print(0)
else:
    X.sort()
    dX = np.diff(X)
    dX.sort()
    print(sum(dX[:N+1]))

Fixed submission:
import numpy as np
N, M = map(int, input().split())
X = list(map(int, input().split()))

if M <= N:
    print(0)
else:
    X.sort()
    # print("X =", X)
    dX = np.diff(X)
    # print("dX =", dX)
    dX.sort()
    print(sum(dX[:M-N]))
Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split()))
println((A[0]*A[1])//2)

Fixed submission:
A = list(map(int, input().split()))
print((A[0]*A[1])//2)