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

Fixed submission:
b = input()
d = []
isWhite = False
cnt = 0
for i in range(len(b)-1):
  if b[i] != b[i+1]:
    d.append(cnt)
  else:
    cnt+=1

print(len(d))

Buggy submission (verdict: Runtime Error):
b = input()
d = []
isWhite = False
cnt = 0
for i in range(len(b-1)):
  if b[i] != b[i+1]:
    d.append(cnt)
  else:
    cnt+=1

print(len(d))
Problem p02802 (python)

Fixed submission:
n, m = map(int, input().split())
q_re = set()
ac = 0
wa = 0
dic_wa = {}
for i in range(m):
    q, re = input().split()
    if(re == "WA" and q not in q_re): 
        if(q not in dic_wa): dic_wa[q] = 1
        else: dic_wa[q] += 1
    if(re == "AC" and q not in q_re): 
        ac += 1
        q_re.add(q)
        if(q in dic_wa): wa += dic_wa[q]
print(ac, wa)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
q_re = set()
ac = 0
wa = 0
dic_wa = {}
for i in range(m):
    q, re = input().split()
    if(re == "WA" and q not in q_re): 
        if(q not in dic_wa): dic_wa[q] = 1
        else: dic_wa[q] += 1
    if(re == "AC" and q not in q_re): 
        ac += 1
        q_re.add(q)
        wa += dic_wa[q]
print(ac, wa)
Problem p02844 (python)

Fixed submission:
import sys
def input():
    return sys.stdin.readline()[:-1]

n = int(input())
s = input()
pass_list = list(map(lambda x: str(x).zfill(3), range(1000)))
res = 0

for p in pass_list:
    
    ptr = 0
    one = False
    two = False
    three = False
    
    for i in range(len(s)):
        if(s[i] == p[0]):
            ptr = i
            one = True
            break
    
    for i in range(ptr+1, len(s)):
        if(s[i] == p[1]):
            ptr = i
            two = True
            break
    
    for i in range(ptr+1, len(s)):
        if(s[i] == p[2]):
            ptr = i
            three = True
            break
    
    if(one and two and three): res += 1

print(res)

Buggy submission (verdict: Runtime Error):
import sys
def input():
    return sys.stdin.readline()[:-1]

pass_list = list(map(lambda x: str(x).zfill(3), range(1000)))
res = 0

for p in pass_list:
    
    ptr = 0
    one = False
    two = False
    three = False
    
    for i in range(len(s)):
        if(s[i] == p[0]):
            ptr = i
            one = True
            break
    
    for i in range(ptr+1, len(s)):
        if(s[i] == p[1]):
            ptr = i
            two = True
            break
    
    for i in range(ptr+1, len(s)):
        if(s[i] == p[2]):
            ptr = i
            three = True
            break
    
    if(one and two and three): res += 1

print(res)
Problem p02903 (python)

Fixed submission:
H, W, A, B = map(int, input().split())
 
for r in range(H):
    for c in range(W):
        if (c < A) ^ (r < B):
            print(str('1'), end="")
        else:
            print(str('0'), end="")
    print("")

Buggy submission (verdict: Runtime Error):
H, W, A, B = map(int, input().split())

res = [[0 for i in range(4)] for j in range(4)]
h_cnt = [0] * W

for h in range(H):
    w_cnt = 0
    
    for w in range(W):
        
        if((w_cnt < A or A == 0) and (h_cnt[w] < B or B == 0)):
            res[h][w] = 1
            w_cnt += 1
            h_cnt[w] += 1
            
        elif(w_cnt == A): break
        
        elif(W -  w > A): pass
        
        else:
            print('No')
            quit()
if(h_cnt != [B] * H and B != 0):
    print('No')
    quit()

for h in range(H):
    
    for w in range(W):
        print(res[h][w], end = '')
    print()
Problem p02911 (python)

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

member = [K - Q] * N

for a in A:
    member[a - 1] += 1

for m in member:
    if m > 0: print("Yes")
    else: print("No")

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

N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]

member = np.ones(N) * K

for a in A:
    member -= 1
    member[a - 1] += 1

res = np.array(['No', 'Yes'])[(member > 0).astype('int')]

for r in res:
    print(r)
Problem p03087 (python)

Fixed submission:
n, q = map(int, input().split())
s = input()
dp = [0 for _ in range(len(s))]

for i in range(1, len(s)):
    if(s[i-1: i+1] == 'AC'): dp[i] = dp[i-1] + 1
    else: dp[i] = dp[i-1]

for _ in range(q):
    l, r = map(int, input().split())
    print(dp[r-1] - dp[l-1])

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
S = input()
lr = [list(map(int, input().split())) for _ in range(N)]

