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

Fixed submission:
def readinput():
    n=int(input())
    a=list(map(int,input().split()))
    return n,a

def main(n,a):
    maxa=10**6
    isprime=[True]*(maxa+1)
    sa=sorted(a)

    prevx=0
    for x in sa:
        if isprime[x]==False:
            continue
        if prevx==x:
            isprime[x]=False
            continue

        i=x*2
        while(i<=maxa):
            isprime[i]=False
            i+=x
        prevx=x
    
    count=0
    for x in sa:
        if isprime[x]==True:
            count+=1
    return count

if __name__=='__main__':
    n,a=readinput()
    ans=main(n,a)
    print(ans)

Buggy submission (verdict: Runtime Error):
def readinput():
    n=int(input())
    a=list(map(int,input().split()))
    return n,a

def main(n,a):
    maxa=2*10**5
    isprime=[True]*(maxa+1)
    sa=sorted(a)

    prevx=0
    for x in sa:
        if isprime[x]==False:
            continue
        if prevx==x:
            isprime[x]=False
            continue

        i=x*2
        while(i<=maxa):
            isprime[i]=False
            i+=x
        prevx=x
    
    count=0
    for x in sa:
        if isprime[x]==True:
            count+=1
    return count

if __name__=='__main__':
    n,a=readinput()
    ans=main(n,a)
    print(ans)
Problem p02658 (python)

Fixed submission:
INFTY=10**18

def readinput():
    n=int(input())
    a=list(map(int,input().split()))
    return n,a

def main(n,a):
    if(a.count(0)!=0):
        return 0
        
    res=a[0]
    for i in range(1,n):
        res*=a[i]
        if res>INFTY:
            return -1
    return res

if __name__=='__main__':
    n,a=readinput()
    ans=main(n,a)
    print(ans)

Buggy submission (verdict: Runtime Error):
def readinput():
    n=int(input())
    a=list(map(int,input().split()))
    return n,a

def main(n,a):
    if(a.count(0)!=0):
        return 0
        
    res=a[0]
    for i in range(1,n):
        res*=a[i]
        if res>INFTY:
            return -1
    return res

if __name__=='__main__':
    n,a=readinput()
    ans=main(n,a)
    print(ans)
Problem p02767 (python)

Fixed submission:
def readinput():
    n=int(input())
    x=list(map(int,input().split()))
    return n,x

def mean(x):
    sum=0
    for _ in x:
        sum+=_
    return sum/len(x)

def rss(x,xbar):
    sum=0
    for _ in x:
        sum+=(_-xbar)**2
    return sum

def main(n,x):
    ans=0
    xbar=mean(x)
    xbar_int=xbar//1
    if(xbar-xbar_int >0.5):
        xbar_int+=1
    ans=rss(x,xbar_int)
    return int(ans)

def main2(n,x):
    xmin=min(x)
    xmax=max(x)
    minsum=1000000

    for p in range(xmin,xmax+1):
        sum=0
        for xx in x:
            sum+=(xx-p)**2
        if(sum<minsum):
            minsum=sum

    return minsum

if __name__=='__main__':
    n,x=readinput()
    ans=main2(n,x)
    print(ans)

Buggy submission (verdict: Runtime Error):

def mean(x):
    sum=0
    for _ in x:
        sum+=_
    return sum/len(x)

def rss(x,xbar):
    sum=0
    for _ in x:
        sum+=(_-xbar)**2
    return sum

def main(n,x):
    ans=0
    xbar=mean(x)
    xbar_int=xbar//1
    if(xbar-xbar_int >0.5):
        xbar_int+=1
    ans=rss(x,xbar_int)
    return int(ans)

def main2(n,x):
    xmin=min(x)
    xmax=max(x)
    minsum=1000000

    for p in range(xmin,xmax+1):
        sum=0
        for xx in x:
            sum+=(xx-p)**2
        if(sum<minsum):
            minsum=sum

    return minsum

if __name__=='__main__':
    n,x=readinput()
    ans=main(n,x)
    print(ans)
Problem p02838 (python)

Fixed submission:
def readinput():
    n=int(input())
    l=list(map(int,input().split()))
    return n,l

