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

Fixed submission:
a, b = map(int, input().split())
mod = pow(10,9) + 7

def cal(a,i):
  min = i*(i-1)/2
  max = a*(a-1)/2 - (a-i)*(a-i-1)/2
  return max - min + 1

count = 0
for i in range(a-b+2):
  count += cal(a+1,i+b)
print(int(count % mod))

Buggy submission (verdict: Runtime Error):
from math import factorial
a, b = map(int, input().split())
 
def count(x, y):
  a = factorial(x) / factorial(y) / factorial(x - y)
  return a
 
if(a+1== b):
  print(1)
else:
  count = 0
  for i in range(a-b+2):
    count += count(a,i+b)
  print(count)

Buggy submission (verdict: Runtime Error):
from math import factorial
a = factorial(n) / factorial(r) / factorial(n - r)
a, b = map(int, input().split())

def count(x, y):
  a = factorial(x) / factorial(y) / factorial(x - y)
  return a

if(a+1== b):
  print(1)
else:
  count = 0
  for i in range(a-b+2):
    count += count(a,i+b)
  print(count)
Problem p02630 (python)

Fixed submission:
from collections import defaultdict

N = int(input())
nums = list(map(int,input().split()))
Q = int(input())

res = 0

dct = defaultdict(int)
for _ in range(N):
  n = nums.pop()
  dct[n] += 1
  res += n

for _ in range(Q):
  B, C = map(int,input().split())
  if B in dct:
    n = dct.pop(B)
    res += (C - B) * n
    if C in dct:
      dct[C] += n
    else:
      dct[C] = n
  
  print(res)

Buggy submission (verdict: Runtime Error):
N = int(input())
nums = [int(s) for s in input().rstrip().split()]
Q = int(input())

dct = {}
for k in range(N):
  n = nums[k]
  if n in dct:
    dct[n] += 1
  else:
    dct[n] = 1

for _ in range(Q):
  B, C =(int(s) for s in input().rstrip().split())
  if C in dct:
    dct[C] += dct.pop(B)
  else:
    dct[C] = dct.pop(B)

  sum = 0
  for k, v in dct.items():
    sum += k * v
  
  print(sum)
Problem p02690 (python)

Fixed submission:
x=int(input())

def rt5(a):
  if a==0:
    return 0
  i=1
  while 1:
    s=i**5
    if a==s:
      return i
    elif a==-s:
      return -i
    elif abs(a)<s:
      return False
    i+=1

b=0

while 1:
  a5=x+b**5
  a=rt5(a5)
  if a==False:
    pass
  else:
    print(a,b)
    exit()
  
  a5=x-b**5
  a=rt5(a5)
  if a==False:
    pass
  else:
    print(a,-b)
    exit()
  b+=1

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

b=0

while 1:
  a5=x+b**5
  a=a5**0.2
  if a-int(a)==0:
    print(int(a),b)
    exit()
  
  a5=x-b**5
  a=a5**0.2
  if a-int(a)==0:
    print(int(a),-b)
    exit()
  
  b+=1
Problem p02761 (python)

Fixed submission:
n,m=map(int,input().split())
l=[list(map(int,input().split())) for _ in range(m)]

arr=[str(i) for i in range(10**(n-1) if n>1 else 0,10**n)]

for x in arr:
  for i,tmp in enumerate(l):
    s,c=tmp
    if x[s-1]!=str(c):
      break
  else:
    print(x)
    exit()

print(-1)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=[list(map(int,input().split())) for _ in range(m)]

arr=[str(i) for i in range(10**(n-1),10**n)]

for x in arr:
  flag=[False]*n
  for i,tmp in enumerate(l):
    s,c=tmp
    if x[s-1]==str(c):
      flag[i]=True
  if all(flag):
    print(x)
    exit()
print(-1)
Problem p02780 (python)

Fixed submission:
n,k=map(int,input().split())
p=list(map(int,input().split()))

e=[0]*n

for i in range(n):
  e[i]=(1+p[i])/2
  if i!=0:
    e[i]+=e[i-1]

arr=[]

if n==k:
  print(e[-1])
  exit()

for i in range(k,n):
  s=i-k
  arr.append(e[i]-e[s])