for lr_ in lr:
    l, r = lr_[0], lr_[1]
    
    print(S[l - 1: r].count('AC'))
Problem p03101 (python)

Fixed submission:
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H - h) * (W - w))

Buggy submission (verdict: Runtime Error):
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(N)]

cnt = 0

for a in A:
    
    if(sum([ta * tb for ta, tb in zip(a, B)]) + C > 0):
        cnt += 1

print(cnt)
Problem p03162 (python)

Fixed submission:
N = int(input())

A = [0 for _ in range(N)]
B = [0 for _ in range(N)]
C = [0 for _ in range(N)]

for i in range(N):
    A[i], B[i], C[i] = map(int, input().split())

dp = [[0, 0, 0] for _ in range(N)]

dp[0][0] = A[0]
dp[0][1] = B[0]
dp[0][2] = C[0]

for i in range(1, N):
    
    dp[i][0] = max(dp[i - 1][1], dp[i - 1][2]) + A[i]
    dp[i][1] = max(dp[i - 1][2], dp[i - 1][0]) + B[i]
    dp[i][2] = max(dp[i - 1][0], dp[i - 1][1]) + C[i]

print(max(dp[-1]))

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

A = [map(int, input().split())]
B = [map(int, input().split())]
C = [map(int, input().split())]

dp = [[0, 0, 0] for _ in range(N)]

dp[0][0] = A[0]
dp[0][1] = B[0]
dp[0][2] = C[0]

for i in range(1, N):
    
    dp[i][0] = max(dp[i - 1][1], dp[i - 1][2]) + A[i]
    dp[i][1] = max(dp[i - 1][2], dp[i - 1][0]) + B[i]
    dp[i][2] = max(dp[i - 1][0], dp[i - 1][1]) + C[i]

print(max(dp[-1]))
Problem p03448 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
cnt = 0

for a in range(A + 1):
    
    for b in range(B + 1):
        
        for c in range(C + 1):
            
            if(a * 500 + b * 100 + c * 50 == X):
                cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

for a in range(A + 1):
    
    for b in range(B + 1):
        
        for c in range(C + 1):
            
            if(a * 500 + b * 100 + c * 50 == X):
                cnt += 1

print(cnt)
Problem p03471 (python)

Fixed submission:
N, Y = map(int, input().split())
break_flag = False

for i in range(N + 1):
    
    for j in range(i, N + 1):
        a, b, c = i, j - i, N - j
        
        if(10000 * a + 5000 * b + 1000 * c == Y):
            print(a, b, c)
            
            break_flag = True
            break
    
    if break_flag: break

if not break_flag: print('-1 -1 -1')

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

for a in range(n+1):
    for b in range(n-a+1):
        c = n-a-b
            
        if(and 10000*a + 5000*b + 1000*c == y):
            print(a, b, c)
            quit()

print("-1 -1 -1")

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

for a in range(n+1):
    for b in range(n+1):
        for c in range(n+1):
            
            if(a+b+c==n and 1000*a + 5000*b + 10000*c == 45000):
                result = str(c) + " " + str(b) + " " + str(a)

print(result)
Problem p03493 (python)

Fixed submission:
print(input().count('1'))

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

while(True):
    
    if all(a % 2 == 0 for a in A):
        A = list(map(lambda x: x / 2, A))
        cnt += 1
    
    else: break

print(cnt)

Buggy submission (verdict: Runtime Error):
cnt = 0

while(True):
    
    if all(a % 2 == 0 for a in A):
        A = list(map(lambda x: x / 2, A))
        cnt += 1
    
    else: break

print(cnt)
Problem p03494 (python)

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

while(True):
    
    if all(a % 2 == 0 for a in A):
        A = list(map(lambda x: x / 2, A))
        cnt += 1
    
    else: break

print(cnt)

Buggy submission (verdict: Runtime Error):
cnt = 0

while(True):
    
    if all(a % 2 == 0 for a in A):
        A = list(map(lambda x: x / 2, A))
        cnt += 1
    
    else: break

print(cnt)
Problem p03545 (python)

Fixed submission:
import itertools

A, B, C, D = input()
for p in itertools.product(['+', '-'], repeat = 3):
    equ = A + p[0] + B + p[1] + C + p[2] + D
    
    if(eval(equ) == 7):
        print(equ + '=7')
        break

Buggy submission (verdict: Runtime Error):
A, B, C, D = input()
for p in itertools.product(['+', '-'], repeat = 3):
    equ = A + p[0] + B + p[1] + C + p[2] + D
    
    if(eval(equ) == 7):
        print(equ + '=7')
        break
