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

Fixed submission:
S = input()
T = input()
C = []
if len(S) == len(T):
  c = 0
  for j in range(len(T)):
      if S[j] == T[j]:
        c += 1
  C.append(c)
else:
  for i in range(len(S) - len(T)+1):
    s = S[i:len(T)+i]
    c = 0
    for j in range(len(T)):
      if s[j] == T[j]:
        c += 1
    C.append(c)
print(len(T)-max(C))

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
C = []
for i in range(len(S) - len(T)):
  s = S[i:len(T)+i]
  c = 0
  for j in range(len(T)):
    if s[j] == T[j]:
      c += 1
  C.append(c) 
print(len(T)-max(C))
Problem p02580 (python)

Fixed submission:

n,m,t=map(int,input().split())

grid=[]

row=[0]*n
col=[0]*m

for _ in range(t):
    x,y=map(int,input().split())
    grid.append((x-1,y-1))
    row[x-1]+=1
    col[y-1]+=1

prow=[]
pcol=[]
qr=max(row)
for i in range(n):
    if row[i]==qr :
        prow.append(i)

qc=max(col)
for i in range(m):
    if col[i]==qc :
        pcol.append(i)

num=len(prow)*len(pcol)
ans=qr+qc
for i in grid:
    if row[i[0]]==qr and col[i[1]]==qc :
        num-=1
if num>0:
    print(ans)
else:
    print(ans-1)

Buggy submission (verdict: Runtime Error):
n,m,t=map(int,input().split())

grid=[[0]*m for _ in range(n)]

row=[0]*n
col=[0]*m

for _ in range(t):
    x,y=map(int,input().split())
    grid[x-1][y-1]=1
    row[x-1]+=1
    col[y-1]+=1

prow=[]
pcol=[]
q=max(row)
for i in range(n):
    if row[i]==q :
        prow.append(i)

q=max(col)
for i in range(m):
    if col[i]==q :
        pcol.append(i)

ans=0
for i in prow :
    for j in pcol:
        if grid[i][j]==0 :
            ans=row[i]+col[j]
            break
        else:
            ans=row[i]+col[j]-1

print(ans)
Problem p02629 (python)

Fixed submission:
s='abcdefghijklmnopqrstuvwxyz'
n=int(input())
def number_of_alphabets(n):
    i=1
    g=0
    while g<n:
        g+=26**i
        i+=1
    return(i-1)
def what(num):
    g=0
    for i in range(num):
        g+=26**i
    return g
num=number_of_alphabets(n)
name=['a']*num
x=what(num)
n-=x
num-=1
for i in range(num,-1,-1):
    o=n//26**i
    name[num-i]=s[o]
    n=n-o*26**i
print(''.join(name))

Buggy submission (verdict: Runtime Error):
s='0abcdefghijklmnopqrstuvwxyz'
from math import log,ceil
n=int(input())
number_of_digits=ceil(log(n,26))
i=number_of_digits-1
name=''
while n>0:
    o=n//(26**i)
    name+=s[o]
    n=n-o*(26**i)
    i-=1
print(name)

Buggy submission (verdict: Runtime Error):
s='0abcdefghijklmnopqrstuvwxyz'
from math import log,ceil
n=int(input())
number_of_digits=ceil(log(n,26))
i=number_of_digits-1
name=''
while n>0:
    o=n//(26**i)
    name+=s[o]
    n=n-o*26**i
    i-=1
print(name)
Problem p02754 (python)

Fixed submission:
N, A, B = map(int, input().split())
ans = N // (A + B) * A
rem = N % (A + B)
ans += min(rem, A)
print(ans)

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

row = ""

if N[1] == 0:
    print(0)
