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

Fixed submission:
#https://atcoder.jp/contests/abc104/tasks/abc104_c
 
d, g = map(int, input().split())
pc = []
 
for i in range(d):
  pc.append(list(map(int,input().split())))
 
ans = float("inf")
 
#各配点について解くか解かないかを決め、その上で G 点に満たなければ、まだ解いてない配点のうち一番高い配点のものを足りない分解く
 
for i in range(2**d):
    count = 0 #解く問題数
    sum = 0
    nokori = set(range(1, d + 1)) #点数の列
 
    for j in range(d):
        if (i>>j)&1:
            sum += pc[j][0] * (j + 1) * 100 + pc[j][1] #(j+1)*100点+bounus
            count += pc[j][0]
            nokori.discard(j + 1) #(j+1)*100点を処理したので削除
 
    # G 点に満たなければ nokori のうち一番大きいものを解く
    if sum < g:
        use = max(nokori)
        # 解く問題が問題数を超えないように注意
        n = min(pc[use - 1][0], -(-(g - sum) // (use * 100)))
        count += n
        sum += n * use * 100
 
    if sum >= g:
        #数が小さい方を残す
        ans = min(ans, count)
 
print(ans)

Buggy submission (verdict: Runtime Error):
#https://atcoder.jp/contests/abc104/tasks/abc104_c

d, g = map(int, input().split())

for i in range(d):
  pc.append(list(map(int,input().split())))

ans = float("inf")

#各配点について解くか解かないかを決め、その上で G 点に満たなければ、まだ解いてない配点のうち一番高い配点のものを足りない分解く

for i in range(2**d):
    count = 0 #解く問題数
    sum = 0
    nokori = set(range(1, d + 1)) #点数の列

    for j in range(d):
        if (i>>j)&1:
            sum += pc[j][0] * (j + 1) * 100 + pc[j][1] #(j+1)*100点+bounus
            count += pc[j][0]
            nokori.discard(j + 1) #(j+1)*100点を処理したので削除

    # G 点に満たなければ nokori のうち一番大きいものを解く
    if sum < g:
        use = max(nokori)
        # 解く問題が問題数を超えないように注意
        n = min(pc[use - 1][0], -(-(g - sum) // (use * 100)))
        count += n
        sum += n * use * 100

    if sum >= g:
        #数が小さい方を残す
        ans = min(ans, count)

print(ans)
Problem p02861 (python)

Fixed submission:
import numpy as np
from itertools import combinations, permutations

n = int(input())
ls = [list(map(int, input().split())) for _ in range(n)]


def mean_dis(data):
    comb = permutations(data, n)
    sum = 0
    count = 0
    for c in comb:
        count += 1
        for i in range(1, len(c)):
            _c = np.array([c[i-1], c[i]])
            euclid = np.sqrt(np.sum((_c[0]-_c[1]) ** 2))
            sum += euclid
    return sum/count


def mean_dis2(data, n):
    comb = combinations(data, 2)
    all_dis = 0
    for c in comb:
        _c = np.array([c[0], c[1]])
        euclid = np.sqrt(np.sum((_c[0] - _c[1]) ** 2))
        all_dis += euclid

    return (all_dis*2)/n

print(mean_dis2(ls, n))

Buggy submission (verdict: Runtime Error):
import numpy as np
from itertools import combinations, permutations

n = int(input())
ls = [list(map(int, input().split())) for _ in range(n)]


def mean_dis(data):
    comb = permutations(data, n)
    sum = 0
    count = 0
    for c in comb:
        count += 1
        for i in range(1, len(c)):
            _c = np.array([c[i-1], c[i]])
            euclid = np.sqrt(np.sum((_c[0]-_c[1]) ** 2))
            sum += euclid
    return sum/count


print(mean_dis(ls))
Problem p02886 (python)

Fixed submission:
n = int(input())
ls = map(int, input().split())

from itertools import combinations

combi = list(combinations(ls, 2))

s = 0
for a, b in combi:
    s += (a * b)

print(s)

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

from itertools import combinations

combi = list(combinations(ls, 2))

s = 0
for a, b in combi:
    s += (a * b)

print(s
Problem p02696 (python)

Fixed submission:
import math
def fs(A, B, x):
    return math.floor(A*x/B) - A * math.floor(x/B)


def main():
    A, B, N = map(int, input().split())

    print(fs(A, B, min(N, B-1)))
    return 0

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):


def floor(t):
    return int(t)


def fs(A, B, x):
    return floor(A*x/B) - (A * floor(x/B))

def main():
    A, B, N = map(int, input().split())

    ans = 0

    low = 1
    if N % 2 == 0:
        high = N
    else:
        high = N + 1

    while abs(low - high) != 1:
        mid = (high + low) // 2
        tmp = fs(A, B, mid)
        if tmp > ans:
            ans = tmp
            low = mid
        else:
            high = mid

    print(tmp)


    return 0

if __name__ == '__main__':
    main()
Problem p02791 (python)

Fixed submission:
import bisect
import numpy as np

def main():
    N = int(input())
    P = list(map(int, input().split()))


    ans = 1
    f = P[0]

    for i in range(1, N):
        f_o = P[i]
        if f >= f_o:
            ans+=1
            f = f_o
    print(ans)
    return 0


if __name__ == '__main__':
    main()

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

def main():
    N = int(input())
    P = list(map(int, input().split()))

    P = np.array(P)

    ans = 0
    i = N
    while i != 0:
        ans += 1
        i = np.argmin(P)
        P = P[0:i]
    print(ans)

    return 0


if __name__ == '__main__':
    main()
Problem p03037 (python)

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

min, max = map(int, input().split())

for i in range(M-1):
    l, r = map(int, input().split())
    if min < l:
        min = l
    if max > r:
        max = r



lis = [i for i in range(min, max+1)]
print(len(lis))

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

l, r = map(int, input().split())
lis = [i for i in range(l, r+1)]

for i in range(M-1):
    l, r = map(int, input().split())
    if r > max(lis):
        r = max(lis)
    if l < min(lis):
        l = min(lis)
    tmp_lis = [i for i in range(l, r+1)]
    lis = set(lis) & set(tmp_lis)

lis = [i for i in lis if i <= N]
print(len(lis))
Problem p03351 (python)

Fixed submission:
import math
line = input()
line1 = line.split(" ")

#for i in line1:
  #  line1[i] = int(i)

adis = line1[0]
bdis = line1[1]
cdis = line1[2]
count = line1[3]

AB = abs(abs(int(bdis)) - abs(int(adis)))
BC = abs(abs(int(cdis)) - abs(int(bdis)))
#AB = abs(AB)


if int(AB) <= int(count) and int(BC) <= int(count):
    print("Yes")
elif abs(abs(int(cdis)) - abs(int(adis))) <= int(count):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):

num = input()
num = int(num)

#2の2乗から順番に見ていく
#入力を超えたらその時点の値をマックスとして保持
#更新していく
max = 0
if num < 4:
    print("1")
else:
    for i in range(2,num):
        beki = 2
        cou = i**beki
        while i**beki <= num:
            beki += 1
        if max < i ** (beki-1):
            if beki > 2:
                max = i ** (beki-1)
    print(max)
Problem p02681 (python)

Fixed submission:

#N,K=map(int,input().split())
#N=int(input())
S=list(input())
T=list(input())
T.pop()

if "".join(S)=="".join(T):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import collections
import numpy as np
import sys
sys.setrecursionlimit(10**8)
#N,K=map(int,input().split())
#N=int(input())
S=list(input())
T=list(input())
T.pop()

if "".join(S)=="".join(T):
    print("Yes")
else:
    print("No")

# h=np.array(list(map(int,input().split())))
# ans=0
# def sol(l,m,k):
#     global ans
#     if m==0:
#         return ans
#     elif m>0:
#         for i in range(N-m+1):
#             if not 0 in l[i:i+m]:
#                 ans+=np.amin(l[i:i+m])
#                 l[i:i+m]=l[i:i+m]-min(l[i:i+m])
#                 print(l)
#         sol(l,m-1,ans)
#     # else:
#     #     ans+=np.count_nonzero(h)
#     #     sol(l, m - 1, ans)
# n=0
# sol(h,N,ans)
# print(ans)
Problem p02684 (python)

Fixed submission:
import collections
import numpy as np
import sys
import copy

N,K=map(int,input().split())
A=list(map(int,input().split()))
for i in range(N):
    A[i]-=1
B=[0]
visited=[0]*N
visited[0]=1
Flag=True
for i in range(0,N*2):
    next=A[B[i]]
    if visited[next]==0:
        B.append(next)
        visited[next]=1
    else:
        C=B[B.index(next):]
        num=B.index(next)
        break
#print(C)
if K>num:
    Ans=(K-num)%len(C)
    print(C[Ans]+1)
else:
    print(B[K]+1)

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

N,K=map(int,input().split())
A=list(map(int,input().split()))
for i in range(N):
    A[i]-=1
B=[0]
visited=[0]*N
visited[0]=1
Flag=True
for i in range(0,N*2):
    next=A[B[i]]
    if visited[next]==0:
        B.append(next)
        visited[next]=1
    else:
        C=B[B.index(next):]
        num=B.index(next)
        break
#print(C)
if K>len(C):
    Ans=(K-num)%len(C)
    print(C[Ans]+1)
else:
    print(B[K])
Problem p02714 (python)

Fixed submission:
import math
import sys
import collections

def main():
    N=int(input())
    Tr=list(input())
    R=[]
    G=[]
    B=[]
    for i in range(N):
       if Tr[i]=="R":
           R.append(i)
           continue
       if Tr[i]=="G":
           G.append(i)
           continue
       if Tr[i]=="B":
           B.append(i)
           continue
    cnt=len(R)*len(G)*len(B)
    for j in range(N):
        for i in range(j):
            if 2*j-i<=N-1:
                if Tr[2*j-i]!=Tr[i] and Tr[2*j-i]!=Tr[j] and Tr[j]!=Tr[i]:
                    cnt-=1
    print(cnt)
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math
import sys
import collections
def main():
    N=int(input())
    Tr=tuple(input())
    R=[]
    G=[]
    B=[]
    for i in range(N):
       if Tr[i]=="R":
           R.append(i)
       if Tr[i]=="G":
           G.append(i)
       if Tr[i]=="B":
           B.append(i)
    cnt=0
    if len(R)==max(len(R),len(G),len(B))
        for i in B:
            for j in G:
                for k in R:
                    if max(i,j,k)-(i+j+k-max(i,j,k)-min(i,j,k))!=(i+j+k-max(i,j,k)-min(i,j,k))-min(i,j,k):
                        cnt+=1

        print(cnt)
    if len(G) == max(len(R), len(G), len(B))
        for i in B:
            for j in R:
                for k in G:
                    if max(i, j, k) - (i + j + k - max(i, j, k) - min(i, j, k)) != (
                            i + j + k - max(i, j, k) - min(i, j, k)) - min(i, j, k):
                        cnt += 1

        print(cnt)
    if len(B) == max(len(R), len(G), len(B))
        for i in R:
            for j in G:
                for k in B:
                    if max(i, j, k) - (i + j + k - max(i, j, k) - min(i, j, k)) != (
                            i + j + k - max(i, j, k) - min(i, j, k)) - min(i, j, k):
                        cnt += 1

        print(cnt)



if __name__ == '__main__':
    main()
Problem p02865 (python)

Fixed submission:
N=int(input())
if N % 2==0:
    print(N//2-1)
else:
    print(N//2)

Buggy submission (verdict: Runtime Error):
N=int(input())
d=list(map(int,input().split()))
count=1
if d[0]!=0:
    count=0
for i in range(max(d)):
    count *= pow(i+1,d.count(i+1),99844353)
print(count)
Problem p02866 (python)

Fixed submission:
n=int(input())
d=list(map(int,input().split()))
mod=998244353
from collections import Counter
q=Counter(d)
if q[0]!=1 or d[0]!=0:
	print(0)
	exit()
ans=1
for i in range(1,max(q)+1):
    ans *=pow(q[i-1],q[i],mod)
    ans %=mod
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
N=int(input())
d=list(map(int,input().split()))
dd = collections.Counten=int(input())
d=list(map(int,input().split()))
mod=998244353
from collections import Counter
q=Counter(d)
if q[0]!=1 or d[0]!=0:
	print(0)
	exit()
ans=1
for i in range(1,max(q)+1):
    ans *=pow(q[i-1],q[i],mod)
    ans %=mod
print(ans)
Problem p03147 (python)

Fixed submission:
import collections
import numpy as np
import sys
sys.setrecursionlimit(10**8)
#N,K=map(int,input().split())
N=int(input())
h=np.array(list(map(int,input().split())))
ans=0
def sol(l,m,k):
    global ans
    if m==0:
        return ans
    elif m>0:
        for i in range(N-m+1):
            if not 0 in l[i:i+m]:
                ans+=np.amin(l[i:i+m])
                l[i:i+m]=l[i:i+m]-min(l[i:i+m])
                #print(l)
        sol(l,m-1,ans)
    # else:
    #     ans+=np.count_nonzero(h)
    #     sol(l, m - 1, ans)
n=0
sol(h,N,ans)
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
import numpy as np
import sys
sys.setrecursionlimit(10**6)
#N,K=map(int,input().split())
N=int(input())
h=np.array(list(map(int,input().split())))
ans=0
def sol(l,m,k):
    global ans
    if m==0:
        return ans
    elif m>1:
        for i in range(N-m+2):
            if not 0 in l[i:i+m-1]:
                ans+=np.amin(l[i:i+m-1])
                l[i:i+m-1]-=np.amin(l[i:i+m-1])
        sol(l,m-1,ans)
    else:
        ans+=np.count_nonzero(h)
        sol(l, m - 1, ans)
n=0
sol(h,N,ans)
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
import numpy as np
#N,K=map(int,input().split())
N=int(input())
h=np.array(list(map(int,input().split())))
ans=0
def sol(l,m,k):
    global ans
    if m==0:
        return ans
    elif m>1:
        for i in range(N-m+2):
            if not 0 in l[i:i+m-1]:
                ans+=np.amin(l[i:i+m-1])
                l[i:i+m-1]-=np.amin(l[i:i+m-1])
        sol(l,m-1,ans)
    else:
        ans+=np.count_nonzero(h)
        sol(l, m - 1, ans)
n=0
sol(h,N,ans)
print(ans)
Problem p03163 (python)

Fixed submission:
N,W=map(int,input().split())
k=[[0,0] for i in range(N)]
dp=[[0]*(W+1) for j in range(N+1)]
for i in range(N):
    k[i][0],k[i][1]=map(int,input().split())



for i in range(N):
    for w in range(W+1):
        if k[i][0]>w:
            dp[i+1][w]=dp[i][w]
        else:
            dp[i+1][w] = max(dp[i][w-k[i][0]]+k[i][1],dp[i][w])


print(dp[N][W])

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

N, W = map(int, input().split())
w, v = [], []
for i in range(N):
    a, b = map(int, input().split())
    w += [a]
    v += [b]

DP = np.zeros(W + 1)

for i in range(N):
    # print(DP[w[i]:])
    # print(DP[:-w[i]])
    # print(DP[:-w[i]] + v[i])
    DP[w[i]:] = np.maximum(DP[:-w[i]] + v[i], DP[w[i]:])
    # print(DP)
print(DP[-1])

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

N, W = map(int, input().split())
w, v = [], []
for i in range(N):
    a, b = map(int, input().split())
    w += [a]
    v += [b]

DP = np.zeros(W + 1, dtype=int)

# i 円以下で買える商品の最大価値
for i in range(N):
    # print(DP[w[i]:])
    # print(DP[:-w[i]])
    # print(DP[:-w[i]] + v[i])
    DP[w[i]:] = np.maximum(DP[:-w[i]] + v[i], DP[w[i]:])
    # print(DP)
print(DP[-1])
Problem p02909 (python)

Fixed submission:
s=input()
if s=="Sunny":
    print("Cloudy")
elif s=="Cloudy":
    print("Rainy")
elif s==("Rainy"):
    print("Sunny")

Buggy submission (verdict: Runtime Error):
import sys
input=sys.stdin.readline()

n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
b=[0]*m
for _ in range(m):
    if b[-1:]<a[-1:]:
        temp=a.pop()
    else:
        temp=b.pop()
    temp=temp//2
    b[0]=temp
    b.sort()

print(sum(a)+sum(b))
Problem p02917 (python)

Fixed submission:
n=int(input())
b=list(map(int,input().split()))
ans=0
ans+=b[0]
ans+=b[n-2]
for i in range(n-2):
    ans+=min(b[i],b[i+1])
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
b=list(map(int,input().split()))
ans=0
ans+=max(b[0],b[1])
ans+=b[n-2]
for i in range(n-2):
    ans+=min(b[i],b[i+1])
print(ans)
Problem p03060 (python)

Fixed submission:
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
ans=0
for i in range(n):
    if v[i]-c[i]>0:
        ans+=v[i]-c[i]
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
v=map(int,input().split())
c=map(int,input().split())
ans=0
for i in range(n):
    if c[i]-v[i]>0:
        ans+=c[i]-v[i]
print(ans)
Problem p03241 (python)

Fixed submission:
import copy
def cd_generator(num):
    ans=[]
    for i in range(1,10000000):
        if num%i==0:
            ans.append(i)
    temp=copy.deepcopy(ans)
    temp.reverse()
    for ele in temp:
        ans.append(num//ele)
    return ans
def main():
    n,m=map(int,input().split())
    array=cd_generator(m)
    ans=0
    for ele in array:
        if m//ele>=n:
            ans=max(ans,ele)
    print(ans)
main()

Buggy submission (verdict: Runtime Error):
def make_divisors(n):
    lower_divisors,upper_divisors=[],[]
    i=1
    while i*i<=n:
        if n%i=0:
            lower_divisors.append(i)
            if i!=n//i:
                upper_divisors.append(n//i)
        i+=1
    return lower_divisors+upper_divisors[::-1]
n,m=map(int,input().split())
array=make_divisors(m)
array.reverse()
for ele in array:
    if m//ele>=n:
        print(ele)
        exit()
Problem p02687 (python)

Fixed submission:
S = str(input())

if S == 'ABC':
  print('ARC')
  
else:
  print('ABC')

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

if S = 'ABC':
  print('ARC')
  
else:
  print('ABC')
Problem p02742 (python)

Fixed submission:
H, W = map(int, input().split())

w1, w2 = W // 2, W % 2
h1, h2 = H // 2, H % 2

if H > 1 and W > 1:
	num = 2 * w1 * h1 + w2 * h1 + w1 * h2 + w2 * h2 
else:
  num = 1
print(num)

Buggy submission (verdict: Runtime Error):
H, W = int(input().split())
count = 0

if W % 2 == 0:
  num_w = W % 2
else:
  num_w = W % 2 - 1

if H % 2 == 0:
  num_h = H % 2
  
else:
  num_h = H % 2 - 1
  
print(num_w*num_h)
Problem p02767 (python)

Fixed submission:
import numpy as np
N = int(input())
x = [int(i) for i in input().split() ]

each = 0
loss = 0
ll = []

for k in range(min(x), max(x)+1):
      for j in range(len(x)):
            each = np.power((x[j]-k), 2)
            loss += each
      ll.append(loss)
      loss = 0
  
print(min(ll))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
x = [int(i) for i in input().split() ]

each = 0
loss = 0
ll = []

for k in range(min(x), max(x)):
      for j in range(len(x)):
            each = np.power((x[j]-k), 2)
            loss += each
      ll.append(loss)
      loss = 0
  
print(min(ll))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
x = [int(i) for i in input().split() ]

each = 0
loss = 0
ll = []

for k in range(min(x), max(x)):
      for j in range(len(x)):
            each = np.power((x[j]-k), 2)
            loss += each
      ll.append(loss)
  
print(min(ll))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
x = [int(i) for i in input().split() ]

each = 0
loss = 0
ll = []
k = 0

for k in range(min(x), max(x)):
      for j in range(len(x)):
            each = np.power((x[j]-k), 2)
            loss += each
      ll.append(loss)
  
print(min(ll))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
x = [int(i) for i in input().split() ]

each = 0
loss
ll = []

for(int i=min(x); i<max(x); i++):
  for j in range(len(x)):
    each = np.power((x[j]-i), 2)
    loss += each
  ll.append(loss)
  
print(min(each))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
x = [int(i) for i in input().split() ]

each = 0
loss = []

for(int i=min(x); i<max(x); i++):
  for j in range(len(x)):
    each = np.power((x[j]-i), 2)
    each += each
  loss.append(each)
  
print(min(each))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
x = [int(i) for i in input().split() ]

each = 0
loss = []

for(int i=min(x); i<max(x); i++):
  for j in range(len(x)):
    each = np.power((x[j]-i), 2)
  loss.append(each)
  
print(min(each))
Problem p02842 (python)

Fixed submission:
N = int(input())
ans=-1

for i in range(1,N+1):
       if int( i*1.08) == N:
            ans = i
            
if ans == -1:
    print(':(')
else:
    print(ans)

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

x = N//1.08
if x * 1.08 == int(a):
  print(x)
  
else:
  print(':/')
Problem p02899 (python)

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

B = [0 for i in range(N)]

for i in range(N):
  B[A[i] - 1] = i + 1
 
print(' '.join(map(str, B)))

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

B = [0 for i in range(N)]

for i in range(N):
  B[A[i] - 1] = i + 1
 
print(' '.join(map(str, lst)))
Problem p02922 (python)

Fixed submission:
A, B = map(int,input().split())
out = 1 
ans = 0

while out < B:
  out += A-1
  ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
A, B = map(int,input().split())
out = 1 
ans = 0
while out < B:
  out += A
  ans ++
print(ans)
Problem p03067 (python)

Fixed submission:
A, B, C = (int(i) for i in input().split()) 
if (A < C and C < B) or (B < C and C < A):
   print("Yes")
else:
   print("No")

Buggy submission (verdict: Runtime Error):
A, B, C = (int(i) for i in input().split()) 
if (A < C and C < B) or (B < C and C < A):
  print("Yes")
else:
print("No")
Problem p03068 (python)

Fixed submission:
N = int(input())
S = list(input())
K = int(input())

for i in range(N):
    if S[i] == S[K-1]:
       pass
    else:
       S[i] = '*'
        
        
mojiretu = ','.join(S)
print(mojiretu.replace(',', ''))

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

for i in range(N):
  if S[K-1] != S[i]:
    S[i] = *

print(S)

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

for i in range(N):
    if S[i] == S[K]:
       pass
    else:
       S[i] = '*'

print(S)
Problem p03102 (python)

Fixed submission:
import numpy as np
N, M ,C = map(int, input().split())
a = []
for i in range(N+1):
    a.append(list(map(int, input().split())))
all = np.array(a)
sum = 0
num = 0

for i in range(N):
    mul = np.sum(all[0] * all[i+1]) + C
    if mul > 0:
        num += 1
    mul = 0

print(num)

Buggy submission (verdict: Runtime Error):
 import numpy as np
N, M ,C = map(int, input().split())
a = []
for i in range(N+1):
    a.append(list(map(int, input().split())))
all = np.array(a)
sum = 0
num = 0

for i in range(N):
    mul = np.sum(all[0] * all[i+1]) + C
    if mul > 0:
        num += 1
    mul = 0

print(num)

Buggy submission (verdict: Runtime Error):
import numpy as np
N, M ,C = map(int, input().split())
a = []
for i in range(M):
    a.append(list(map(int, input().split())))
all = np.array(a)
sum = 0
num = 0

for i in range(N):
    mul = np.sum(all[0] * all[i+1]) + C
    if mul > 0:
        num += 1
    mul = 0

print(num)
Problem p03254 (python)

Fixed submission:
N, x = map(int, input().split())
a_list = sorted(list(map(int, input().split())))

for i in range(N):
    x = x - a_list[i]
    if x < 0:
        break
if i == N-1 and x == 0:
    i += 1

print(i)

Buggy submission (verdict: Runtime Error):
N, x = map(int, input().split())
a_list = sorted(list(map(int, input().split())))
sum = 0
num = 0

while sum < x:
    sum += a_list[num]
    num += 1
    
print(num)

Buggy submission (verdict: Runtime Error):
N, x = map(int, input().split())
a_list = sorted(list(map(int, input().split())))
sum = 0
num = 0

while sum < x:
    sum += a_list[num]
    num += 1
    print(sum)
    
print(num)

Buggy submission (verdict: Runtime Error):
N, x = map(int, input().split())
a_list = sorted(list(map(int, input().split())))
sum = 0
num = 0

while sum < x and num <= N:
    sum += a_list[num]
    num += 1
    
print(num)
Problem p03433 (python)

Fixed submission:
N = int(input())
A = int(input())
mod = N % 500
if mod <= A:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = int(input())
mod = N % 500
if mod < A || mod = A:
  print("Yes")
else:
  print("No")
Problem p03456 (python)

Fixed submission:
import numpy as np
a, b= map(str, input().split())
ab = int(a+b)
c = 4
d = -1

while np.power(c, 2) < ab + 1:
     if np.power(c, 2) != ab:
        c  += 1
     else:
        d = np.power(c, 2) 
        break

if d != -1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
import numpy as np
a, b = int(input().split())
if b < 10:
  ab = 10 * a + b
else:
  ab = 100 * a +b
c = 11
d = -1

while np.power(c, 2) < ab + 1:
     if np.power(c, 2) != ab:
        c  += 1
     else:
        d = np.power(c, 2) 

if d != -1:
  print('Yes')
else:
  print('No')
Problem p03644 (python)

Fixed submission:
N = int(input())
i = 0
while 2**i <= N:
  i += 1
  
print(2**(i-1))

Buggy submission (verdict: Runtime Error):
N = int(input())
i = 0
while 2**i <-=N:
  i += 1
  
print(2**(i-1))