Problem p03637 (python)

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

odd = 0
two = 0
four = 0

for a in A:
    if(a%2): odd += 1
    else:
        if(a%4==0):four+=1
        else: two += 1


if(two):
    if(odd<=four): print("Yes")
    else: print("No")

else:
    if(odd-1<=four): print("Yes")
    else: print("No")

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

odd = 0
two = 0
four = 0

for i in range(n):
    a = int(input())
    if(a%2): odd += 1
    else:
        if(a%4==0):four+=1
        else: two += 1


if(two):
    if(odd<=four): print("Yes")
    else: print("No")

else:
    if(odd-1<=four): print("Yes")
    else: print("No")
Problem p04001 (python)

Fixed submission:
import itertools
S = input()
ans = 0
for p in itertools.product(['', '+'], repeat = len(S) - 1):
    cmd = ''.join([s + t for s, t in zip(S, p)]) + S[-1]
    ans += eval(cmd)
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
ans = 0
for p in itertools.product(['', '+'], repeat = len(S) - 1):
    cmd = ''.join([s + t for s, t in zip(S, p)]) + S[-1]
    ans += eval(cmd)
print(ans)
Problem p04039 (python)

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

def is_ok(num):
  s = str(num)
  for ng in d:
    if ng in s: return False
  
  return True

while True:
  if is_ok(n):
    print(n)
    exit()
  
  n += 1

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

def is_ok(num):
  s = str(num)
  for ng in d:
    if ng in s: return False
  
  return True

while True:
  if is_ok(n):
    print(n)
    exit()
  
  n += 1
Problem p02631 (python)

Fixed submission:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n = i_input()
    num_list = i_list()

    sum_d = 0
    for num in num_list:
        sum_d ^= num

    ans_list = []
    for num in num_list:
        ans_list.append(sum_d ^ num)

    print(*ans_list)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n = i_input()
    num_list = i_list()

    sum_d = num_list[0] ^ num_list[1] ^ num_list[2] ^ num_list[3]

    ans_list = []
    for num in num_list:
        ans_list.append(sum_d ^ num)

    print(*ans_list)

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

Fixed submission:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    x, n = i_map()
    if n == 0:
        print(x)
        exit()
    num_list = i_list()

    abs_num = INF
    ans_list = []

    for i in range(0,102):
        if i in num_list:
            continue
        if abs_num > abs(i-x):
            ans_list = []
            abs_num = abs(i-x)
            ans_list.append(i)
        elif abs_num == abs(i-x):
            ans_list.append(i)

    ans_list.sort()

    print(ans_list[0])

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    x, n = i_map()
    if n == 0:
        print(x)
        exit()
    num_list = i_list()

    num_list.sort()

    abs_num = INF
    ans_list = []

    for i in range(1,101):
        if i in num_list:
            continue
        if abs_num > abs(i-x):
            ans_list = []
            abs_num = abs(i-x)
            ans_list.append(i)
        elif abs_num == abs(i-x):
            ans_list.append(i)

    ans_list.sort()

    print(ans_list[0])

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

Fixed submission:
mod = 1000000007

# 繰り返し二乗法  
def mod_pow(a, n, p):
    if n == 1:
        return a % p
    if n % 2 == 1:
        return (a* mod_pow(a, n - 1, p)) % p
    tmp = mod_pow(a, n / 2, p)
    return ( tmp * tmp ) % p

# 組み合わせ
def mod_cmb(n, k, p):
    if n < 0 or k < 0 or n < k: return 0
    if n == 0 or k == 0: return 1
    if (k > n - k):
        return mod_cmb(n, n - k, p)
    c = d = 1
    for i in range(k):
        c *= (n - i)
        d *= (k - i)
        c %= p
        d %= p
    return c * mod_pow(d, p - 2, p) % p

def main():
    n, a, b = map(int, input().split())

    ans = mod_pow(2, n, mod) - 1

    tmp_a = mod_cmb(n , a, mod)
    tmp_b = mod_cmb(n , b, mod)

    print((ans-tmp_a-tmp_b)%mod)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
mod = 1000000007

def mod_cmb(n: int, k: int, p: int) -> int:
    if n < 0 or k < 0 or n < k: return 0
    if n == 0 or k == 0: return 1
    if (k > n - k):
        return mod_cmb(n, n - k, p)
    c = d = 1
    for i in range(k):
        c *= (n - i)
        d *= (k - i)
        c %= p
        d %= p
    return c * pow(d, -1, p) % p

def main():
    n, a, b = map(int, input().split())

    ans = pow(2, n, mod) - 1

    tmp_a = mod_cmb(n , a, mod)
    tmp_b = mod_cmb(n , b, mod)

    print((ans-tmp_a-tmp_b)%mod)

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