else:
    remain = int(N[0]//(N[1]+N[2]))
    remain_2 = N[0] - N[1]*remain - N[2]*remain
    row += "b"*N[1]*remain+"a"*N[2]*remain+"b"*remain_2
    print(row.count("b"))

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

row = ""

if N[1] == 0:
    print(0)
else:
    remain = int(N[0]//(N[1]+N[2]))
    remain_2 = N[0] - N[1]*remain - N[2]*remain
    row += "b"*N[1]*remain+"a"*N[2]*remain+"b"*remain_2
    print(row.count("b"))

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

row = ""

if N[1] == 0:
    print(0)
else:
    remain = N[0] - N[1] - N[2]
    row += "b"*N[1]+"a"*N[2]+"b"*remain
    print(row.count("b"))

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

row = ""

if N[1] == 0:
    print(0)
else:
    remain = N[0] - N[1] - N[2]
    row += "b"*N[1]+"a"*N[2]+"b"*remain

print(row.count("b"))
Problem p02860 (python)

Fixed submission:
n = int(input())
s = input()
 
m = len(s) // 2
if s[:m] == s[m:]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N,S = input().split()
 
S1 = S[:int(N)/2]
S2 = S[int(N)/2:]
 
if S1 == S2:
  print("Yes")
else:
  print("No")

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

S1 = S[:N/2]
S2 = S[N/2:]

if S1 == S2:
  print("Yes")
else:
  print("No")
Problem p02624 (python)

Fixed submission:
#!/usr/bin/env python3

def main():
    N = int(input())

    def fanc(N):
        return N * (N + 1) // 2
    ans = 0
    for i in range(1, N + 1):
        ans += i * fanc(N // i)
    print(ans)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

def main():
    import sympy
    N = int(input())
    print(sum([i * sympy.divisor_count(i) for i in range(N + 1)]))


if __name__ == "__main__":
    main()
Problem p02693 (python)

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

for i in range(1000):
  if K*i >= A and K*i <= B:
    print('OK')
    break
else:
  print('NG')

Buggy submission (verdict: Runtime Error):
K = int(input())
A,B = map(int,input().split())
if A == B:
	if K//A == 0:
        print('OK')
	else:
        print('NG')
else:
	if K//A == K//B:
		print('NG')
	else:
		print('OK')

Buggy submission (verdict: Runtime Error):
K = int(input())
A,B = map(int,input().split())
if A == B:
	if K//A == 0:
        print('OK')
    else:
		if K//A == K//B:
			print('NG')
		else:
			print('OK')
Problem p02777 (python)

Fixed submission:
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U==S:
  A=A-1
else:
  B=B-1
print('{} {}'.format(A,B))

Buggy submission (verdict: Runtime Error):
S,T=map(int,input().split())
A,B=map(int,input().split())
U=input()
if U==S:
  A=A-1
else:
  B=B-1
print('{} {}'.format(A,B))
Problem p02897 (python)

Fixed submission:
N=int(input())
if N%2==0:
    print(0.5)
else:
    print('{:.7g}'.format((N+1)/(2*N)))

Buggy submission (verdict: Runtime Error):
def gcd(n,m):#n,mは正の整数、最大公約数　許容は？
    if n==0:
        return m
    elif m==0:
        return n
    elif n>m:
        n=n%m
        return gcd(n,m)
    else:
        m=m%n
        return gcd(n,m)

def ord(N,n):#N,nは正の整数、Nで割り切れる回数、許容はN^1000
    if n%N!=0:
        return 0
    else:
        return 1+ord(N,n//N)

def get_sieve_of_eratosthenes_new(n):
    import math
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]

primelist=get_sieve_of_eratosthenes_new(10**6)

A,B=map(int,input().split())
x=gcd(A,B)
count=1

for i in range(0,len(primelist)):
    if x%primelist[i]==0:
        count+=1
        x=x//primelist[i]**ord(primelist[i],x)
if x!=1:
    count+=1
print(count)
Problem p03013 (python)

Fixed submission:
def fibonacci(n):
    if n<0:
        return 0
    else:
        a=1
        b=1
        if n==0:
            return a
        elif n==1:
            return b
        else:
            i=n-2
            while i>=0:
                x=a
                a=b
                b=x+b
                i=i-1
            return b

N,M=map(int,input().split())
a=[]
for _ in range(0,M):
    a.append(int(input()))
a.append(N+1)
m=1
for i in range(0,M+1):
    if i==0:
        m=fibonacci(a[i]-1)
    else:
        m=m*fibonacci(a[i]-a[i-1]-2)

print(m%(10**9+7))

Buggy submission (verdict: Runtime Error):
def fibonacci(n,memo={}):
    if n<0:
        return 0
    elif n==1 or n==0:
        return 1
    elif n in memo:
        return memo[n]
    else:
        memo[n]=fibonacci(n-1,memo)+fibonacci(n-2,memo)
        return memo[n]

N,M=map(int,input().split())
a=[]
for _ in range(0,M):
    a.append(int(input()))
a.append(N+1)
m=1
for i in range(0,M+1):
    if i==0:
        m=fibonacci(a[i]-1)
    else:
        m=m*fibonacci(a[i]-a[i-1]-2)

print(m%(10**9+7))

Buggy submission (verdict: Runtime Error):
def fibonacci(n):
    if n<0:
        return 0
    if n==1 or n==0:
        return 1
    else:
        return fibonacci(n-1)+fibonacci(n-2)

N,M=map(int,input().split())
a=[]
for _ in range(0,M):
    a.append(int(input()))
a.append(N+1)
m=1
for i in range(0,M+1):
    if i==0:
        m=fibonacci(a[i]-1)
    else:
        m=m*fibonacci(a[i]-a[i-1]-2)

print(m%(10**9+7))

Buggy submission (verdict: Runtime Error):
def fibonacci(n):
    if n==-1:
        return 0
    if n==1 or n==0:
        return 1
    else:
        return fibonacci(n-1)+fibonacci(n-2)

N,M=map(int,input().split())
a=[]
for _ in range(0,M):
    a.append(int(input()))
a.append(N+1)
m=1
for i in range(0,M+1):
    if i==0:
        m=fibonacci(a[i]-1)
    else:
        m=m*fibonacci(a[i]-a[i-1]-2)

print(m%(10**9+7))
Problem p03805 (python)

Fixed submission:
N,M=map(int,input().split())
hen=[[] for i in range(0,N)]
for i in range(0,M):
    a,b=map(int,input().split())
    hen[a-1].append(b-1)
    hen[b-1].append(a-1)

def onestrokepath(start,visited=[]):
    flag=0
    count=0
    for next in hen[start]:
        if not next in visited:
            flag=1
            count+=onestrokepath(next,visited+[next])
    if flag==0:
        check=[i for i in range(0,N)]
        visited.sort()
        if check==visited:
            return 1
        else:
            return 0
    return count

print(onestrokepath(0,[0]))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
hen=[[] for i in range(0,N)]
for i in range(0,N):
    a,b=map(int,input().split())
    hen[a-1].append(b-1)
    hen[b-1].append(a-1)

def onestrokepath(start,visited=[]):
    flag=0
    count=0
    for next in hen[start]:
        if not next in visited:
            flag=1
            count+=onestrokepath(next,visited+[next])
    if flag==0:
        check=[i for i in range(0,N)]
        visited.sort()
        if check==visited:
            return 1
        else:
            return 0
    return count

print(onestrokepath(0,[0]))
Problem p03806 (python)

Fixed submission:
from fractions import gcd

N,ma,mb=map(int,input().split())
med=[]
for i in range(0,N):
    a,b,c=map(int,input().split())
    med.append((a,b,c))

dp=[[[float("inf") for i in range(0,401)] for j in range(0,401)] for k in range(0,N)]
dp=[[float("inf") for i in range(0,401)] for j in range(0,401)]

for i in range(0,401):
    for j in range(0,401):
        if not (i==0 and j==0):
            g=gcd(i,j)
            I=i//g
            J=j//g
            if I==ma and J==mb:
                dp[i][j]=0
            else:
                g=gcd(i+med[0][0],j+med[0][1])
                I=(i+med[0][0])//g
                J=(j+med[0][1])//g
                if I==ma and J==mb:
                    dp[i][j]=med[0][2]

for i in range(1,N):
    a,b,c=med[i]
    for j in range(0,401-a):
        for k in range(0,401-b):
            dp[j][k]=min(dp[j][k],c+dp[j+a][k+b])

if dp[0][0]==float("inf"):
    print(-1)
else:
    print(dp[0][0])

Buggy submission (verdict: Runtime Error):
from math import gcd

N,ma,mb=map(int,input().split())
med=[]
for i in range(0,N):
    a,b,c=map(int,input().split())
    med.append((a,b,c))

dp=[[[float("inf") for i in range(0,401)] for j in range(0,401)] for k in range(0,N)]
dp=[[float("inf") for i in range(0,401)] for j in range(0,401)]

for i in range(0,401):
    for j in range(0,401):
        if not (i==0 and j==0):
            g=gcd(i,j)
            I=i//g
            J=j//g
            if I==ma and J==mb:
                dp[i][j]=0
            else:
                g=gcd(i+med[0][0],j+med[0][1])
                I=(i+med[0][0])//g
                J=(j+med[0][1])//g
                if I==ma and J==mb:
                    dp[i][j]=med[0][2]

for i in range(1,N):
    a,b,c=med[i]
    for j in range(0,401-a):
        for k in range(0,401-b):
            dp[j][k]=min(dp[j][k],c+dp[j+a][k+b])

if dp[0][0]==float("inf"):
    print(-1)
else:
    print(dp[0][0])
Problem p03809 (python)

Fixed submission:
import sys

input=sys.stdin.buffer.readline
sys.setrecursionlimit(2*10**5)

N=int(input())
A=list(map(int,input().split()))
edge=[[] for i in range(N)]
for i in range(N-1):
    a,b=map(int,input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)

if N==2:
    if A[0]==A[1]:
        print("YES")
    else:
        print("NO")
    exit()

root=0
for i in range(N):
    if len(edge[i])!=1:
        root=i
        break

def cond(L,n):
    check=0
    for i in L:
        check+=min(n,i)
    return check>=2*n

def dfs(v,pv):
    s=A[v]
    t=[]
    for nv in edge[v]:
        if nv!=pv:
            y=dfs(nv,v)
            t.append(y)
    #2*a+b=t
    #a+b=s
    T=sum(t)
    if T==0:
        if len(edge[v])==1:
            return s

    start=0
    end=T//2
    while end-start>1:
        test=(end+start)//2
        if cond(t,test):
            start=test
        else:
            end=test
    if cond(t,end):
        M=end
    else:
        M=start

    a=T-s
    b=2*s-T
    if 0>a or 0>b:
        print("NO")
        exit()
    elif a>M:
        print("NO")
        exit()
    return b

res=dfs(root,-1)
print("YES" if res==0 else "NO")

Buggy submission (verdict: Runtime Error):
import sys

input=sys.stdin.readline
sys.setrcursionlimit(2*10**5)

N=int(input())
A=list(map(int,input().split()))
edge=[[] for i in range(N)]
for i in range(N-1):
    a,b=map(int,input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)

root=0
for i in range(N):
    if len(edge[i])!=1:
        root=i
        break

def dfs(v,pv):
    s=A[v]
    t=0
    for nv in edge[v]:
        if nv!=pv:
            y=dfs(nv,v)
            t+=y
    #2*a+b=t
    #a+b=s
    if t==0:
        if len(edge[v])!=1:
            print("NO")
            exit()
        else:
            return s
    a=t-s
    b=2*s-t
    if 2*a>t:
        print("NO")
        exit()
    return b

res=dfs(root,-1)
print("YES" if res==0 else "NO")

Buggy submission (verdict: Runtime Error):
import sys

input=sys.stdin.buffer.readline
sys.setrcursionlimit(2*10**5)

N=int(input())
A=list(map(int,input().split()))
edge=[[] for i in range(N)]
for i in range(N-1):
    a,b=map(int,input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)

root=0
for i in range(N):
    if len(edge[i])!=1:
        root=i
        break

def dfs(v,pv):
    s=A[v]
    t=0
    for nv in edge[v]:
        if nv!=pv:
            y=dfs(nv,v)
            t+=y
    #2*a+b=t
    #a+b=s
    if t==0:
        if len(edge[v])!=1:
            print("NO")
            exit()
        else:
            return s
    a=t-s
    b=2*s-t
    if 2*a>t:
        print("NO")
        exit()
    return b

res=dfs(root,-1)
print("YES" if res==0 else "NO")
Problem p03822 (python)

Fixed submission:
import sys

sys.setrecursionlimit(1000000)

N=int(input())
edge={i:[] for i in range(1,N+1)}
parent={i:0 for i in range(1,N+1)}
for i in range(0,N-1):
    a=int(input())
    edge[a].append(i+2)
    edge[i+2].append(a)
    parent[i+2]=a

memo={i:-1 for i in range(1,N+1)}
def dp(num):
    if memo[num]!=-1:
        return memo[num]

    if edge[num]==[parent[num]]:
        memo[num]=0
        return memo[num]

    test=[]
    for i in edge[num]:
        if i!=parent[num]:
            test.append(dp(i))
    test.sort(reverse=True)
    memo[num]=max(i+1+test[i] for i in range(0,len(test)))
    return memo[num]

print(dp(1))

Buggy submission (verdict: Runtime Error):
N=int(input())
edge={i:[] for i in range(1,N+1)}
parent={i:0 for i in range(1,N+1)}
for i in range(0,N-1):
    a=int(input())
    edge[a].append(i+2)
    edge[i+2].append(a)
    parent[i+2]=a

memo={i:-1 for i in range(1,N+1)}
def dp(num):
    if memo[num]!=-1:
        return memo[num]

    if edge[num]==[parent[num]]:
        memo[num]=0
        return memo[num]

    test=[]
    for i in edge[num]:
        if i!=parent[num]:
            test.append(dp(i))
    test.sort(reverse=True)
    memo[num]=max(i+1+test[i] for i in range(0,len(test)))
    return memo[num]

print(dp(1))
Problem p04021 (python)

Fixed submission:
import copy

N=int(input())
A=[]
for i in range(N):
    A.append(int(input()))

a=copy.copy(A)
A.sort()
dic={}
for i in range(0,N):
    dic[a[i]]=0
    dic[a[i]]=i

ans=0
for i in range(0,N):
    if i%2==1:
        if dic[A[i]]%2==0:
            ans+=1

print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[]
for i in range(N):
    A.append(int(input()))

a=A.copy()
A.sort()
dic={}
for i in range(0,N):
    dic[a[i]]=0
    dic[a[i]]=i

ans=0
for i in range(0,N):
    if i%2==1:
        if dic[A[i]]%2==0:
            ans+=1

print(ans)
Problem p02831 (python)

Fixed submission:
import fractions

A, B = [int(i) for i in input().split()]

C = fractions.gcd(A, B)
print(int((A * B)/C))

Buggy submission (verdict: Runtime Error):
import math

A, B = [int(i) for i in input().split()]

C = math.gcd(A, B)
print(int((A * B)/C))

Buggy submission (verdict: Runtime Error):
import math

A, B = [int(i) for i in input().split()]

print(int((A * B) / math.gcd(A, B)))
Problem p02970 (python)

Fixed submission:
import math
def q45(n, d):
    a = math.ceil(n/(2*d+1))
    return a

N, D= [int(i) for i in input().split()]
print(q45(N, D))

Buggy submission (verdict: Runtime Error):
import math
def q45(n, d):
    a = math.ceil(n/(2*d+1))
    return a

N = int(input())
D = int(input())
print(q45(N, D))

Buggy submission (verdict: Runtime Error):
import math
def q45(n, d):
    a = math.ceil(n/(2*d+1))
    return a

N = int(input())
D = int(input())
print(q45(N, D))
Problem p02989 (python)

Fixed submission:
def check(N, d):
    numList = d
    numList.sort()
    
    if N % 2 != 0:
        print(0)
    else:
        print(numList[int(len(numList)/2)] - numList[int(len(numList)/2-1)])

N = int(input())
d = [int(i) for i in input().split()]
check(N, d)

Buggy submission (verdict: Runtime Error):
    def q38(n, d):
        max_d = max(d)
        min_d = min(d)
        count = 0
        for i in range(min_d+1, max_d):
            a = []
            b = []
            for j in d:
                if j >= i:
                    a.append(j)
                else:
                    b.append(j)
            if len(a) == len(b):
                count += 1
        return count
     
  N = int(input())
  d = [int(i) for i in input().split()]
  print(q38(N, d))

Buggy submission (verdict: Runtime Error):
def q38(n, d):
    max_d = max(d)
    min_d = min(d)
    count = 0
    for i in range(min_d+1, max_d):
        a = []
        b = []
        for j in d:
            if j >= i:
                a.append(j)
            else:
                b.append(j)
        if len(a) == len(b):
            count += 1
    return count
N = int(input())
d = [int(i) for i in input.split()]
print(q38(N, d))
Problem p03012 (python)

Fixed submission:
N = int(input())
W = [int(i) for i in input().split()]
a = []
for i in range(N - 1):
    a.append(abs(sum(W[:i+1]) - sum(W[i+1:])))

print(min(a))

Buggy submission (verdict: Runtime Error):
def calc(n, w):
    min_sub = 100000
    N = N
    num = w
    for i in range(1,N):
        S1 = num[:i]
        S2 = num[i:]
        sub = abs(sum(S1)-sum(S2))
        if min_sub > sub:
            min_sub = sub
    print(min_sub)
     
N = int(input())
W = [int(i) for i in input().split()]
calc(N, W)

Buggy submission (verdict: Runtime Error):

def calc():
    min_sub = 100000
    N = int(input())
    num = list(map(int, input().split()))
    for i in range(1,N):
        S1 = num[:i]
        S2 = num[i:]
        sub = abs(sum(S1)-sum(S2))
        if min_sub > sub:
            min_sub = sub
    print(min_sub)

N = int(input())
W = [int(i) for i in input().split()]
calc(N, W)

Buggy submission (verdict: Runtime Error):
N = int(input())
W = [int(i) for i in input().split()]
calc(N, W)
def calc(n, w):
    min_sub = 100000
    N = n
    num = w
    for i in range(1,N):
        S1 = num[:i]
        S2 = num[i:]
        sub = abs(sum(S1)-sum(S2))
        if min_sub > sub:
            min_sub = sub
    print(min_sub)
Problem p03208 (python)

Fixed submission:
import itertools

def q49(n, k, h):
    h.sort()
    a = [h[i+k-1]-h[i] for i in range(n-k+1)]
    return min(a)
            
N, K = [int(i) for i in input().split()]
h = []
for _ in range(N):
    h.append(int(input()))
print(q49(N, K, h))

Buggy submission (verdict: Runtime Error):
import itertools

def q49(n, k, h):
    h.sort()
    a = [h[i+k-1]-h[i] for i in range(n-k-1)]
    return min(a)
            
N, K = [int(i) for i in input().split()]
h = []
for _ in range(N):
    h.append(int(input()))
print(q49(N, K, h))

Buggy submission (verdict: Runtime Error):
import itertools

def q49(n, k, h):
    h.sort()
    a = [h[i+k-1]-h[i] for i in range(n-1)]
    return min(a)
            
N, K = [int(i) for i in input().split()]
h = []
for _ in range(N):
    h.append(int(input()))
print(q49(N, K, h))

Buggy submission (verdict: Runtime Error):
import itertools

def q49(n, k, h):
    h.sort()
    a = [h[i+k-1]-h[i] for i in range(n-2)]
    return min(a)
            
N, K = [int(i) for i in input().split()]
h = []
for _ in range(N):
    h.append(int(input()))
print(q49(N, K, h))
Problem p02577 (python)

Fixed submission:
N=int(input())
if N%9 == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
if N / 9 == 0:
    print("Yes")
else :
    print("No")
Problem p02570 (python)

Fixed submission:
def main():
    D, T, S = map(int, input().split())
    if float(T) < float(D) /float(S) :
        print("No")
    else:
        print("Yes")
    #N = int(input())
    #A = [int(s) for s in input().split()]
    #

main()

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

    mod_value = 10**9 + 7
    sum_ = 0
    b_sum = 0
    for i in range(len(A)-1):
        b_sum = b_sum + A[len(A)-i-1]
        sum_ = sum_ + (A[len(A)- i - 2]*b_sum) % mod_value
    print(sum_%mod_value)
main()

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

    mod_value = 10**9 + 7
    sum_ = 0
    for i in range(len(A)-1):
        sum_ = sum_ + A[i]*sum(A[i+1:]) % mod_value
    print(sum_ % mod_value)
main()
Problem p02572 (python)

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

    mod_value = 10**9 + 7
    sum_ = 0
    b_sum = 0
    for i in range(len(A)-1):
        b_sum = b_sum + A[len(A)-i-1]
        sum_ = sum_ + (A[len(A)- i - 2]*b_sum) % mod_value
    print(sum_%mod_value)
main()

Buggy submission (verdict: Runtime Error):
4
141421356 17320508 22360679 244949
Problem p02594 (python)

Fixed submission:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

X = i()
if X >= 30:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N=input()
c=input()
print(c[:c.count('R')].count('W'))
Problem p02597 (python)

Fixed submission:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
fact = math.factorial
sys.setrecursionlimit(10**9)
INF = 10**9
mod = 10**9+7

N = i()
c = s()
num = c.count('R')
print(c[:num].count('W'))

Buggy submission (verdict: Runtime Error):
'import zlib
print(eval(zlib.decompress(b\\'x\xda\xf3\xd3I\xb6\xcd\xcc+(-\xd1\xd0\xd4\x81\xd2\xd6\x05E\x99y%\x1a\xc9\xd1V\xc9z\xc9\xf9\xa5@\xa6z\x90\xbaf,\x8c\x1d\xae\xae\xa9\t\x00\xf0]\x11O\\')))'