print(max(arr))

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

e=[0]*n

for i in range(n):
  e[i]=(1+p[i])/2
  if i!=0:
    e[i]+=e[i-1]

arr=[]

for i in range(k,n):
  s=i-k
  arr.append(e[i]-e[s])

print(max(arr))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
e=[(x+1)/2 for x in list(map(int,input().split()))]

e3=[sum(e[i:i+k]) for i in range(n-2)]

print(max(e3))
Problem p02802 (python)

Fixed submission:
n,m=map(int,input().split())
l=[input().split() for _ in range(m)]
arr=[]
ac,wa=0,0
acl=[False for _ in range(n)]
for r in l:
  p,s=int(r[0])-1,r[1]
  if s=='AC' and acl[p]==False:
    arr.append([p,s])
    acl[p]=True
  elif s=='WA' and acl[p]==False:
    arr.append([p,s])
    
for r in arr:
  p,s=r
  if s=='WA' and acl[p]:
    wa+=1
  elif s=='AC':
    ac+=1
    
print(ac,wa)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=[input().split() for _ in range(m)]
arr=[]
ac,wa=0,0
acl=[False for _ in range(m)]
for r in l:
  p,s=int(r[0]),r[1]
  if s=='AC' and acl[p]==False:
    arr.append([p,s])
    acl[p]=True
  elif s=='WA' and acl[p]==False:
    arr.append([p,s])
    
for r in arr:
  p,s=r
  if s=='WA' and acl[p]:
    wa+=1
  elif s=='AC':
    ac+=1
    
print(ac,wa)
Problem p02947 (python)

Fixed submission:
n=int(input())
s=[''.join(sorted(input())) for _ in range(n)]
ans=0
cnt={}
for i in range(n):
  if s[i] in cnt:
    cnt[s[i]]+=1
  else:
    cnt[s[i]]=1