def main(n,a):
    MOD=10**9+7
    hist=[0]*61
    bs=[]
    for i in range(n):
        # s=list(reversed(bin(a[i])[2:]))
        # for j in range(len(s)):
        #     if s[j]=='1':
        #         hist[j]+=1
        # bs.append(s)
        s=bin(a[i])[2:]
        for j in range(len(s)):
            if s[j]=='1':
                hist[len(s)-j-1]+=1

    #print(bs)
    #print(hist)
    sum=0
    # for i in range(n-1):
    #     s=bs[i]
    #     b=1
    #     for j in range(len(s)):
    #         if s[j]=='0':
    #             sum=(sum+hist[j]*b)%MOD
    #         else:
    #             sum=(sum+( n-i-hist[j] )*b)%MOD
    #             hist[j]-=1
    #         b*=2
    #     for j in range(len(s),61):
    #         sum=(sum+hist[j]*b)%MOD
    #         b*=2
    b=1
    for j in range(61):
        sum=(sum+( hist[j]*(n-hist[j])*b )%MOD )%MOD
        b*=2

    return sum

if __name__=='__main__':
    n,l=readinput()
    ans=main(n,l)
    print(ans)

Buggy submission (verdict: Runtime Error):
def readinput():
    n=int(input())
    l=list(map(int,input().split()))
    return n,l

def main(n,a):
    MOD=10**9+7
    hist=[0]*61
    bs=[]
    for i in range(n):
        # s=list(reversed(bin(a[i])[2:]))
        # for j in range(len(s)):
        #     if s[j]=='1':
        #         hist[j]+=1
        # bs.append(s)

        s=bin(a[i])[2:]
        for j in range(len(s)):
            if s[j]=='1':
                hist[len(s)-j-1]+=1
        # j=0
        # ai=a[i]
        # while ai>0:
        #     if ai&1==1:
        #         hist[j]+=1
        #     ai = ai >> 1
        #     j+=1


    #print(bs)
    #print(hist)
    sum=0
    for i in range(n-1):
        s=bs[i]
        b=1
        for j in range(len(s)):
            if s[j]=='0':
                sum=(sum+hist[j]*b)%MOD
            else:
                sum=(sum+( n-i-hist[j] )*b)%MOD
                hist[j]-=1
            b*=2
        for j in range(len(s),61):
            sum=(sum+hist[j]*b)%MOD
            b*=2
    # b=1
    # for j in range(61):
    #     sum=(sum+( hist[j]*(n-hist[j])*b )%MOD )%MOD
    #     b*=2

    return sum

if __name__=='__main__':
    n,l=readinput()
    ans=main(n,l)
    print(ans)
Problem p02960 (python)

Fixed submission:
def readinput():
    s=input()
    return s

def printTbl(tbl):
    for l in tbl:
        print(l)

def main(s):
    MOD=10**9+7

    Rtbl=[]
    for _ in range(10):
        Rtbl.append([0]*13)
    for i in range(1,10):
        for j in range(13):
            Rtbl[i][j]=(Rtbl[i-1][j]+j)%13
    #printTbl(Rtbl)

    n=len(s)
    p0=0
    q=[]
    for i in range(n):
        if s[i]!='?':
            p0=(p0*10+int(s[i]))%13
            for j in range(len(q)):
                q[j]=(q[j]*10)%13
        else:
            p0=(p0*10)%13
            for j in range(len(q)):
                q[j]=(q[j]*10)%13
            q.append(1)
    #print(p0,q)

    nq=len(q)
    if nq==0:
        if p0==5:
            return 1
        else:
            return 0

    Ptbl=[]
    for _ in range(13):
        Ptbl.append([0]*nq)
    q0=q[0]
    for i in range(10):
        Ptbl[(Rtbl[i][q0]+p0)%13][0]+=1
    for j in range(1,nq):
        qj=q[j]
        for n in range(10):
            for i in range(13):
                if Ptbl[i][j-1]>0:
                    ii=(i+Rtbl[n][qj])%13
                    Ptbl[ii][j]=(Ptbl[ii][j]+Ptbl[i][j-1])%MOD
    #printTbl(Ptbl)
    return Ptbl[5][nq-1]

