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

Fixed submission:
n,q=map(int,input().split())
s=input()
lis=[list(map(int,input().split())) for i in range(q)]
g=[0]*n
cnt=0
for i in range(n-1):
  if s[i]=='A' and s[i+1]=='C':
    cnt+=1
    g[i+1]=cnt
  else:
    g[i+1]=cnt

for i in range(q):
  print(g[lis[i][1]-1]-g[lis[i][0]-1])

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=input()
lis=[list(map(int,input().split())) for i in range(q)]
for i in range(q):
  print((len(s[lis[i][0]-1:lis[i][1]])-s[lis[i][0]-1:lis[i][1]].replace('AC',''))//2)
Problem p03110 (python)

Fixed submission:
n=int(input())
a=[]
for i in range(n):
  x,v=input().split()
  a.append([x,v])
ans=0
for i in range(n):
  if a[i][1]=='BTC':
    ans+=380000*float(a[i][0])
  else:
    ans+=int(a[i][0])
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[list(map(int,input().split())) for i in range(n)]
ans=0
for i in range(n):
  if a[i][1]=='BTC':
    ans+=380000*a[i][0]
  else:
    ans+=a[i][0]
print(ans)
Problem p03126 (python)

Fixed submission:
n,m=map(int,input().split())
k=[]
a=[]
for i in range(n):
  b=list(map(int,input().split()))
  k.append(b[0])
  a.append(b[1:])
d={}
for i in range(n):
  for j in range(k[i]):
    if a[i][j] not in d:
      d[a[i][j]]=1
    else:
      d[a[i][j]]+=1
nd=list(d.values())
cnt=0
for i in range(len(nd)):
  if nd[i]==n:
    cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
k=[]
a=[]
for i in range(n):
  b=list(map(int,input().split()))
  k.append(b[0])
  a.append(b[1:])
d={}
for i in range(n):
  for j in range(k[i]):
    if a[i][j] not in d:
      d[a[i][j]]=1
    else:
      d[a[i][j]]+=1
nd=list(d.values())
cnt=0
for i in range(len(nd)):
  if nd[i]==n:
    cnt+=1
print(cnt
Problem p03148 (python)

Fixed submission:
from operator import itemgetter
n,k=map(int,input().split())
td=[list(map(int,input().split())) for _ in range(n)]
td.sort(key=itemgetter(1),reverse=True)
ans=0
kind=0
flg=[False]*n
sing,comp=[],[]
for i in range(n):
    t,d=td[i]
    t-=1
    if i<k:
        ans+=d
        if flg[t]:
            comp.append(d)
        else:
            flg[t]=True
            kind+=1
    else:
        if not flg[t]:
            sing.append(d)
            flg[t]=True
comp=comp[::-1]
cnt=ans
ans+=kind**2
#print(comp)
#print(sing)
if len(comp)>len(sing):
    for i in range(len(sing)):
        dc,ds=comp[i],sing[i]
        cnt+=ds-dc
        kind+=1
        ans=max(ans,cnt+kind**2)
else:
    for i in range(len(comp)):
        dc,ds=comp[i],sing[i]
        cnt+=ds-dc
        kind+=1
        ans=max(ans,cnt+kind**2)
print(ans)

Buggy submission (verdict: Runtime Error):
import heapq
n,k=map(int,input().split())
kind=[0]*n
s=set()
dt=[]
ans=0
for _ in range(n):
    t,d=map(int,input().split())
    ans+=d
    t-=1
    dt.append((d,t))
    s.add(t)
    kind[t]+=1
x=len(s)
ans+=x**2
sing,comp=[],[]
for d,t in dt:
    if kind[t]==1:
        heapq.heappush(sing,(d,t))
    elif kind[t]>=2:
        heapq.heappush(comp,(d,t))
for _ in range(n-k):
    ds,ts=heapq.heappop(sing)
    dc,tc=heapq.heappop(comp)
    if ds+x**2-(x-1)**2>dc:
        ans-=dc
        kind[tc]-=1
        if kind[tc]>=2:
            heapq.heappush(comp,(dc,tc))
        else:
            heapq.heappush(sing,(dc,tc))
        heapq.heappush(sing,(ds,ts))
    else:
        ans-=ds+x**2-(x-1)**2
        x-=1
        kind[ts]-=1
        heapq.heappush(comp,(dc,tc))
print(ans)
Problem p03150 (python)

Fixed submission:
s=input()
n=len(s)
a=str()
b=str()
k='keyence'
l='ecneyek'
j=0
for i in range(n):
  if a+s[i] in k:
    a+=s[i]
    j=i+1
  else:
    break
for i in range(7-j):
  if b+s[n-i-1] in l:
    b+=s[n-i-1]
  else:
    break
if a+b[::-1]==k:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
a=str()
b=str()
k='keyence'
l='ecneyek'
for i in range(n):
  if a+s[i] in k:
    a+=s[i]
    j=i
  else:
    break
for i in range(6-j):
  if b+s[n-i-1] in l:
    b+=s[n-i-1]
  else:
    break
if a+b[::-1]==k or a==k or b[::-1]==k:
  print('YES')
else:
  print('NO')
Problem p03165 (python)

Fixed submission:
s=input()
t=input()
n=len(s)
m=len(t)
dp=[[0]*(m+1) for _ in range(n+1)]
for i in range(1,n+1):
    for j in range(1,m+1):
        if s[i-1]==t[j-1]:
            if i>0 and j>0:
                dp[i][j]=dp[i-1][j-1]+1
        else:
            if i>0:
                dp[i][j]=max(dp[i][j],dp[i-1][j])
            if j>0:
                dp[i][j]=max(dp[i][j],dp[i][j-1])
leng=dp[n][m]
i,j=n,m
ans=""
while leng>0:
    if s[i-1]==t[j-1]:
        ans+=s[i-1]
        i-=1
        j-=1
        leng-=1
    else:
        if dp[i-1][j]==dp[i][j]:
            i-=1
        elif dp[i][j-1]==dp[i][j]:
            j-=1
print(ans[::-1])

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
n=len(s)
m=len(t)
dp=[[0]*m for _ in range(n)]
if s[0]==t[0]:
    dp[0][0]=1
for i in range(n):
    for j in range(m):
        if s[i]==t[j]:
            if i>0 and j>0:
                dp[i][j]=dp[i-1][j-1]+1
        else:
            if i>0:
                dp[i][j]=max(dp[i][j],dp[i-1][j])
            if j>0:
                dp[i][j]=max(dp[i][j],dp[i][j-1])
leng=dp[n-1][m-1]
i,j=n-1,m-1
ans=""
while leng>0:
    if s[i]==t[j]:
        ans+=s[i]
        i-=1
        j-=1
        leng-=1
    else:
        if dp[i-1][j]==dp[i][j]:
            i-=1
        elif dp[i][j-1]==dp[i][j]:
            j-=1
print(ans[::-1])
Problem p03213 (python)

Fixed submission:
n=int(input())
div=[0]*(n+10)
for i in range(1,n+1):
  k=i
  for j in range(1,int(i**0.5)+1):
    cnt=0
    while k%(j+1)==0:
      k//=(j+1)
      cnt+=1
    div[j+1]+=cnt
  if k>1:
    div[k]+=1
ans=0
d=dict()
for i,j,k in [[4,4,2],[24,2,1000],[14,4,1000],[74,1000,1000]]:
  cnti,cntj,cntk=0,0,0
  for l in range(2,n+1):
    if j==1000 and k==1000:
      if div[l]>=i:
        ans+=1
    for m in range(2,n+1):
      if l!=m and j!=1000 and k==1000:
        if div[l]>=i and div[m]>=j:
            ans+=1
      for o in range(2,n+1):
        if (m,l) not in d:
          if l!=o and l!=m and m!=o:
            if i!=1000 and j!=1000 and k!=1000:
              if div[l]>=i and div[m]>=j and div[o]>=k:
                ans+=1
                d[(l,m)]=0
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
div=[0]*(n+1)
for i in range(1,n+1):
  k=i
  for j in range(1,int(i**0.5)+1):
    cnt=0
    while k%(j+1)==0:
      k//=(j+1)
      cnt+=1
    div[j+1]+=cnt
  if k>1:
    div[k]+=1
ans=0
d=dict()
for i,j,k in [[4,4,2],[24,2,1000],[14,4,1000],[74,1000,1000]]:
  cnti,cntj,cntk=0,0,0
  for l in range(2,n+1):
    if j==1000 and k==1000:
      if div[l]>=i:
        ans+=1
    for m in range(2,n+1):
      if l!=m and j!=1000 and k==1000:
        if div[l]>=i and div[m]>=j:
            ans+=1
      for o in range(2,n+1):
        if (m,l) not in d:
          if l!=o and l!=m and m!=o:
            if i!=1000 and j!=1000 and k!=1000:
              if div[l]>=i and div[m]>=j and div[o]>=k:
                ans+=1
                d[(l,m)]=0
print(ans)
Problem p03231 (python)

Fixed submission:
from fractions import gcd
n,m=map(int,input().split())
s=input()
t=input()
if gcd(n,m)==1:
  if s[0]==t[0]:
    print(n*m)
  else:
    print(-1)
else:
  k=n//gcd(n,m)
  l=m//gcd(n,m)
  for i in range(gcd(n,m)):
    if s[i*k]!=t[i*l]:
      print(-1)
      exit()
  print(k*l*gcd(n,m))

Buggy submission (verdict: Runtime Error):
from fractions import gcd
n,m=map(int,input().split())
s=input()
t=input()
if gcd(n,m)==1:
  if s[0]==t[0]:
    print(n*m)
  else:
    print(-1)
else:
  k=n//gcd(n,m)
  l=m//gcd(n,m)
  if len(s)<=len(t):
    for i in range(k):
      if s[i*k]!=t[i*l]:
        print(-1)
        exit()
    print(k*l*gcd(n,m))
  else:
    for i in range(l):
      if s[i*k]!=t[i*l]:
        print(-1)
        exit()
    print(k*l*gcd(n,m))
Problem p03238 (python)

Fixed submission:
n=int(input())
if n==1:
  print('Hello World')
else:
  a=int(input())
  b=int(input())
  print(a+b)

Buggy submission (verdict: Runtime Error):
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
ans=float('inf')
ok=False
for i in range(n):
  if ct[i][1]<=t:
    ans=min(ans,ct[i][0])
    ok=True
if ok:
  print(ans)
else:
  print('TLE')

Buggy submission (verdict: Runtime Error):
n=int(input())
a=int(input())
b=int(input())
if n==1:
  print('Hello World')
else:
  print(a+b)
Problem p03261 (python)

Fixed submission:
n=int(input())
w=[input() for i in range(n)]
d={}
for i in range(n):
  if w[i] not in d:
    d[w[i]]=1
  else:
    print('No')
    exit()
for i in range(n-1):
  if w[i][len(w[i])-1]!=w[i+1][0]:
    print('No')
    exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
n=int(input())
w=[input() for i range(n)]
d={}
for i in range(n):
  if w[i] not in d:
    d[w[i]]=1
  else:
    print('No')
    exit()
for i in range(n-1):
  if w[i][len(w[i])-1]!=w[i+1][0]:
    print('No')
    exit()
print('Yes')
Problem p03354 (python)

Fixed submission:
import sys
input=sys.stdin.readline
def main():
  n,m=map(int,input().split())
  p=list(map(int,input().split()))
  xy=[list(map(int,input().split())) for i in range(m)]
  class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)
  uf=UnionFind(n)
  for i in range(m):
    uf.union(p[xy[i][0]-1]-1,p[xy[i][1]-1]-1)
  ans=0
  for i in range(n):
    if uf.same(i,p[i]-1):
      ans+=1
  print(ans)
if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
import sys
input=sys.stdin.readline
def main():
  n,m=map(int,input().split())
  p=list(map(int,input().split()))
  xy=[list(map(int,input().split())) for i in range(n)]
  class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)
  uf=UnionFind(n)
  for i in range(m):
    uf.union(p[xy[i][0]-1]-1,p[xy[i][1]-1]-1)
  ans=0
  for i in range(n):
    if uf.same(i,p[i]-1):
      ans+=1
  print(ans)
