Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int,input().split())
a = list()
a = ["b"]*A + ["r"]*B
import math
n = math.ceil(N//(A+B))
for i in range(n):
    a = a + a
del a[N:]
print(n)
print(a)
print(a.count("b"))


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

import math
n = math.ceil(N//(A+B))
mod = N % (A+B)
b = n*A
if mod <= A:
    b += mod
else:
    b += A

print(b)

Buggy python submission (verdict: Runtime Error):
N, A, B = map(int,input().split())
a = list()
a = ["blue"]*A + ["red"]*B
import math
n = math.ceil(N/(A+B))
for i in range(n):
    a = a + a
del a[N:]
print(a.count("blue"))


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

import math
n = math.ceil(N//(A+B))
mod = N % (A+B)
b = n*A
if mod <= A:
    b += mod
else:
    b += A

print(b)

Buggy python submission (verdict: Runtime Error):
N, A, B = map(int,input().split())
a = list()
a = ["blue"]*A + ["red"]*B
for i in range(N):
    a = a + a
del a[N:]
print(a.count("blue"))

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

import math
n = math.ceil(N//(A+B))
mod = N % (A+B)
b = n*A
if mod <= A:
    b += mod
else:
    b += A

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

big = max(a,b,c)
total = a + b + c
if total = big*2:
    print("Yes")
else:
    print("No")


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

big = max(a,b,c)
total = a + b + c
if total == big*2:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N, K = map(int,input())
cnt = K*(K-1)**(N-1)
print(cnt)

Fixed submission:
N, K = map(int,input().split())
cnt = K*(K-1)**(N-1)
print(cnt)
Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
h=list(map(int,input().split()))
li=[0]*n
 
for i in range(m):
        a,b=map(int, input().split())
        if h[a-1]>h[b-1]:
                li[b-1]+=1
        elif h[b-1]>h[a-1]:
                li[a-1]+=1
        else:
          		li[a-1]+=1
            	li[b-1]+=1
 
cnt=0
for i in range(n):
        if li[i]==0:
                cnt+=1

Fixed submission:
n,m = map(int, input().split())
h=list(map(int,input().split()))
li=[0]*n
 
for i in range(m):
        a,b=map(int, input().split())
        if h[a-1]>h[b-1]:
                li[b-1]+=1
        elif h[b-1]>h[a-1]:
                li[a-1]+=1
        else:
                li[a-1]+=1
                li[b-1]+=1

 
cnt=0
for i in range(n):
        if li[i]==0:
                cnt+=1

print(cnt)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
li = [list(map(int, input().split())) for i in range(m)]

a=li[0][0]
b=li[0][1]
for i in range(m-1):
  if li[i+1][0]>a:
    a=li[i+1][0]
  if li[i+1][1]<b:
    b=li[i+1][1]

if b<a:
  print(int(0))
  break
  
if b-a+1<n:
  print(b-a+1)
else:
  print(n)

Fixed submission:
n,m=map(int,input().split())
li = [list(map(int, input().split())) for i in range(m)]
 
a=li[0][0]
b=li[0][1]
for i in range(m-1):
  if li[i+1][0]>a:
    a=li[i+1][0]
  if li[i+1][1]<b:
    b=li[i+1][1]
 
if b<a:
  print(int(0))
  exit()
  
if b-a+1<n:
  print(b-a+1)
else:
  print(n)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input()) 
s=list(input())

ans=2000000
cnt=0
for i in range(n):
  for j in range(n-i):
    if s[i+j]==".":
      cnt+=1
  for k in range(i):
    if s[k]=="#":
      cnt+=1
  if cnt<=ans:
    ans=cnt
  cnt=0

for i in range(n):
  if s[i]==".":
    cnt+=1
  else:
    cnt-=1

if abs(cnt)==len(s):
  ans=0

print(ans)


Fixed submission:
n=int(input()) 
s=list(input())

dp=[0]*(n+1)
for i in range(n):
  if s[i]=="#":
    dp[0]+=1

for i in range(n):
  if s[n-i-1]=="#":
    dp[i+1]=dp[i]-1
  else:
    dp[i+1]=dp[i]+1

print(min(dp))
Buggy python submission (verdict: Time Limit Exceeded):
n,q=map(int,input().split())
s=input()
listA=[] 
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
        
l = list(s)
li=[0]*n

for i in range(n-1):
  if l[i]=="A" and l[i+1]=="C":
    li[i]+=1
    
#print(li)   
 
    
ans=0
for j in range(q):
  a=listA[j][0]-1
  b=listA[j][1]-1
  #print(a,b)
  for k in range(a,b):
    if li[k]==1:
      ans+=1
  print(ans)
  ans=0



Fixed submission:
N, Q = map(int, input().split())
S = input()
t=[0]*(N+1)
for i in range(N):
  t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
for i in range(Q):
  l, r = map(int, input().split())
  print(t[r-1] - t[l-1])
Buggy python submission (verdict: Runtime Error):
t,a=map(int,input().split())
li = list(map(int,input().split()))

listT=[0]*n
for i in range(n):
  listT[i]=t-0.006*li[i]
#print(listT)
min=abs(listT[0]-a)
#print(listT[0]-a)
#print(min)
ans=1
for i in range(n):
  if min>abs(a-listT[i]):
    min=abs(listT[i])
    ans=i+1

print(ans)

Fixed submission:
n=int(input())
t,a=map(int,input().split())
li = list(map(int,input().split()))

listT=[0]*n
for i in range(n):
  listT[i]=t-0.006*li[i]
#print(listT)
min=abs(listT[0]-a)
#print(listT[0]-a)
#print(min)
ans=1
for i in range(n):
  if min>abs(a-listT[i]):
    min=abs(a-listT[i])
    ans=i+1

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

distance = []

for i in range(N-1):
    dis = A[i + 1] - A[i]
    # if i == N - 1:
    #     dis = A[i] - A[1]
    distance.append(dis)

dis = K - A[N - 1] + A[0]
distance.append(dis)

# print(distance)
# print(max(distance))
# print(distance.index(max(distance)))

sum = 0

count = int(len(distance))

for i in range(count):
    if i != distance.index(max(distance)):
        sum += distance[i]

print(sum)

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

distance = []

for i in range(N-1):
    dis = A[i + 1] - A[i]
    distance.append(dis)

dis = K - A[N - 1] + A[0]
distance.append(dis)

index = distance.index(max(distance))

print(K - distance[index])
Buggy python submission (verdict: Runtime Error):
n, y = map(int,input().split())
y = y / 1000
for i in range(n+1):
    for j in range(n-i+1):
        if 10 * i + 5 * j + 1 * (n - i - j) == y:
            print(i)
            print(j)
            print(n - i - j)
            exit(1)
print(-1)
print(-1)
print(-1)

Fixed submission:
n, y = map(int,input().split())
y = y / 1000
f = 0
for i in range(n+1):
    for j in range(n-i+1):
        #print(i)
        if 10 * i + 5 * j + 1 * (n - i - j) == y:
            print(i)
            print(j)
            print(n - i - j)
            f = 1
            break
    if f == 1:
        break
if f != 1:
    print(-1)
    print(-1)
    print(-1)

Buggy python submission (verdict: Runtime Error):
n, y = map(int,input().split())
for i in range(n+1):
    for j in range(n-i+1):
        if 10000 * i + 5000 * j + 1000 * (n - i - j) == y:
            print(i)
            print(j)
            print(n - i - j)
            exit(1)
print(-1)
print(-1)
print(-1)

Fixed submission:
n, y = map(int,input().split())
y = y / 1000
f = 0
for i in range(n+1):
    for j in range(n-i+1):
        #print(i)
        if 10 * i + 5 * j + 1 * (n - i - j) == y:
            print(i)
            print(j)
            print(n - i - j)
            f = 1
            break
    if f == 1:
        break
if f != 1:
    print(-1)
    print(-1)
    print(-1)
Buggy python submission (verdict: Runtime Error):
A,B,C,K=map(int,input().split())

if K<=A:
    ans=K
elif k<=A+B:
    ans=A
else:
    ans=2*A-K

print(ans)

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

if K<A:
    ans=K
elif A<=K and K<=A+B:
    ans=A
else:
    ans=2*A+B-K

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

A,B,C,D=map(int,input().split())
num=B-A
numC=num//C
numD=num//D
numCD=int(num//(C*D/math.gcd(C,D)))
ans=num-numC-numD+numCD
print(ans)

Fixed submission:
import fractions

def div(a,b,c):
    val=b//c-(a-1)//c
    return val

A,B,C,D=map(int,input().split())
numC=div(A,B,C)
numD=div(A,B,D)
lcm=int(C*D/(fractions.gcd(C,D)))
numCD=div(A,B,lcm)
ans=B-A+1-numC-numD+numCD
print(ans)
Buggy python submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=[int(a) for a in input().split()]

temp=0
cnt=0
for i in range(N+1):
    if temp>X:
        break
    else:
        temp+=L[i]
        cnt+=1
   
print(cnt)

Fixed submission:
N,X=map(int,input().split())
L=[int(a) for a in input().split()]

d=0
cnt=0
for i in range(N+1):
    if d>X:
        break
    elif i==N:
        cnt+=1
    else:
        d+=L[i]#next
        cnt+=1
   
print(cnt)
Buggy python submission (verdict: Runtime Error):
w,h,x,y=map(int,input().split())

if w/x==2 and h/y==2:
    print(w*h/2,'1')
else:
    print(w*h/2,'0')

Fixed submission:
w,h,x,y=map(int,input().split())

if x==0 or y==0:
    print(w*h/2,'0')
elif w/x==2 and h/y==2:
    print(w*h/2,'1')
else:
    print(w*h/2,'0')
Buggy python submission (verdict: Runtime Error):
N=int(input())
x=['']*N
y=['']*N
dic={}
for i in range(N):
    x[i],y[i]=map(int,input().split())

for i in range(N):
    for j in range(N):
        if i==j:
            pass
        else:
            p=y[j]-y[i]
            q=x[j]-x[i]
            if (p,q) in dic.keys():
                dic[(p,q)] += 1
            else:
                dic[(p,q)] = 1

print(N-max(dic.values()))

Fixed submission:
N=int(input())
x=['']*N
y=['']*N
dic={(0,0):0}
for i in range(N):
    x[i],y[i]=map(int,input().split())

for i in range(N):
    for j in range(N):
        if i==j:
            continue
        else:
            p=y[j]-y[i]
            q=x[j]-x[i]
            if (p,q) in dic.keys():
                dic[(p,q)] += 1
            else:
                dic[(p,q)] = 1

print(N-max(dic.values()))
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
a=[int(input()) for i in range(M)]
dp=[0]*(N+1)
dp[0]=1
dp[1]=0 if 1 in a else 1
mod=10**9+7

for i in range(2,N+1):
    if i in a:
        continue
    else:
        dp[i]=(dp[i-1]+dp[i-2])%mod

print(dp[N])

Fixed submission:
N,M=map(int,input().split())
dp=[0]*(N+3)
dp[0]=1
a=[0]*(N+3)
for i in range(M):
    a[int(input())]=1
mod=10**9+7

for i in range(N+1):
    if a[i+1] != 1:
        dp[i+1]+=dp[i]
        dp[i+1]%=mod
    if a[i+2] != 1:
        dp[i+2]+=dp[i]
        dp[i+2]%=mod

print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
a=[int(input()) for i in range(M)]
dp=[1]*(N+1)
dp[0]=1
dp[1]=1

for i in range(1,N+1):
    if i in a:
        dp[i]=0
    elif i==1:
        pass
    else:
        dp[i]=(dp[i-1]+dp[i-2])%1000000007

print(dp[N])

Fixed submission:
N,M=map(int,input().split())
dp=[0]*(N+3)
dp[0]=1
a=[0]*(N+3)
for i in range(M):
    a[int(input())]=1
mod=10**9+7

for i in range(N+1):
    if a[i+1] != 1:
        dp[i+1]+=dp[i]
        dp[i+1]%=mod
    if a[i+2] != 1:
        dp[i+2]+=dp[i]
        dp[i+2]%=mod

print(dp[N])

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

N,M=map(int,input().split())
a=[-1]+[int(input()) for i in range(M)]+[N+1]
ans=1

for i in range(M+1):
    dist=a[i+1]-a[i]-2
    if dist<0 and a[i]!=-1 and a[i+1]!=N+1:
        ans=0
        break
    
    val=0
    cnt1=dist%2
    cnt2=dist//2
    while cnt2 >= 0:
        val+=math.factorial(cnt1+cnt2)/math.factorial(cnt1)/math.factorial(cnt2)
        cnt2-=1
        cnt1+=2
    ans*=val

    while ans>1000000007:
        ans-=1000000007

print(int(ans))

Fixed submission:
N,M=map(int,input().split())
dp=[0]*(N+3)
dp[0]=1
a=[0]*(N+3)
for i in range(M):
    a[int(input())]=1
mod=10**9+7

for i in range(N+1):
    if a[i+1] != 1:
        dp[i+1]+=dp[i]
        dp[i+1]%=mod
    if a[i+2] != 1:
        dp[i+2]+=dp[i]
        dp[i+2]%=mod

print(dp[N])

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

N,M=map(int,input().split())
a=[-1]+[int(input()) for i in range(M)]+[N+1]
ans=1

for i in range(M+1):
    dist=a[i+1]-a[i]-2
    if dist<0 and a[i]!=-1 and a[i+1]!=N+1:
        ans=0
        break
    
    val=0
    cnt1=dist%2
    cnt2=dist//2
    while cnt2 >= 0:
        val+=math.factorial(cnt1+cnt2)/math.factorial(cnt1)/math.factorial(cnt2)
        cnt2-=1
        cnt1+=2
    ans*=val
    print(dist,val)

print(ans%1000000007)

Fixed submission:
N,M=map(int,input().split())
dp=[0]*(N+3)
dp[0]=1
a=[0]*(N+3)
for i in range(M):
    a[int(input())]=1
mod=10**9+7

for i in range(N+1):
    if a[i+1] != 1:
        dp[i+1]+=dp[i]
        dp[i+1]%=mod
    if a[i+2] != 1:
        dp[i+2]+=dp[i]
        dp[i+2]%=mod

print(dp[N])
Buggy python submission (verdict: Runtime Error):
A,P=map(int,input().split())

print((3A+P)//2)

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

print((3*A+P)//2)
Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N=map(int,input().split())
counter=0

for r in range(N+1):
    for g in range(N+1):
        b=(N-r*R-g*G)/B
        if b.is_integer() and b>=0:
            counter += 1

print(counter)


Fixed submission:
R,G,B,N=map(int,input().split())
counter=0
 
for r in range(N//R+1):
    for g in range((N-r*R)//G+1):
        b=(N-r*R-g*G)/B
        if b.is_integer() and b>=0:
            counter += 1
 
print(counter)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []
A = list (map(int, input().strip().split(' ')))

i = 0
while i < N:
    j = 0
    while j < N:
        if i + 1 == A[j]:
            print(j + 1, end = ' ')
            break
        j += 1
    i += 1

Fixed submission:
N = int(input())
A = []
A = list (map(int, input().strip().split(' ')))
B = [0 for i in range(N)]

i = 0
while i < N:
    B[A[i] - 1] = i + 1
    i += 1
    
for i in B:
    print(i, end = ' ')
Buggy python submission (verdict: Runtime Error):
N, L=map(int, input().split())
if L>0:
    A=(N-1)*L+N*(N-1)/2
elif N+L<=0:
    A=(N-1)*L+(N-1)*(N-2)/2
else:
    A=(L*2+N-1)*N/2
print(int(A))

Fixed submission:
S=int(input())
a=int(S/1000)
b=int((S-a*1000)/100)
c=int((S-a*1000-b*100)/10)
d=int(S-a*1000-b*100-c*10)
if a==b or b==c or c==d:
    print('Bad')
else:
    print('Good')
Buggy python submission (verdict: Runtime Error):
A, B=map(int, input().split()
S=(A-1)*(B-1)
print(S)
         

Fixed submission:
A, B=map(int, input().split())
S=(A-1)*(B-1)
print(S)
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin, stdout
def main():
    N=int(stdin.readline())
    S=stdin.readline().rstrip()
    R, G, B = [], [], []
    for i, c in enumerate(S):
        if c == 'R':
            R.append(i)
        elif c == 'G':
            G.append(i)
        else:
            B.append(i)
    cnt = 0
    for ri in R:
        for gi in G:
            for bi in B:
                if abs(gi-ri) != abs(bi-gi) and abs(ri-bi) != abs(bi-gi) and abs(ri-bi) != abs(ri-gi):
                    cnt+=1

    stdout.write(str(cnt)+"\n")

main()


Fixed submission:
from sys import stdin, stdout
def main():
    N=int(stdin.readline())
    S=stdin.readline().rstrip()
    R, G, B = set(), set(), set()
    for i, c in enumerate(S):
        if c == 'R':
            R.add(i)
        elif c == 'G':
            G.add(i)
        else:
            B.add(i)
    cnt, total = 0, len(R) * len(G) * len(B)
    for ri in R:
        for gi in G:
            if abs(ri-gi)+gi in B:
                cnt += 1
            if abs(ri-gi)+ri in B:
                cnt += 1
    for ri in G:
        for gi in B:
            if abs(ri-gi)+gi in R:
                cnt += 1
            if abs(ri-gi)+ri in R:
                cnt += 1
    for ri in R:
        for gi in B:
            if abs(ri-gi)+gi in G:
                cnt += 1
            if abs(ri-gi)+ri in G:
                cnt += 1

    stdout.write(str(total-cnt)+"\n")

main()

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin, stdout
def main():
    N=int(stdin.readline())
    S=stdin.readline().rstrip()
    R, G, B = [], [], []
    for i, c in enumerate(S):
        if c == 'R':
            R.append(i)
        elif c == 'G':
            G.append(i)
        else:
            B.append(i)
    cnt = 0
    R.sort()
    G.sort()
    B.sort()
    seen=set()
    for ri in R:
        for gi in G:
            for bi in B:
                if abs(gi-ri) != abs(bi-gi) and abs(ri-bi) != abs(bi-gi) and abs(ri-bi) != abs(ri-gi):
                    cnt+=1

    stdout.write(str(cnt)+"\n")

main()


Fixed submission:
from sys import stdin, stdout
def main():
    N=int(stdin.readline())
    S=stdin.readline().rstrip()
    R, G, B = set(), set(), set()
    for i, c in enumerate(S):
        if c == 'R':
            R.add(i)
        elif c == 'G':
            G.add(i)
        else:
            B.add(i)
    cnt, total = 0, len(R) * len(G) * len(B)
    for ri in R:
        for gi in G:
            if abs(ri-gi)+gi in B:
                cnt += 1
            if abs(ri-gi)+ri in B:
                cnt += 1
    for ri in G:
        for gi in B:
            if abs(ri-gi)+gi in R:
                cnt += 1
            if abs(ri-gi)+ri in R:
                cnt += 1
    for ri in R:
        for gi in B:
            if abs(ri-gi)+gi in G:
                cnt += 1
            if abs(ri-gi)+ri in G:
                cnt += 1

    stdout.write(str(total-cnt)+"\n")

main()
Buggy python submission (verdict: Runtime Error):
from sys import stdin, stdout
def main():
    N = int(stdin.readline())
    A = list(map(int, stdin.readline().rstrip().split()))
    dp = [0] * N
    dp[1] = max(A[0], A[1])
    dp[2] = max(dp[1], A[2])
    for i in range(3, N):
        if i & 1 == 0:
            dp[i] = max(dp[i-1], A[i] + dp[i-2])
        else:
            dp[i] = A[i] + dp[i-2]
    ret=dp[N-1]
    stdout.write(str(ret)+"\n")
main()


Fixed submission:
from sys import stdin, stdout
def main():
    N = int(stdin.readline())
    A = [0] + list(map(int, stdin.readline().rstrip().split()))
    dp = [0] * (N+1)
    prefix = [0] * (N+1)
    dp[1], prefix[1] = 0, A[1]
    for i in range(3, N, 2):
        prefix[i] = prefix[i-2]+A[i]
    for i in range(2, N+1):
        if i & 1:
            dp[i] = max(dp[i-1], A[i] + dp[i-2])
        else:
            dp[i] = max(dp[i-2] + A[i], prefix[i-1])
    
    stdout.write(str(dp[N])+"\n")
main()
Buggy python submission (verdict: Runtime Error):
def main(): # A162
    N = int(input())
    NUM = list(str(N))
    NUM = list(map(int,NUM))
    #A = list(map(int, input().split()))  # [1,2,3,4,5]
    for i in NUM:
        if int(i) == 7:
            print("Yes")
            exit(1)
    print("No")
    
main()

Fixed submission:
def main(): # A162
    N = int(input())
    NUM = list(str(N))
    NUM = list(map(int,NUM))
    #A = list(map(int, input().split()))  # [1,2,3,4,5]
    for i in NUM:
        if int(i) == 7:
            print("Yes")
            exit(0)
    print("No")
    
main()

Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    NUM = list(str(N))
    for i in NUM:
        if int(i) == 7:
            print("Yes")
            exit(1)
    print("No")


main()

Fixed submission:
def main(): # A162
    N = int(input())
    NUM = list(str(N))
    NUM = list(map(int,NUM))
    #A = list(map(int, input().split()))  # [1,2,3,4,5]
    for i in NUM:
        if int(i) == 7:
            print("Yes")
            exit(0)
    print("No")
    
main()
Buggy python submission (verdict: Runtime Error):
def main(): # C163
    N = int(input())
    sum = 0
    for i in range(1, N+1):
        for j in range(1, N+1):
            for h in range(1, N+1):
                sum += gcd(i,j,h)
    print(sum)


main()

Fixed submission:
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)


def main(): # C163
    N = int(input())
    sum = 0
    for i in range(1, N+1):
        for j in range(1, N+1):
            for h in range(1, N+1):
                sum += gcd(i,j,h)
    print(sum)


main()
Buggy python submission (verdict: Runtime Error):
H, W = [int(_) for _ in input().split()]
if H == 1 and W == 1:
    print(1)
elif H %2 == 0:
    print(int(H*W/2))
else:
    print(int((H-1)*W/2) + int(math.ceil(W/2)))

Fixed submission:
import math
 
H, W = [int(_) for _ in input().split()]
if H == 1 or W == 1:
    print(1)
elif H %2 == 0:
    print(int(H*W/2))
else:
    print(int((H-1)*W/2) + int(math.ceil(W/2)))
Buggy python submission (verdict: Runtime Error):
a, b, c = [int(_) for _ in input().split()]
if math.sqrt(a) + math.sqrt(b) < math.sqrt(c):
    print("Yes")
else:
    print("No")

Fixed submission:
a, b, c = [int(_) for _ in input().split()]
d = c - a - b
if d > 0 and d * d > 4 * a * b:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a, b, c = [int(_) for _ in input().split()]
if math.sqrt(a) + math.sqrt(b)  < math.sqrt(c):
    print("Yes")
else:
    print("No")

Fixed submission:
a, b, c = [int(_) for _ in input().split()]
d = c - a - b
if d > 0 and d * d > 4 * a * b:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
def C158():
    A, B = [int(_) for _ in input().split()]
    X1 = int(A / 0.08)
    # パターンを探す
    X = []
    for i in range(X1, 10000):
        if int(i * 0.08) == A:
            X.append(i)
        else:
            break

    for i in X:
        if int(i * 0.1) == B:
            print(i)
            exit(1)
    else:
        print("-1")

if __name__ == "__main__":
    C158()

Fixed submission:
def C158():
    A, B = [int(_) for _ in input().split()]
    N = 1
    while N <= 10000:
        if int(N * 8/100) == A and int(N * 10/100) == B:
            break
        N += 1
    if N <= 10000:
        print(N)
    else:
        print(-1)
        
if __name__ == "__main__":
    C158()
Buggy python submission (verdict: Runtime Error):
N = int(input(N))
print(int(N+1)/2)

Fixed submission:
N = int(input())
print(int((N+1)/2))
Buggy python submission (verdict: Runtime Error):
def main():
    # importも関数の中で実装する
    # ローカル変数化する
    # xxx
    N, N = map(int, input().split())
    SC = [list(map(int, input().split())) for _ in [0]*N ]

    for i in range(10 ** (N-1), 10 ** N):
        S = str(i)
        if len(S) == N:
            if all(S[s - 1] == str(c) for s, c in SC):
                print(S)
                quit()
    print(-1)

main()

Fixed submission:
n,m,*z=map(int,open(0).read().split())
for i in range(10**n):
  S=str(i)
  if len(S)==n:
    if all(S[s-1]==str(c)for s,c in zip(z[0::2],z[1::2])):
      print(S)
      quit()
print(-1)

Buggy python submission (verdict: Runtime Error):
def main():
    # importも関数の中で実装する
    # ローカル変数化する
    # xxx
    N, N = map(int, input().split())
    SC = [list(map(int, input().split())) for _ in [0]*N ]
    SC.sort()

    num = (10 ** N) - 1
    keta = 1

    if SC[0][0] != 1:
        print('-1')
        exit()

    for S,C in SC:
        if S == 1 and C == 0:
            print('-1')
            exit()

        if S == keta:
            tmp = C * (10 ** (N - S))
            if tmp < num:
                num = tmp
        elif S > keta:
            keta = S
            tmp = C * (10 ** (N - S))
            num += tmp

    print(num)


main()

Fixed submission:
n,m,*z=map(int,open(0).read().split())
for i in range(10**n):
  S=str(i)
  if len(S)==n:
    if all(S[s-1]==str(c)for s,c in zip(z[0::2],z[1::2])):
      print(S)
      quit()
print(-1)

Buggy python submission (verdict: Runtime Error):
def main():
    # importも関数の中で実装する
    # ローカル変数化する
    # xxx
    N, N = map(int, input().split())
    SC = [list(map(int, input().split())) for _ in [0]*N ]
    SC.sort()

    num = (10 ** N) - 1
    keta = 1

    if SC[0][0] != 0:
        print('-1')
        exit()

    for S,C in SC:
        if S == 1 and C == 0:
            print('-1')
            exit()

        if S == keta:
            tmp = C * (10 ** (N - S))
            if tmp < num:
                num = tmp
        elif S > keta:
            keta = S
            tmp = C * (10 ** (N - S))
            num += tmp

    print(num)


main()

Fixed submission:
n,m,*z=map(int,open(0).read().split())
for i in range(10**n):
  S=str(i)
  if len(S)==n:
    if all(S[s-1]==str(c)for s,c in zip(z[0::2],z[1::2])):
      print(S)
      quit()
print(-1)