def main2(s):
    MOD=10**9+7
    dp=[]
    n=len(s)
    for _ in range(13):
        dp.append([0]*(n+1))
    dp[0][0]=1
    for i in range(n):
        c=s[i]
        for j in range(13):
            for k in range(10):
                if c!='?' and c!=str(k):
                   continue
                jj=(j*10+k)%13
                dp[jj][i+1]=(dp[jj][i+1]+dp[j][i])%MOD
    return dp[5][n]

if __name__=='__main__':
    s=readinput()
    ans=main2(s)
    print(ans)

Buggy submission (verdict: Runtime Error):
def readinput():
    s=input()
    return s

def printTbl(tbl):
    for l in tbl:
        print(l)

def main(s):
    MOD=10**9+7

    Rtbl=[]
    for _ in range(10):
        Rtbl.append([0]*13)
    for i in range(1,10):
        for j in range(13):
            Rtbl[i][j]=(Rtbl[i-1][j]+j)%13
    #printTbl(Rtbl)

    n=len(s)
    p0=0
    q=[]
    for i in range(n):
        if s[i]!='?':
            p0=(p0*10+int(s[i]))%13
            for j in range(len(q)):
                q[j]=(q[j]*10)%13
        else:
            p0=(p0*10)%13
            for j in range(len(q)):
                q[j]=(q[j]*10)%13
            q.append(1)
    #print(p0,q)

    nq=len(q)
    Ptbl=[]
    for _ in range(13):
        Ptbl.append([0]*nq)
    q0=q[0]
    for i in range(10):
        Ptbl[(Rtbl[i][q0]+p0)%13][0]+=1
    for j in range(1,nq):
        qj=q[j]
        for n in range(10):
            for i in range(13):
                if Ptbl[i][j-1]>0:
                    ii=(i+Rtbl[n][qj])%13
                    Ptbl[ii][j]=(Ptbl[ii][j]+Ptbl[i][j-1])%MOD
    #printTbl(Ptbl)
    return Ptbl[5][nq-1]

if __name__=='__main__':
    s=readinput()
    ans=main(s)
    print(ans)
Problem p03044 (python)

Fixed submission:
import sys
INFTY=sys.maxsize
sys.setrecursionlimit(100000)

def readinput():
    n=int(input())
    nList=[]
    for _ in range(n+1):
        nList.append([])
    for _ in range(1,n):
        u,v,w=map(int,input().split())
        nList[u].append((v,w))
        nList[v].append((u,w))

    return n,nList

WHITE=0
GRAY=1
BLACK=2
status=[]
color=[]

def dfs(s,nList):
    for u,w in nList[s]:
        if status[u]==WHITE:
            if w%2==0:
                color[u]=color[s]
            else:
                color[u]=(color[s]+1)%2
            status[u]=GRAY
            dfs(u,nList)
    status[s]=BLACK

def main(n,nList):
    global status
    global color

    status=[WHITE]*(n+1)
    color=[WHITE]*(n+1)
    dfs(1,nList)

    for i in range(1,n+1):
        print(color[i])
    

if __name__=='__main__':
    n,nList=readinput()
    main(n,nList)
    #print(ans)

Buggy submission (verdict: Runtime Error):
import sys
INFTY=sys.maxsize

def readinput():
    n=int(input())
    nList=[]
    for _ in range(n+1):
        nList.append([])
    for _ in range(1,n):
        u,v,w=map(int,input().split())
        nList[u].append((v,w))
        nList[v].append((u,w))

    return n,nList

WHITE=0
GRAY=1
BLACK=2
status=[]
color=[]

def dfs(s,nList):
    for u,w in nList[s]:
        if status[u]==WHITE:
            if w%2==0:
                color[u]=color[s]
            else:
                color[u]=(color[s]+1)%2
            status[u]=GRAY
            dfs(u,nList)
    status[s]=BLACK

def main(n,nList):
    global status
    global color

    status=[WHITE]*(n+1)
    color=[WHITE]*(n+1)
    dfs(1,nList)

    for i in range(1,n+1):
        print(color[i])
    