if __name__=='__main__':
  main()
Problem p03355 (python)

Fixed submission:
s=input()
k=int(input())
n=len(s)
ans=dict()
for i in range(n):
  t=str()
  for j in range(min(5,n-i)):
    t+=s[i+j]
    ans[t]=0
ans=sorted(list(ans.keys()))
print(ans[k-1])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
d=dict()
if len(s)==1:
  print(s)
else:
  for i in range(len(s)-1):
    a=s[i]
    if a not in d:
      d[a]=0
    for j in range(i+1,len(s)):
      a+=s[j]
      if a not in d:
        d[a]=0
  l=list(d)
  l.sort()
  print(l[k-1])
Problem p03379 (python)

Fixed submission:
n=int(input())
x=list(map(int,input().split()))
sx=sorted(x)
a=sx[n//2]
b=sx[n//2-1]
for i in range(n):
  if x[i]>=a:
    print(b)
  else:
    print(a)

Buggy submission (verdict: Runtime Error):
n=int(input())
x=list(map(int,input().split()))
for i in range(n):
  if i+1<(2+n)//2:
    print(x[(n+2)//2])
  else:
    print(x[(n+2)//2-1])
Problem p03401 (python)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
a=[0]
for i in range(n):
  a.append(h[i])
a.append(0)
s=0
for i in range(n+1):
  s+=abs(a[i]-a[i+1])
for i in range(1,n+1):
  if min(a[i+1],a[i-1])<=a[i]<=max(a[i-1],a[i+1]):
    print(s)
  elif a[i]<=min(a[i-1],a[i+1])<=max(a[i-1],a[i+1]):
    print(s-2*abs(a[i]-min(a[i+1],a[i-1])))
  else:
    print(s-2*abs(max(a[i-1],a[i+1])-a[i]))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[0]
a.append(map(int,input().split()))
a.append(0)
s=abs(a[0])+abs(a[n-1])
for i in range(n-1):
  s+=abs(a[i]-a[i+1])
for i in range(1,n):
  if min(a[i+1],a[i-1])<=a[i]<=max(a[i-1],a[i+1]):
    print(s)
  elif a[i]<=min(a[i-1],a[i+1])<=max(a[i-1],a[i+1]):
    print(s-2*abs(a[i]-min(a[i+1],a[i-1])))
  else:
    print(s-2*abs(max(a[i-1],a[i+1])-a[i]))
Problem p03493 (python)

Fixed submission:
s=input()
ans=0
for i in range(3):
    if s[i]=="1":
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans=0
while 1:
    for i in range(n):
        if a[i]%2:
            print(ans)
            exit()
        a[i]//=2
    ans+=1
Problem p03565 (python)

Fixed submission:
s=input()
t=input()
a=-1
n=len(s)
k=len(t)
if k>n:
  print('UNRESTORABLE')
else:
  ans=str()
  for i in range(n):
    ok=True
    if n-i>=k:
      for j in range(k):
        if t[j]!=s[i+j] and s[i+j]!='?':
          ok=False
      if ok:
        a=i
  if a==-1:
    print('UNRESTORABLE')
  else:
    for i in range(n):
      if a<=i<=a+k-1:
        ans+=t[i-a]
      else:
        if s[i]=='?':
          ans+='a'
        else:
          ans+=s[i]
    print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
a=-1
n=len(s)
k=len(t)
if k>n:
  print('UNRESTORABLE')
else:
  ans=str()
  for i in range(n):
    ok=True
    if n-i>=k:
      for j in range(k):
        if t[j]!=s[i+j] and s[i+j]!='?':
          ok=False
      if ok:
        a=i
  if a==-1:
    print('UNRESTORABLE')
  else:
    for i in range(n):
      if a<=i<=a+k-1:
        ans+=t[i-a]
      else:
        if s[i]=='?':
          ans+='a'
        else:
          ans+=s[i]
print(ans)
Problem p03625 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
lis=[]
cnt=0
for i in range(n-1):
  if a[i+1]==a[i]:
    cnt+=1
  else:
    if cnt>=1:
      lis.append([a[i],cnt])
    cnt=0
if cnt>=1:
  lis.append([a[n-1],cnt])
lis.sort(reverse=True)
if len(lis)>=2:
  if lis[0][1]>=3:
    print(lis[0][0]**2)
  else:
    print(lis[0][0]*lis[1][0])
elif len(lis)==1:
  if lis[0][1]>=3:
    print(lis[0][0]**2)
  else:
    print(0)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
d={}
for i in range(n):
  if a[i] not in d:
    d[a[i]]=1
  else:
    d[a[i]]+=1
lis=sorted(d.items(),reverse=True)
for i in range(len(lis)):
  if lis[i][1]<2:
    lis.remove(lis[i])
lis.sort(reverse=True)
if len(lis)>=2:
  if lis[0][1]>=4:
    print(lis[0][0]**2)
  else:
    print(lis[0][0]*lis[1][0])
elif len(lis)==1:
  if lis[0][1]>=4:
    print(lis[0][0]**2)
  else:
    print(0)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
k=0
i=0
cnt=0
lis=[]
while i<=n-2 or cnt<2:
  if a[i]==a[i+1] and a[i]!=k:
    lis.append(a[i])
    k=a[i]
    cnt+=1
  i+=1
if len(lis)>=2:
  print(lis[0]*lis[1])
else:
  print(0)
Problem p03759 (python)

Fixed submission:
a,b,c=map(int,input().split())
if 2*b==a+c:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
n=int(input())
d=[dict() for _ in range(n)]
for i in range(n):
    for c in input():
        if c not in d[i]:
            d[i][c]=1
        else:
            d[i][c]+=1
ans=""
for i in range(26):
    mini=10**18
    for j in range(n):
        if chr(97+i) not in d[j]:
            mini=0
        else:
            mini=min(mini,d[j][chr(97+i)])
    ans+=mini*chr(97+i)
print(ans)
Problem p03777 (python)

Fixed submission:
a,b=input().split()
hatsugen=["H","D"]
idx=hatsugen.index(b)
if a=="H":
    print(hatsugen[idx])
else:
    print(hatsugen[1-idx])

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
hatsugen=["H","D"]
idx=hatsugen.index(b)
if a=="H":
    print(hatsugen[idx])
else:
    print(hatsugen[1-idx])
Problem p03838 (python)

Fixed submission:
x,y=map(int,input().split())
if (x<0 and y<0 or x>0 and y>0) and y<x:
  print(abs(x-y)+2)
elif x>=0 and y<=0:
  print(abs(abs(x)-abs(y))+1)
elif x<0 and y>0 and y>x:
    print(abs(abs(x)-abs(y))+1)
else:
    print(y-x)

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split())
if x<0 and y<0 or x>0 and y>0 and y<x:
  print(abs(x-y)+2)
elif x=0 or y=0 and y<x:
  print(abs(x-y)+1)
else:
  print(min(abs(x-y),abs(-x-y)+1))
Problem p03848 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
mod=10**9+7
d=dict()
for i in range(n):
  if a[i] not in d:
    d[a[i]]=1
  else:
    d[a[i]]+=1
d=sorted(list(d.items()))
if n%2:
  for i in range(len(d)):
    if i==0:
      if d[i][0]!=0 or d[i][1]!=1:
        print(0)
        exit()
    else:
      if d[i][0]!=i*2 or d[i][1]!=2:
        print(0)
        exit()
  print(pow(2,len(d)-1,mod))
else:
  for i in range(len(d)):
    if d[i][0]!=2*i+1 or d[i][1]!=2:
      print(0)
      exit()
  print(pow(2,len(d),mod))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
mod=10**9+7
d=dict()
for i in range(n):
  if a[i] not in d:
    d[a[i]]=1
  else:
    d[a[i]]+=1
d=sorted(list(d.items()))
if n%2:
  for i in range(len(d)):
    if i==0:
      if d[i][0]!=0 or d[i][1]!=1:
        print(0)
        exit()
    else:
      if d[i][0]!=i*2 or d[i][1]!=2:
        print(0)
        exit()
  print(pow(2,len(d)-1,mod)
else:
  for i in range(len(d)):
    if d[i][0]!=2*i+1 or d[i][1]!=2:
      print(0)
      exit()
  print(2,len(d),mod)
Problem p03994 (python)

Fixed submission:
s=input()
k=int(input())
sl=[]
n=len(s)
for i in range(n):
  if s[i]!='a':
    if 26-(ord(s[i])-97)<=k:
      sl.append('a')
      k-=26-(ord(s[i])-97)
    else:
      sl.append(s[i])
  else:
    sl.append(s[i])
if k>0:
  if k%26!=0:
    sl[n-1]=chr(ord(sl[n-1])+k%26)
print(''.join(sl))

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
sl=[]
n=len(s)
for i in range(n):
  if s[i]!='a':
    if 26-(ord(s[i])-97)<=k:
      sl.append('a')
      k-=26-(ord(s[i])-97)
    else:
      sl.append(s[i])
  else:
    sl.append(s[i])
if k>0:
  for i in range(n):
    sl[n-i-1]=chr(ord(sl[n-1-i])+k)
    break
print(''.join(sl))
Problem p04029 (python)

Fixed submission:
n=int(input())
ans=0
for num in range(1,n+1):
    ans+=num
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans=10**18
for num in range(-100,101):
    cnt=0
    for i in range(n):
        cnt+=(num-a[i])**2
    ans=min(ans,cnt)
print(ans)
Problem p02621 (python)

Fixed submission:
a = int(input())

print(int(a+a**2+a**3))

Buggy submission (verdict: Runtime Error):
a = int(input())

print(int((a*(a**3-1)/(a-1))))
Problem p02639 (python)

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

print(a.index(0)+1)

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

print(a.index("0"))

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

print(list.index("0"))
Problem p02645 (python)

Fixed submission:
a = input()

print(a[0:3])

Buggy submission (verdict: Runtime Error):
a = input(str(a))

print(a[0:2])
Problem p02646 (python)

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

if w>=v:
    print("NO")

elif (abs(a-b)/abs(v-w))<=t:
        print("YES")

else :
        print("NO")

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

if w>=v:
    print("NO")

elif abs(a-b)/abs(v-w)<=t:
        print("YES")

else :
        print("NO")

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

if w>=v:
    print("NO")

    elif abs(a-b)/abs(v-w)<=T:
        print("YES")

    else :
        print("NO")
Problem p02657 (python)

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

print(A*B)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 1
 
 
i = [int(a) for a in input().split()]
 
if 0 in i:
  print(0)
  break
 
	for b in range(N):
  		ans = ans * i[b]
 
  		if ans > 10**18:
   		 	ans = -1
 
print(ans)
Problem p02675 (python)

Fixed submission:
N = input()

M = int(N) % 10

if M == 2 or M == 4 or M == 5 or M == 7 or M == 9:
    print("hon")

elif M == 0 or M == 1 or M == 6 or M == 8:
    print("pon")

elif M == 3:
    print("bon")

Buggy submission (verdict: Runtime Error):
N = input()

M = N%10

if(M == 2 or M == 4 or M == 5 or M == 7 or M == 9):
    print("hon")

else if(M == 0 or M == 1 or M == 6 or M == 8):
    print("pon")

else if(M == 3):
    print("bon")
Problem p03331 (python)

Fixed submission:
N=int(input())
N_sum=[]
for A in range(1,int(N/2)+1):
  B=N-A
  N_sum.append(sum(map(int,str(A)+str(B))))
print(min(N_sum))

Buggy submission (verdict: Runtime Error):
N=int(input())
N_sum=[]
for A in range(1,int((N+1)/2)):
  B=N-A
  N_sum.append(sum(map(int,str(A)+str(B))))
print(min(N_sum))