Fixed submission:
import sys, re
from math import ceil, floor, sqrt, pi#, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_rpw_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 7)
INF = float('inf')
MOD = 10 ** 9 + 7

def dfs(current, parent, edges, ans_list):
    for child in edges[current]:
        if child == parent:
            continue
        ans_list[child] += ans_list[current]
        dfs(child, current, edges, ans_list)

def main():
    n, q = i_map()

    edges = [[] for _ in range(n)]
    for i in range(n-1):
        a, b = i_map()
        edges[a-1].append(b-1)
        edges[b-1].append(a-1)

    ans_list = [0] * n
    for i in range(q):
        p, x = i_map()
        ans_list[p-1] += x

    dfs(0, -1, edges, ans_list)

    print(*ans_list)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def i_map(): return map(int, input().split())
sys.setrecursionlimit(10 ** 7)

def dfs(current, parent, edges, ans_list):
    for child in edges[current]:
        if child == parent:
            continue
        ans_list[child] += ans_list[current]
        dfs(child, current, edges, ans_list)

def main():
    n, q = i_map()

    edges = [[] for _ in range(n)]
    for i in range(n-1):
        a, b = i_map()
        edges[a-1].append(b-1)
        edges[b-1].append(a-1)

    ans_list = [0] * n
    for i in range(q):
        p, x = i_map()
        ans_list[p-1] += x

    dfs(0, -1, edges, ans_list)

    print(*ans_list)

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

Fixed submission:
import copy

def main():
    n = int(input())
    num_list = [int(input()) for _ in range(n)]

    tmp = copy.deepcopy(num_list)
    tmp.sort()

    max_first = max(num_list)
    max_second = tmp[n-2]
    
    for num in num_list:
        if num == max_first:
            print(max_second)
            continue
        print(max_first)
        
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    num_list = [int(input()) for _ in range(n)]

    tmp = copy.deepcopy(num_list)
    tmp.sort()

    max_first = max(num_list)
    max_second = tmp[1]
    
    for num in num_list:
        if num == max_first:
            print(max_second)
        else:
            print(max_first)
        
if __name__ == '__main__':
    main()
Problem p02981 (python)

Fixed submission:
def main():
    n, a, b = map(int, input().split())
 
    train = n * a
    taxi = b
 
    print(min(train,taxi))
 
if __name__ == '__main__':
    main()

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

    train = n * a
    taxi = b

    print(min(train,taxi))

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

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

    sum = 0
    ans = 1

    for i in num_list:
        sum += i
        if sum <= x:
            ans += 1

    print(ans)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n,x = map(int, input().split())
    num_list = list(map(int, input().split()))

    count = 0
    sum = 0

    while(sum <= x):
        sum += num_list[count]
        count += 1

    print(count)

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

Fixed submission:
def main():
    b = input()

    if b == 'A':
        print('T')
    elif b == 'T':
        print('A')
    elif b == 'C':
        print('G')
    elif b == 'G':
        print('C')

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    b = input()

    if b == 'A':
        print('T')
    else b == 'T':
        print('A')
    else b == 'C':
        print('G')
    else b == 'G':
        print('C')

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

Fixed submission:
import numpy as np

def main():
    n = int(input())
    junbi_num = list(map(int, input().split()))
    exam_num = list(map(int, input().split()))

    min = -1

    if sum(junbi_num) < sum(exam_num):
        print(min)
        exit()

    sabun_list = np.array(junbi_num) - np.array(exam_num)

    min = np.count_nonzero(sabun_list < 0)
    
    plus_list = sabun_list[sabun_list > 0]
    plus_list = np.sort(plus_list)[::-1]

    minus = sum(sabun_list[sabun_list < 0])

    i = 0
    while(minus < 0):
        minus += plus_list[i]
        i += 1
        min += 1

    print(min)

if __name__ == '__main__':
    main()

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

def main():
    n = int(input())
    junbi_num = list(map(int, input().split()))
    exam_num = list(map(int, input().split()))

    min = -1

    if sum(junbi_num) < sum(exam_num):
        print(min)
        exit()

    sabun_list = np.array(junbi_num) - np.array(exam_num)

    min = np.count_nonzero(sabun_list < 0)
    
    plus_list = sabun_list[sabun_list > 0]
    plus_list = np.sort(plus_list)[::-1]

    minus = sum(sabun_list[sabun_list < 0])

    i = 0
    while(minus < 0):
        minus += plus_list[i]
        i += 1
        min += 1

    print(min)

if __name__ == '__main__':
    main()