if __name__=='__main__':
    n,nList=readinput()
    main(n,nList)
    #print(ans)

Buggy submission (verdict: Runtime Error):
import sys
INFTY=sys.maxsize

def readinput():
    n=int(input())
    nList=[]
    for _ in range(n+1):
        nList.append([])
    for _ in range(1,n):
        u,v,w=map(int,input().split())
        nList[u].append((v,w))
        nList[v].append((u,w))

    return n,nList

WHITE=0
GRAY=1
BLACK=2
status=[]
color=[]

def dfs(s,nList):
    for u,w in nList[s]:
        if status[u]==WHITE:
            if w%2==0:
                color[u]=color[s]
            else:
                color[u]=(color[s]+1)%2
            status[u]=GRAY
            dfs(u,nList)
    status[u]=BLACK

def main(n,nList):
    global status
    global color

    status=[WHITE]*(n+1)
    color=[WHITE]*(n+1)
    dfs(1,nList)

    for i in range(1,n+1):
        print(color[i])
    

if __name__=='__main__':
    n,nList=readinput()
    main(n,nList)
    #print(ans)
Problem p03493 (python)

Fixed submission:
s=input()
count=0
if(s[0]=='1'):
  count+=1
if(s[1]=='1'):
  count+=1
if(s[2]=='1'):
  count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
cnt=0
flag=True
while(flag):
  for i in range(n):
    if(a[i]%2==0):
      a[i]=a[i]//2
    else:
      flag=False
      break
  cnt+=1