print(sum(cnt[key]*(cnt[key]-1)//2 for key in cnt))

Buggy submission (verdict: Runtime Error):
n=int(input())
s=[input().sort() for _ in range(n)]
cnt=0
for i in range(n):
  for j in range(n):
    if i>=j:
      continue
    if s[i]==s[j]:
      cnt+=1
print(cnt)
Problem p02969 (python)

Fixed submission:
print(3*int(input())**2)

Buggy submission (verdict: Runtime Error):
print(3*int(input())**2
Problem p03147 (python)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
arr=[x for x in h]
cnt=0

while 1:
  if all([x==0 for x in h]):
    break
  for i in range(n):
    if h[i]!=0:
      s=i
      break
  e=s
  for i in range(s,n-1):
    if h[s]<=h[i+1]:
      e+=1
    else:
      break
  h=[h[i]-1 if s<=i<=e else h[i] for i in range(n)]
  cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
arr=[x for x in h]
cnt=0

while 1:
  for i in range(n):
    if h[i]!=0:
      s=i
      break
  e=s
  for i in range(s,n-1):
    if h[s]<=h[i+1]:
      e+=1
    else:
      break
  h=[h[i]-1 if s<=i<=e else h[i] for i in range(n)]
  cnt+=1
  if all([x==0 for x in h]):
    break
print(cnt)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
n,s=map(int,input().split())
a=list(map(int,input().split()))
d=[[0]*(s+1) for _ in range(n+1)]
d[0][0]=1
for j in range(0,s+1):
    for i in range(1,n+1):
        d[i][j]=2*d[i-1][j]
        if a[i-1]<=j:
            d[i][j]+=d[i-1][j-a[i-1]]
        d[i][j]=d[i][j]%998244353
print(d[n][s])
Problem p02662 (python)

Fixed submission:
n,s=map(int,input().split()) 
a=list(map(int,input().split()))
d=[[0]*(s+1) for _ in range(n+1)]
d[0][0]=1
for j in range(0,s+1):
    for i in range(1,n+1):
        d[i][j]=2*d[i-1][j]
        if a[i-1]<=j:
            d[i][j]+=d[i-1][j-a[i-1]]
        d[i][j]=d[i][j]%998244353
print(d[n][s])

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(3000)

def test(a,s,i):
    if i==len(a) or a[i]>s : return []
    if a[i]==s:return [[i]]
    else: return [[i]+x for x in test(a,s-a[i],i+1)]+test(a,s,i+1)
        

n,s=map(int,input().split())
a=list(map(int,input().split()))
a=sorted(a)
l=test(a,s,0)
out=0
for s in l:
    out+=2**(len(a)-len(s))
print(out%998244353)

Buggy submission (verdict: Runtime Error):
def test(a,s,i):
    if i==len(a) or a[i]>s : return []
    if a[i]==s:return [[i]]
    else: return [[i]+x for x in test(a,s-a[i],i+1)]+test(a,s,i+1)
        

n,s=map(int,input().split())
a=list(map(int,input().split()))
a=sorted(a)
l=test(a,s,0)
out=0
for s in l:
    out+=2**(len(a)-len(s))
print(out)

Buggy submission (verdict: Runtime Error):
def test(a,s,i):
    if i==len(a) or a[i]>s : return []
    if a[i]==s:return [[i]]
    else: return [[i]+x for x in test(a,s-a[i],i+1)]+test(a,s,i+1)
        

n,s=map(int,input().split())
a=list(map(int,input().split()))
a=sorted(a)
print(a)
l=test(a,s,0)
print(l)
out=0
for s in l:
    out+=2**(len(a)-len(s))
print(out)
Problem p02678 (python)

Fixed submission:
n,m=map(int,input().split())
graph=[[] for _ in range(n)]

for _ in range(m):
    a,b=map(int,input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

sign=[-1]*n
sign[0]=0
work=[]
work_next=graph[0]
for x in work_next:
    sign[x]=0


while work_next:
    work=work_next[:]
    work_next=[]
    for x in work:
        for y in graph[x]:
            if sign[y]>=0 : continue
            if y in work_next : continue
            sign[y]=x
            work_next.append(y)

if -1 in sign : print("No");exit()
print("Yes")
for i in range(1,n):
    print(sign[i]+1)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
lst=[list(map(int,input().split())) for i in range(m)]
con=[[] for i in range(m+1)]
check=[0 for i in range(n+1)]
for x in lst: con[x[0]].append(x[1]);con[x[1]].append(x[0])
check[1]=1
dis=[[1]]
i=0
while check.count(0)>1:
    work=[]
    for x in dis[i]:
        for y in con[x]:
            if check[y] : continue
            else : 
                work.append(y)
                check[y]=x
    dis.append(work)
    i+=1
print("Yes")
for j in range(2,n+1):
    print(check[j])
Problem p02845 (python)

Fixed submission:
def main():
    n=int(input())
    lst=list(map(int,input().split()))
    mod=10**9+7
    sm=1
    color=[0,0,0]
    for x in lst:
        if x not in color : sm=0;break
        sm*=color.count(x)
        sm%=mod
        color[color.index(x)]+=1
    print(sm)

main()

Buggy submission (verdict: Runtime Error):
def main():
    n=int(input())
    lst=list(map(int,input().split()))
    mod=10**9+7
    sm=1
    color=[0,0,0]
    for x in lst:
        sm*=color.count(x)
        sm%=mod
        color[color.index(x)]+=1
    print(sm)

main()
Problem p02936 (python)

Fixed submission:
import sys
sys.setrecursionlimit(1000000)

def val_add(i,con,val):
    if con[i] :
        for j in con[i]:
            val[j]+=val[i]
            val_add(j,con,val)

def tree(i,con):
    if not con[i]: pass
    else :
        for j in con[i]:
            con[j].remove(i)
            tree(j,con)

def main():
    n,q=map(int,input().split())
    con=[[] for _ in range(n)]
    val=[0]*n
    for _ in range(n-1):
        a,b=map(int,input().split())
        con[a-1].append(b-1)
        con[b-1].append(a-1)

    tree(0,con)

    for _ in range(q):
        p,x=map(int,input().split())
        val[p-1]+=x

    val_add(0,con,val)


    print(" ".join(map(str,val)))

main()

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000)

def val_add(i,con,val):
    if con[i] :
        for j in con[i]:
            val[j]+=val[i]
            val_add(j,con,val)

def tree(i,con):
    if not con[i]: pass
    else :
        for j in con[i]:
            con[j].remove(i)
            tree(j,con)

def main():
    n,q=map(int,input().split())
    con=[[] for _ in range(n)]
    val=[0]*n
    for _ in range(n-1):
        a,b=map(int,input().split())
        con[a-1].append(b-1)
        con[b-1].append(a-1)

    tree(0,con)

    for _ in range(q):
        p,x=map(int,input().split())
        val[p-1]+=x

    val_add(0,con,val)


    print(" ".join(map(str,val)))

main()

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000)

def search(i,x,con,val):
    if con[i] :
        for j in con[i]:
            search(j,x,con,val)
    val[i]+=x

def tree(i,con):
    if not con[i]: pass
    else :
        for j in con[i]:
            con[j].remove(i)
            tree(j,con)

def main():
    n,q=map(int,input().split())
    con=[[] for _ in range(n)]
    val=[0]*n
    for _ in range(n-1):
        a,b=map(int,input().split())
        con[a-1].append(b-1)
        con[b-1].append(a-1)

    tree(0,con)

    for _ in range(q):
        p,x=map(int,input().split())
        search(p-1,x,con,val)

    print(" ".join(map(str,val)))

main()

Buggy submission (verdict: Runtime Error):
def search(i,x,con,val):
    if con[i] :
        for j in con[i]:
            search(j,x,con,val)
    val[i]+=x

def tree(i,con):
    if not con[i]: pass
    else :
        for j in con[i]:
            con[j].remove(i)
            tree(j,con)


n,q=map(int,input().split())
con=[[] for _ in range(n)]
val=[0]*n
for _ in range(n-1):
    a,b=map(int,input().split())
    con[a-1].append(b-1)
    con[b-1].append(a-1)

tree(0,con)

for _ in range(q):
    p,x=map(int,input().split())
    search(p-1,x,con,val)

print(" ".join(map(str,val)))

Buggy submission (verdict: Runtime Error):
def search(i,x,con,val):
    if con[i] :
        for j in con[i]:
            search(j,x,con,val)
    val[i]+=x


n,q=map(int,input().split())
con=[[] for _ in range(n)]
val=[0]*n
for _ in range(n-1):
    a,b=map(int,input().split())
    con[a-1].append(b-1)

for _ in range(q):
    p,x=map(int,input().split())
    search(p-1,x,con,val)

print(" ".join(map(str,val)))
Problem p03752 (python)

Fixed submission:
from itertools import combinations

n,k=map(int,input().split())
lst=list(map(int,input().split()))

work=lst[0]
ini=[x-work for x in lst]
ini_seen=[0]
work=0
for i in range(1,n):
    if ini[i]>work:
        work=ini[i]
        ini_seen.append(i)

mn=None
for x in combinations(range(n-len(ini_seen)),k-len(ini_seen)):
    sm=0
    work=0
    xtoken=0
    count=1
    for i in range(1,n):
        if i in ini_seen:
            count+=1
            if work<ini[i] : work=ini[i]
            else:
                work+=1
                sm+=work-ini[i]
        elif xtoken<len(x) and i==x[xtoken]+count:
            work+=1
            sm+=work-ini[i]
            xtoken+=1
    if not mn : mn=sm
    if mn>sm : mn=sm
print(mn)

Buggy submission (verdict: Runtime Error):
from itertools import combinations

n,k=map(int,input().split())
lst=list(map(int,input().split()))

work=lst[0]
ini=[x-work for x in lst]
ini_seen=[0]
work=0
for i in range(1,n):
    if ini[i]>work:
        work=ini[i]
        ini_seen.append(i)

mn=None
for x in combinations(range(n-len(ini_seen)),k-len(ini_seen)):
    sm=0
    work=0
    xtoken=0
    count=1
    for i in range(1,n):
        if i in ini_seen:
            count+=1
            if work<ini[i] : work=ini[i]
            else:
                work+=1
                sm+=work-ini[i]
        elif i==x[xtoken]+count:
            work+=1
            sm+=work-ini[i]
            xtoken+=1
            if xtoken==k-len(ini_seen):break



    if not mn : mn=sm
    if mn>sm : mn=sm
print(mn)
Problem p03601 (python)

Fixed submission:
import numpy as np

def ceil(a):
    return int(np.ceil(a))

def sol2():
    A,B,C,D,E,F = map(int, input().split(' '))
    na, nb, nc, nd = ceil(F/A/100),ceil(F/B/100),ceil(E*F/C/100),ceil(E*F/D/100) 
    sug = np.arange(0,nc).reshape(1,1,nc,1)*C+np.arange(0,nd).reshape(1,1,1,nd)*D
    wat = np.arange(0,na).reshape(na,1,1,1)*A*100+np.arange(0,nb).reshape(1,nb,1,1)*B*100
    sug2=np.unique(sug[sug<=F*F/100])
    wat2=np.unique(wat[wat<=F])
    
    if len(wat2)==1:
        print(0,0)
        return
    elif E==0:
        print(wat2[1],0)
        return
    
    tot =  wat2[1:].reshape(len(wat2[1:]),1) + sug2
    e2 = E/(100+E)
    dense = (sug2/tot)[tot<=F]
    
    maxi = np.argmax(dense[dense<=e2])
    stot = tot[tot<=F][dense<=e2]
    ssug = (sug2 + tot*0)[tot<=F][dense<=e2]
    
    if dense[maxi] ==0:
        print(wat2[1],0)
    else:
        print(int(stot[maxi]),int(ssug[maxi]))
sol2()

Buggy submission (verdict: Runtime Error):
import numpy as np

def ceil(a):
    return int(np.ceil(a))

def sol2():
    A,B,C,D,E,F = map(int, input().split(' '))
    na, nb, nc, nd = ceil(F/A/100),ceil(F/B/100),ceil(E*F/C/100),ceil(E*F/D/100) 
    sug = np.arange(0,nc).reshape(1,1,nc,1)*C+np.arange(0,nd).reshape(1,1,1,nd)*D
    wat = np.arange(0,na).reshape(na,1,1,1)*A*100+np.arange(0,nb).reshape(1,nb,1,1)*B*100
    sug2=np.unique(sug[sug<=F*F/100])
    wat2=np.unique(wat[wat<=F])[1:]
    tot =  wat2.reshape(len(wat2),1) + sug2
    e2 = E/(100+E)
    dense = (sug2/tot)[tot<=F]
    
    if E==0:
        print(wat2[1],0)
        return
    
    maxi = np.argmax(dense[dense<=e2])
    stot = tot[tot<=F][dense<=e2]
    ssug = (sug2 + tot*0)[tot<=F][dense<=e2]
    
    if dense[maxi] ==0:
        print(wat2[1],0)
    else:
        print(int(stot[maxi]),int(ssug[maxi]))
sol2()

Buggy submission (verdict: Runtime Error):
import numpy as np

def sol():
    A,B,C,D,E,F = map(int, input().split(' '))
    na, nb, nc, nd = int(F/A/100),int(F/A/100),int(E*F/E/100),int(E*F/D/100) 
    sug = np.arange(0,nc).reshape(1,1,nc,1)*C+np.arange(0,nd).reshape(1,1,1,nd)*D
    wat = np.arange(0,na).reshape(na,1,1,1)*A*100+np.arange(0,nb).reshape(1,nb,1,1)*B*100
    tot =  wat + sug
    tot[0,0,0,0]=1
    dense = sug/tot*100
    maxi = np.argmax(dense[tot<F][dense[tot<F]<E])
    swat = (wat + np.ndarray((na,nb,nc,nd))*0)[tot<F][dense[tot<F]<E]
    ssug = (sug + np.ndarray((na,nb,nc,nd))*0)[tot<F][dense[tot<F]<E]
    print(swat[maxi],ssug[maxi])
    
sol()
Problem p02621 (python)

Fixed submission:
a = int(input())

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

Buggy submission (verdict: Runtime Error):
a = input()
print(a + a*a + a*a*a)
Problem p03086 (python)

Fixed submission:
S=input()
L=["A","C","G","T"]
cnt=0
ans=0
for i in range(len(S)):
    if S[i] in L:
        cnt+=1
        ans=max(ans,cnt)
    else:
        cnt=0
    
print(ans)

Buggy submission (verdict: Runtime Error):
S = [i for i in input()]
k = ['A', 'C', 'G', 'T']
count_res = []
count = 0
for i in S:
    if i in k:
        count = count + 1
    else:
        count_res.append(count)
        count = 0
count_res.sort()
print(count_res[-1])
Problem p03106 (python)

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

res = []

for i in range(A, 0, -1):
  if A % i == 0 and B % i == 0:
    res.append(i)

print(res[K-1])

Buggy submission (verdict: Runtime Error):
A, B, K = input().split(" ")
A, B, K = int(A), int(B), int(K)

res = []

for i in range(A, 1, -1):
  if A % i == 0 and B % i == 0:
    res.append(i)

if len(res) > 1:
  print(res[K-1])
else:
  print(1)

Buggy submission (verdict: Runtime Error):
A, B, K = input().split(" ")
A, B, K = int(A), int(B), int(K)

res = []

for i in range(A, 1, -1):
  if A % i == 0 and B % i == 0:
    res.append(i)

print(res[K-1])
Problem p02613 (python)

Fixed submission:
N = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0
for i in range(N):
  tmp = input()
  if(tmp == "AC"):
    AC += 1
  if(tmp == "WA"):
    WA += 1
  if(tmp == "TLE"):
    TLE += 1
  if(tmp == "RE"):
    RE += 1
print("AC x "+str(AC))
print("WA x " +str(WA))
print("TLE x " +str(TLE))
print("RE x " +str(RE))

Buggy submission (verdict: Runtime Error):
N = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0
for i in range(N):
  tmp = input()
  if(tmp == "AC"):
    AC += 1
  if(tmp == "WA"):
    WA += 1
  if(tmp == "TLE"):
    TLE += 1
  if(tmp == "RE")
    RE += 1
print("AC x "+str(AC))
print("WA x " +str(WA))
print("TLE x " +str(TLE))
print("RE x " +str(RE))

Buggy submission (verdict: Runtime Error):
N = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0
for i in range(N):
  tmp = input()
  if(tmp == "AC"):
    AC += 1
  if(tmp == "WA"):
    WA += 1
  if(tmp == "TLE"):
    TLE += 1
  else:
    RE += 1
print(AC x str(AC))
print(WA x str(WA))
print(TLE x str(TLE))
print(RE x str(RE))
Problem p02675 (python)

Fixed submission:
N = int(input())
if(N % 10 == 0 or N % 10 == 1 or N % 10 == 6 or N % 10 == 8):
  print("pon")
elif(N % 10 == 3):
  print("bon")
else:
  print("hon")

Buggy submission (verdict: Runtime Error):
N = int(input())
if(N % 10 == 0 or N % 10 == 1 N % 10 == 6 N % 10 == 8):
  print("pon")
elif(N % 10 == 3):
  print("bon")
else:
  print("hon")
Problem p02687 (python)

Fixed submission:
S = input()
if(S == "ABC"):
  print("ARC")
else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
S = input()
if(S == ABC):
  print("ARC")
else:
  print("ABC")
Problem p02742 (python)

Fixed submission:
H,W = map(int,input().split())
if(H == 1 or W == 1):
  print("1")
elif((H*W)%2 == 0):
  print(str((H*W)//2))
else:
  print(str((H*W)//2+1))

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split())
if((H*W)%2 == 0):
  print(str(H*W)/2)
else:
  print(str(H*W)//2+1)
Problem p02791 (python)

Fixed submission:
N = int(input())
P = list(map(int,input().split()))
mi = P[0]
ans = 0
for i in range(N):
  if(i == 0):
    ans += 1
  else:
    if(P[i] <= mi):
      ans += 1
      mi = P[i]
print(str(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
P = list(map(int,input().split()))
List = []
ans = 0
for i in range(N):
  if(i == 0):
    ans += 1
  else:
    tmp = P.pop(0)
    List.append(tmp)
    if(P[i] <= min(List)):
      ans += 1
print(str(ans))
Problem p03024 (python)

Fixed submission:
S = input()
x = len(S)
y = 15 - x
z = ""
point = 0
for i in range(x):
  z = S[i]
  if (z == "o"):
    point += 1
  else:
    point += 0
    
y = y + point
if (y >= 8):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
S = input()
x = len(S)
y = 15 - x
z = ""
point = 0
for i in range(x + 1):
  z = S[i]
  if (z == "o"):
    point += 1
  else:
    
if (point + y >= 8):
  print("YES")
else:
  print("NO")
Problem p03068 (python)

Fixed submission:
N = int(input())
S = input()
K = int(input())
a = ""
b = S[K - 1]
for i in range(N):
  a = S[i]
  if (a == b):
    print(a,end = "")
  else:
    print("*",end = "")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
K = int(input())
a = ""
b = S[K]
for i in range(N):
  a = S[i]
  if (a == b):
    print(a,end = "")
  else:
    print("*",end = "")
Problem p03219 (python)

Fixed submission:
X,Y = map(int,input().split())
print(X + Y // 2)

Buggy submission (verdict: Runtime Error):
X,Y = int(input())
print(X + Y / 2)
Problem p03220 (python)

Fixed submission:
N = int(input())
T,A = map(int,input().split())
List = list(map(int,input().split()))
List = [abs(A - (T - x * 0.006)) for x in List]
x = min(List)
print(str(List.index(x) + 1))

Buggy submission (verdict: Runtime Error):
N = int(input()) - 1
T,A = map(int,input().split())
tmp = 0
X = 0
List = list(map(int,input().split()))
List2 = []
for i in range(N):
  tmp =abs(A - (T - List.pop(i) * 0.001))
  List2.append(tmp)
X = min(List2)
print(str(List2.index(X) + 1))

Buggy submission (verdict: Runtime Error):
N = int(input()) - 1
T,A = map(int,input().split())
tmp = 0
X = 0
List = list(map(int,input().split()))
List2 = []
for i in range(N):
  tmp =abs(A - (T - List.pop(i) * 0.001))
  List2.append(tmp)
X = min(List2)
print(List2.index(X) + 1)
Problem p03284 (python)

Fixed submission:
N,K = map(int,input().split())
if(N%K == 0):
  print("0")
else:
  print("1")

Buggy submission (verdict: Runtime Error):
N = int(input())
X = N // 4 + 1
Z = N // 7 + 1
Y = sum(4*a + 7*b == N for a in range(X) for b in range(Z))
if (Y != 0):
  print("Yes")
else:
  print("No")
Problem p03324 (python)

Fixed submission:
D,N = map(int,input().split())
if(N == 100):
  print(str((100 ** D) * N + 100 ** D))
else:
  print(str((100 ** D) * N))

Buggy submission (verdict: Runtime Error):
D,N = map(int,input().split())
print(str((100 ** D) * K))
Problem p03352 (python)

Fixed submission:
X = int(input())
ans = 0
for i in range(1,100):
  for p in range(2,100):
    tmp = i ** p
    if(tmp <= X):
      ans = max(tmp,ans)
    else:
      pass
print(str(ans))

Buggy submission (verdict: Runtime Error):
X = int(input())
for i in range(X+1):
  for p in range(X+1):
    ans = max(i ** p,ans)
print(str(ans))
Problem p03370 (python)

Fixed submission:
N,X = map(int,input().split())
m = [int(input()) for i in range(N)]
count = 0
A = sum(m)
X = X - A
count = N
B = min(m)
while(X >= B):
  count += 1
  X = X - B
print(str(count))

Buggy submission (verdict: Runtime Error):
N,X = map(int,input().split())
m = list(int,input().split())
count = 0
A = sum(m)
X = X - A
count = len(m)
B = min(m)
while(X >= B):
  count += 1
  X = X - B
print(str(count))
Problem p03455 (python)

Fixed submission:
a,b = map(int,input().split())
if (a*b) % 2:
  print("Odd")
else:
  print("Even")

Buggy submission (verdict: Runtime Error):
a,b = map(input().split())
if (a*b) % 2:
  print("Even")
else:
  print("Odd")
Problem p03485 (python)

Fixed submission:
a,b = map(int,input().split())
x = a+b
if (x % 2 == 0):
  print(int(x/2))
else:
  print(int(x/2 + 1))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split)
x = a+b
if (x % 2 == 0):
  print(x/2)
else:
  print(x/2 + 1)