print(cnt-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
cnt=0
flag=True
while(flag):
  for i in range(len(a)):
    if(a[i]%2==0):
      a[i]=a[i]//2
    else:
      flag=False
      break
  cnt+=1
print(cnt-1)
Problem p02582 (python)

Fixed submission:
s = input()
iter = 0
if s[0] =="R"and s[1]=="R" and s[2]=="R":
  print(3)
elif s[0] =="R"and s[1]=="R":
  print(2)
elif s[1]=="R" and s[2]=="R":
  print(2)
elif s[0] =="R"or s[1]=="R" or s[2]=="R":
  print(1)
elif s[0] =="R"and s[2]=="R":
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
x, k, d = map(int, input().split())
if k%2 == 0 and abs(x)==abs(d):
  print(abs(x))
  exit()

for i in range(k):
  if abs(x - d) <= abs(x + d):
      x = x - d
  else:
      x = x + d
print(abs(x))

Buggy submission (verdict: Runtime Error):
x, k, d = map(int, input().split())
if k%2 == 0 and abs(x)==abs(d):
  print(abs(x))
  exit()

for i in range(k):
  if abs(x - d) <= abs(x + d):
      x = x - d
  else:
      x = x + d
  
print(abs(x))
Problem p02618 (python)

Fixed submission:
#d=日数, c=満足低下度, s=満足上昇度, t=コンテストの日程 
d = int(input())
c = list(map(int, input().split()))
s = [list(map(int, input().split())) for i in range(d)]


res = 0
last = [0 for i in range(26)]
#old = t[dq[j][0] - 1]
#t[dq[0] - 1] = dq[1]
for day in range(d):
  t = s[day].index(max(s[day])) + 1
  m = s[day].index(max(s[day]))
  res += max(s[day])
  last[m] = day + 1
  #for i in range(26):
    #res -= c[i] * (day + 1 - last[i])
  combined1 = [x * (day + 1 - y) for (x, y) in zip(c, last)]
  res -= sum(combined1)
  #t[dq[j][0] - 1] = old
  print(t)

Buggy submission (verdict: Runtime Error):
from sys import stdin
#d=日数, c=満足低下度, s=満足上昇度, t=コンテストの日程 
d = int(stdin.readline().rstrip())
c = list(map(int, stdin.readline().rstrip().split()))
#print(c)
s = [list(map(int, stdin.readline().rstrip().split())) for i in range(d)]
t = [int(stdin.readline().rstrip()) for j in range(d)]
m = int(stdin.readline().rstrip())
#dq = [list(map(int, input().split())) for i in range(m)]
for j in range(m):
  dq = list(map(int, stdin.readline().rstrip().split()))
  res = 0
  last = [0 for i in range(26)]
  #old = t[dq[j][0] - 1]
  t[dq[0] - 1] = dq[1]
  for day in range(d):
    res += s[day][t[day]-1]
    last[t[day]-1] = day+1
    #for i in range(26):
      #res -= c[i] * (day + 1 - last[i])
    combined1 = [x * (day + 1 - y) for (x, y) in zip(c, last)]
    res -= sum(combined1)
  #t[dq[j][0] - 1] = old
  print(res)
Problem p02645 (python)

Fixed submission:
s = input()

print(s[0:3])

Buggy submission (verdict: Runtime Error):
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

iter = False
for t_a in range(t+1):
  for t_b in range(t+1):
    if a + t_a*v - (t-t_a)*v == b + t_b*w - (t-t_b)*w:
      iter = True
      break

if iter == False:
  print("NO")
else:
  print("YES")
Problem p02657 (python)

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

print(a*b)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
result = 1
checker =False
for j in a:
  if j > 1000000000000000000:
    result = -1
    checker =True
if 0 in a:
  result = 0
  checker=True
import numpy as np
while checker==False:
  #import numpy as np
  a = np.array(a)
  result = int(a.prod())
  checker = True
    

if result <= 1000000000000000000:
  print(result)
else:
  print(-1)
Problem p02658 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
result = 1
for i in range(len(a)):
  result = result*a[i]
  if result == 0:
    break
  elif result > 1000000000000000000:
    break

if result <= 1000000000000000000:
  print(result)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a.sort()
result = 1
for i in range(len(a)):
  result = result*a[i]
  if result == 0:
    break
  elif result > 1000000000000000000
    break

if result <= 1000000000000000000:
  print(result)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
result = 1
checker =False
for j in a:
  if j > 1000000000000000000:
    result = -1
    checker =True
if 0 in a:
  result = 0
  checker=True
while checker==False:
  import numpy as np
  a = np.array(a)
  result = a.prod()
  checker = True
    

if result <= 1000000000000000000:
  print(result)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
result = 1
checker =False
for j in a:
  if j > 1000000000000000000:
    result = -1
    checker =True
if 0 in a:
  result = 0
  checker=True
while checker==False:
  import numpy as np
  a = np.array(a)
  result = np.prod(a)
  checker = True
    

if result <= 1000000000000000000:
  print(result)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
#print(a)
#import functools
#import operator
import numpy

result = np.prod(a)

if result <= 1000000000000000000:
  print(result)
else:
  print(-1)
Problem p02555 (python)

Fixed submission:
N = int(input())
mod = 10 ** 9 + 7

table = [0,0,1]
if N >= 4:
  for i in range(3, N):
    table.append((table[i-1] + table[i-3]) % mod)
  print(table[-1] % mod)
elif N == 3:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
N = int(input())
table = [0,0,1]
if N >= 4:
  for i in range(3, N):
    table.append((table[i-1] + table[i-3]) % mod)
  print(table[-1] % mod)
elif N == 3:
  print(1)
else:
  print(0)
Problem p02641 (python)

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

table = [0] * 102
ans = X
dist = 102

for p in P:
  table[p] = 1

for i in range(102):
  if table[i] != 0:
    continue
  if abs(i - X) < dist:
    ans = i
    dist = abs(i - X)
  elif abs(i - X) == dist:
    ans = min(i, ans)

print(str(ans))

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

table = [0] * 102
ans = X
dist = 102

for p in range(P):
  table[p] = 1

for i in range(102):
  if table[i] == 1:
    continue
  if abs(i - X) < dist:
    ans = i
    dist = abs(i - X)
  elif abs(i - X) == dist:
    ans = min(i, ans)

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

table = [0] * 102
ans = X
dist = 102

for p in range(P):
  table[p] = 1

for i in range(102):
  if abs(i - X) < dist:
    ans = i
    dist = abs(i - X)
  elif abs(i - X) == dist:
    ans = min(i, ans)

print(str(ans))
Problem p02658 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = 1
max_limit = 10 ** 18
for i in range(N):
  ans *= A[i]
  if ans > max_limit:
    ans = -1
    break

if ans > max_limit:
  print(str(-1))
else:
  print(str(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
a.sort()
ans = 1
max_limit = 10 ** 18
for i in range(N):
  ans *= A[i]
  if ans > max_limit:
    ans = -1
    break

if ans > max_limit:
  print(str(-1))
else:
  print(str(ans))
Problem p03485 (python)

Fixed submission:

import math
a, b = map(int, input().split())
multi = math.ceil((a + b) / 2)

print(str(multi))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
multi = math.ceil((a + b) / 2)

print(str(multi))
Problem p03720 (python)

Fixed submission:
N, M = list(map(int, input().split()))
A = [0 for _ in range(N)]

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

for i in range(N):
  print(A[i])

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

for i range(N):
  print(str(A[i]))
Problem p03854 (python)

Fixed submission:
A = input()
A = A[::-1]
divide = [i[::-1] for i  in ["dream", "dreamer", "erase", "eraser"]]

flag = 1
while flag and A:
  flag = 0
  for word in divide:
    if A.startswith(word):
      A = A[len(word):]
      flag = 1

if len(A) == 0:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
A = input()
A = A[::-1]
divide = [i[::-1] for i  in ["dream", "dreamer", "erase", "eraser"]]

flag = 1
while flag and A:
  flag = 0
  for word in divide:
    if A.startswith(word):
      A = A[len(word):]
      print(A)
      flag = 1

if len(A) == 0:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
A = input()
A = A[::-1]
divide = [i[::-1] for i  in ["dream", "dreamer", "erase", "eraser"]]
print(A)
print(divide)
flag = 1
while flag and A:
  flag = 0
  for word in divide:
    if A.startswith(word):
      A = A[len(word):]
      print(A)
      flag = 1

if len(A) == 0:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
A = input()
A = A[::-1]
divide = [i[::-1] for i  in ["dream", "dreamer", "erase", "eraser"]]

flag = 1
while flag and A:
  flag = 0
  for word in divide:
    if A.startswith(word): # 先頭が一致したら
      A = A[len(word):] # 該当文字分だけスライス
      print(A)
      flag = 1

if len(A) == 0:
  print('Yes')
else:
  print('No')
Problem p02582 (python)

Fixed submission:
s=input()
ans = 0
if "RRR" in s: ans = 3
elif "RR" in s: ans = 2
elif "R" in s: ans = 1
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
ans = 0
if "RRR" in s: ans = 3
elif "RR" in s: ans = 2
else "R" in s: ans = 1
print(ans)
Problem p02606 (python)

Fixed submission:
l,r,d=list(map(int,input().split()))
print(r//d-(l-1)//d)

Buggy submission (verdict: Runtime Error):
l,r,d = list(map(int,input()split()))
print(r//d-(l-1)//d)
Problem p02607 (python)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
print(sum(1 for i in range(n) if i%2==0 and l[i]%2==1))

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input()split()))
ans=0
for i in range(n):
  if i%2==0 and l[i]%2==1:
    ans+=1
print(ans)
Problem p02608 (python)

Fixed submission:
n=int(input())
f = [0]*10005

for x in range(1,101):
	for y in range(1,101):
		for z in range(1,101):
			c = x**2+y**2+z**2+x*y+y*z+z*x
			if c<=n: f[c]+=1
for i in range(1,n+1):
	print(f[i])

Buggy submission (verdict: Runtime Error):
    n=int(input())
    f=[0]*10005
    for x in range(1,101):
      for j in range(1,101):
        for z in range(1,101):
          c=x**2+j**2+z**2+x*j+j*z+z*x
          if c<=n:
            f[c]+=1
    for i in range(1,n+1):
      print(f[i])
Problem p02675 (python)

Fixed submission:
s=input()
if s[-1] in "24579":
	print("hon")
else:print("pon" if s[-1] in "0168" else "bon")

Buggy submission (verdict: Runtime Error):
s=input()
if s[1] in "24579":
	print("hon")
else:print("pon" if s[1] in "0168" else "bon")