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

Fixed submission:
import numpy as np

N = int(input())
T, A = list(map(int, input().split()))
H = np.array(list(map(int, input().split())))

num = np.abs(A - (T - H * 0.006))
print(np.argmin(num) + 1)

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

num = np.abs(A - (T - H * 0.006))
print(np.argmin(num) + 1)
Problem p03244 (python)

Fixed submission:
from collections import Counter

n = int(input())
v = list(map(int, input().split()))

e = Counter(v[::2]).most_common()
o = Counter(v[1::2]).most_common()

if len(set(v)) == 1:
    ans = n // 2
elif e[0][0] != o[0][0]:
    ans = n - e[0][1] - o[0][1]
else:
    ans = min(n - e[0][1] - o[1][1],
              n - e[1][1] - o[0][1])
print(ans)

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

num = set(v)

if len(num) == 1:
    print(n//2)
else:
    value = []
    num = list(num)
    for i in range(len(num)):
        value.append(v.count(num[i]))

    value.sort()

    if len(num) == 3:
        print(value[0])
    elif len(num) == 2:
        print(0)
    else:
        print(sum(value.sort[0:2]))
Problem p03260 (python)

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

if a % 2 == 1 and b % 2 == 1:
  print('Yes')
else:
  print('No')

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

if a % 2 == 1 or b % 2 == 1:
  print('No')
  else:
    print('Yes')

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

if a % 2 == 1 or b % 2 == 1:
  print('No')
else:
  print('Yes')
Problem p03261 (python)

Fixed submission:
n = int(input())
w = []
flag = 1

for i in range(n):
    s = input()
    if s in w:
        flag = 0
        break
    else:
        w.append(s)

if flag != 0:
    if w[0][-1] != w[1][0]:
        flag = 0
    for i in range(1, n-1):
        if w[i][-1] != w[i+1][0]:
            flag = 0
            break

if flag == 0:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):

n = int(input())
w = []

for i in range(n):
    s = input()
    if s in w:
        flag = 0
        break
    else:
        w.append(s)

for i in range(1, n-1):
    if w[i][-1] != w[i+1][0]:
        flag = 0
        break

if flag == 0:
    print('No')
else:
    print('Yes')
Problem p03280 (python)

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

total = a * b - (a + b - 1)

print(total)

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

total = a * b - (a + b - 1)

print(total)
Problem p03282 (python)

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

if S[:K].count('1') == K:
    print(1)
else:
    for s in S[:K]:
        if s != '1':
            print(s)
            break

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

i = 0
while True:
    if S[i] != '1':
        print(S[i])
        break
    else:
        i += 1

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())

value = 5000000000000000
pos = 0

if k <= value:
     while True:
         if s[pos] != '1':
             print(s[pos])
             break
         else:
             pos += 1

else:
    tmp = 0
    pos = 0
    while True:
        if s[pos] != '1':
            if int(s[pos]) + tmp > k // value:
                print(s[pos])
                break
            else:
                pos += 1
                tmp += int(s[pos])
Problem p03289 (python)

Fixed submission:
s = input()
    
if s[0] != 'A' or s[1].islower() == False or s[-1].islower() == False:
    print('WA')
elif s[2:-1].count('C') != 1:
    print('WA')
else:
    flag = 'AC'
    for i in range(3, len(s)-1):
        if s[i].islower() or s[i] == 'C':
            flag = 'AC'
        else:
            flag = 'WA'
            break
    print(flag)

Buggy submission (verdict: Runtime Error):
s = input()
    
if s[0] != 'A' or s[1].islower() == False or s[-1].islower() == False:
    print('WA')
elif s[2:-1].count('C') != 1:
    print('WA')
else:
    for i in range(3, len(s)-1):
        if s[i].islower() or s[i] == 'C':
            flag = 'AC'
        else:
            flag = 'WA'
            break
    print(flag)

Buggy submission (verdict: Runtime Error):
s = input()
    
if s[0] != 'A' or s[1].islower() == False or s[-1].islower() == False:
    print('WA')
elif s[2:-1].count('C') != 1:
    print('WA')
else:
    #and s[3:-2].islower() and
    for i in range(3, len(s)-2):
        if s[i].islower():
            flag = 'AC'
        else:
            flag = 'WA'
            break
    print(flag)
Problem p03323 (python)

Fixed submission:
a, b = list(map(int, input().split()))
 
if a > 8 or b > 8:
    print(':(')
else:
    print('Yay!')

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

if a > 8 or b > 8:
    print(':(')
else:
    print('Yay!')

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

if a > 8 or b > 8:
    print(':(')
else:
    print('Yay!')
Problem p03339 (python)

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

min_count = N

left = {'W':0, 'E':0}
w = S.count('W')
right = {'W':w, 'E':N-w}

for i in range(N):
    base = S[i]
    right[base] -= 1
    min_count = min(left['W']+right['E'], min_count)
    left[base] += 1
print(min_count)

Buggy submission (verdict: Runtime Error):
import sys

input = sys.stdin.readline

def main():
    N = int(input())
    S = input()
    
    ans = float('inf')
    
    W = {'W':0, 'E':0}
    n = S.count('E')
    E = {'W':N-n, 'E':n}
    
    for s in S:
        E[s] -= 1
        
        ans = min(ans, E['E'] + W['W'])
        
        W[s] += 1
        
    print(ans)
    
if __name__ == '__main__':
    main()
Problem p03354 (python)

Fixed submission:
def find(x):
    while union[x] != x:
        x = union[x]
        
    return x

N, M = map(int, input().split())
p = list(map(int, input().split()))

union = [i for i in range(N+1)]

for i in range(M):
    x, y = map(int, input().split())
    x = find(x)
    while union[y] != y:
        union[y], y = x, union[y]
        
    union[y] = x
    
ans = 0
for idx, n in enumerate(p):
    if idx+1 == n:
        ans += 1
    else:
        x, y = find(idx+1), find(n)
        if x == y:
            ans += 1
        
print(ans)

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

#a = [0] * (H*W+1)
a = {}

for i in range(H):
    A = list(map(int, input().split()))
    for j, _ in enumerate(A):
        a[_] = (i+1, j+1)

#table = [0] * (H*W+1)
table = {i:0 for i in range(H*W+1)}

for i in range(D+1, H*W):
    x, y = a[i]
    x_, y_ = a[i-D]
    table[i] = table[i-D] + abs(x - x_) + abs(y - y_)

for i in range(int(input())):
    L, R = map(int, input().split())
    print(table[R] - table[L])
Problem p03359 (python)

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

if a <= b:
    print(a)
else:
    print(a-1)

Buggy submission (verdict: Runtime Error):
#include <stdio.h>

int main(void) {
    int a, b;

    scanf("%d %d", &a, &b);

    if (a <= b) {
        printf("%d\n", a);
    }
    else {
        printf("%d\n", b);
    }

    return 0;
}
Problem p03377 (python)

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

value = X - A

if value < 0:
    print('NO')
elif value < B:
    print('YES')
else:
    print('NO')

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

X = int(input())

value = X - A

if value < 0:
    print('NO')
elif value < B:
    print('YES')
else:
    print('NO')
Problem p03385 (python)

Fixed submission:
S = input().split()

if 'a' in S[0] and 'b' in S[0] and 'c' in S[0]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
from collections import deque

A, B, K = input().split()

A = int(A)
B = int(B)
K = int(K)

value = deque()
s = [i for i in range(A, B+1)]

value.extend(s[0:K])
value.extend(s[len(s)-K:len(s)])

num = list(set(value))

for i in range(len(num)):
    print(num[i])
Problem p03386 (python)

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

value = []

if B - A < K or B <= K:
    value.extend([i for i in range(A, B+1)])
    
else:
    value.extend([i for i in range(A, A+K)])
    value.extend([i for i in range(B-K+1, B+1)])    

num = list(set(value))
num.sort()

for i in range(len(num)):
    print(num[i])

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

A = int(A)
B = int(B)
K = int(K)

value = []
if A == B:
    value = A
if B <= K:
    value.extend([i for i in range(A, B+1)])

else:
    value.extend([i for i in range(A, A+K)])
    value.extend([i for i in range(B-K+1, B+1)])    


num = list(set(value))
num.sort()
for i in range(len(num)):
    print(num[i])

Buggy submission (verdict: Runtime Error):
from collections import deque

A, B, K = input().split()

value = deque()
s = [i for i in range(A, B+1)]

value.extend(s[0:K])
value.extend(s[len(s)-K:len(s)])

num = deque(list(set(value)))

for i in range(len(num)):
    print(num[i])

Buggy submission (verdict: Runtime Error):
from collections import deque

A, B, K = input().split()

A = int(A)
B = int(B)
K = int(K)

value = deque()
s = [i for i in range(A, B+1)]

value.extend(s[0:K])
value.extend(s[len(s)-K:len(s)])

num = list(set(value)).sort()

for i in range(len(num)):
    print(num[i])

Buggy submission (verdict: Runtime Error):
from collections import deque

A, B, K = input().split()

A = int(A)
B = int(B)
K = int(K)

value = deque([])
s = deque([i for i in range(A, B+1)])

value.extend(s[0:K])
value.extend(s[len(s)-K:len(s)])

num = deque()

for i in range(len(value)):
    if value[i] not in num:
        num.append(value[i])
        print(value[i])

Buggy submission (verdict: Runtime Error):
from collections import deque

A, B, K = input().split()

A = int(A)
B = int(B)
K = int(K)

s = [i for i in range(A, B+1)]
value = deque()

for i in range(K):
    if s[i] not in value:
        value.append(s[i])

for i in range(len(s)-K, len(s)):
    if s[i] not in value:
        value.append(s[i])

for i in range(len(value)):
    print(value[i])
Problem p03401 (python)

Fixed submission:
from collections import deque

N = int(input())
A = deque(map(int, input().split()))

A.append(0)
A.appendleft(0)

A_diff = [abs(A[i+1] - A[i]) for i in range(N+1)]
A_sum = sum(A_diff)

for i in range(N):
    print(A_sum - (A_diff[i] + A_diff[i+1]) + abs(A[i+2] - A[i]))

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

for i in range(len(spot)):
    spot = int(spot)

for i in range(n):
    total = 0
 
    pos = 0
    
    for l in range(n):
        if i != l:
            money = pos - spot[l]
            pos = spot[l]
            
            if money < 0:
                money *= -1
            total += money
 
    if pos < 0:
        pos *= -1
    total += pos
    
    print(total)

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

for i in range(len(spot)):
    spot = int(spot)

for i in range(n):
    total = 0
 
    pos = 0
    
    for l in range(n):
        if i != l:
            money = pos - int(spot[l])
            pos = int(spot[l])
            
            if money < 0:
                money *= -1
            total += money
 
    if pos < 0:
        pos *= -1
    total += pos
    
    print(total)
Problem p03418 (python)

Fixed submission:
N, K = list(map(int, input().split()))
ans = 0

for b in range(1, N+1):
	p = N // b
	r = N % b
	
	ans += p * max(0, b-K)
	ans += max(0, r-K+1)
	
print(ans-N*(not K))

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

count = 0

for a in range(1, N_K+1[0]):
  for b in range(1, N_K+1[0]):
    if a % b >= N_K[1]:
      count += 1
    
print(count)
Problem p03436 (python)

Fixed submission:
import queue

H, W = list(map(int, input().split()))
s = [list(input()) + ['#'] for i in range(H)] + [['#' for i in range(W+1)]]
white = sum([s[i].count('.') for i in range(H)])

q = queue.Queue()
s[0][0] = 1
q.put((0,0))

while not q.empty():
    i, j = q.get()
    for x, y in [(i+1,j), (i-1,j), (i,j+1), (i,j-1)]:
        if s[x][y] == '.':
            s[x][y] = s[i][j]+1
            q.put((x, y))

if s[H-1][W-1] in ['.', '#']:
    print(-1)
else:
    print(white-s[H-1][W-1])

Buggy submission (verdict: Runtime Error):
import queue

H, W = list(map(int, input().split()))
s = [list(input()) + ['#'] for i in range(H)] + [['#' for i in range(W+1)]]
white = sum([s[i].count('.') for i in range(H)])

q = queue.PriorityQueue()
s[0][0] = 1
q.put((0,0))

while not q.empty():
    i, j = q.get()
    for x, y in [(i+1,j), (i-1,j), (i,j+1), (i,j-1)]:
        if s[x][y] == '.':
            s[x][y] = s[i][j]+1
            q.put((x, y))

print(white-s[H-1][W-1])
Problem p03449 (python)

Fixed submission:
N = int(input())

A = []
A.append(list(map(int, input().split())))
A.append(list(map(int, input().split())))

if N > 1:
    up = A[0][1]
    down = A[1][0]

    for i in range(1, N-1):
        up_ = up + A[1][i]
        down += A[1][i]
        up += A[0][i+1]

        down = max(down, up_)

    print(max(up, down)+A[0][0]+A[1][N-1])
else:
    print(A[0][0]+A[1][0])

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

A = []
A.append(list(map(int, input().split())))
A.append(list(map(int, input().split())))

if N > 1:
    up = A[0][1]
    down = A[1][0]

    for i in range(1, N-1):
        up_ = up + A[1][i]
        down += A[1][i]
        up += A[0][i+1]

        down = max(down, up_)

    print(max(up, down)+A[0][0]+A[1][N-1])
else:
    print(sum(A))

Buggy submission (verdict: Runtime Error):
from collections import deque

N = int(input())
A = deque()
A.append(list(map(int, input().split())))
A.append(list(map(int, input().split())))

value_A = A[0][0] + A[0][1]
value_B = A[0][0] + A[1][0]

for i in range(2, N):
    value_C = value_A + A[1][i-1]
    value_A += A[0][i]
    value_B += A[1][i-1]

    if value_B < value_C:
        value_B = value_C

print(str(max(value_A, value_B, value_C) + A[1][N-1]))

Buggy submission (verdict: Runtime Error):
from collections import deque

N = int(input())
A = deque()
A.append(list(map(int, input().split())))
A.append(list(map(int, input().split())))

if N == 1:
    print(str(A[0][0] + A[1][0]))
else:
    value_A = A[0][0] + A[0][1]
    value_B = A[0][0] + A[1][0]

    for i in range(2, N):
        value_C = value_A + A[1][i-1]
        value_A += A[0][i]
        value_B += A[1][i-1]

        if value_B < value_C:
            value_B = value_C

    print(str(max(value_A, value_B, value_C) + A[1][N-1]))
Problem p03544 (python)

Fixed submission:
N = int(input())

L0 = 2
L1 = L = 1

for i in range(N-1):
    L = L0 + L1
    L0 = L1
    L1 = L

print(L)

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

L0 = 2
L1 = 1

for i in range(N-1):
    L = L0 + L1
    L0 = L1
    L1 = L

print(L)
Problem p03605 (python)

Fixed submission:
N = input()
if '9' in N:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
if '9' in N:
  print('Yes')
else:
  print('No')
Problem p03633 (python)

Fixed submission:
import fractions as math

N = int(input())
T = [int(input()) for i in range(N)]

for i in range(1, N):
    T[i] = T[i] * T[i-1] // math.gcd(T[i], T[i-1])
print(T[-1])

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
T = [int(input()) for i in range(N)]

for i in range(1, N):
    T[i] = int(T[i] * T[i-1] / math.gcd(T[i], T[i-1]))
print(T[-1])
Problem p03695 (python)

Fixed submission:

from collections import Counter

N = int(input())
a = Counter(list(map(lambda x: x//400, map(int, input().split()))))

c = n = 0
for key in [0,1,2,3,4,5,6,7]:
    if a[key]:
        c += 1
        
for key in [8,9,10,11,12]:
    n += a[key]
        
max_n = c+n
if c:
    min_n = c
else:
    min_n = 1
print(min_n, max_n)

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

late = [0 for i in range(9)]

for n in a:
    late[n//400] += 1

max_a = min_a = 8-late[:-1].count(0)
if late[8] and not min_a:
    min_a = 1

if late[8]:
    max_a = min(max_a+late[8], 8)

print(min_a, max_a)
Problem p02999 (python)

Fixed submission:
x,a=map(int, input().split())
if(x<a):
    print (0)
else:
    print (10)

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

d=0
for i in range(n+1):
   d=d+w_list[i]
   if(d>x):
       break
print(i+1)

Buggy submission (verdict: Runtime Error):
p,q,r=map(int, input().split()) #spaceno
N=[p,q,r]
N.sort()
print (N[0]+N[1])
Problem p03000 (python)

Fixed submission:
n,x = map(int,input().split())
li = list(map(int,input().split()))
 
ans = 1
now = 0
 
for i in li:
    now += i
    if now <= x:
        ans += 1
    else:
        break
 
print(ans)

Buggy submission (verdict: Runtime Error):
n,x,=map(int, input().split())
w_list = list(map(int, input().split()))
 
d=0
ans=0
for i in w_list:
   d=d+i
   ans++
   if(d>x):
       break
print(ans)

Buggy submission (verdict: Runtime Error):
n,x,=map(int, input().split())
w_list = list(map(int, input().split()))
 
d=0
for i in range(n+1):
   d=d+w_list[i]
   if(d>x):
       break
print(i+1)

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

d=0
if(x==1):
print(0)
else:
    for i in range(n):
        d=d+w[i]
        if(d>x):
            break
        if(d>=10000):
            break
   
    print(i+1)

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

d=0
if(x==0):
print(0)
else:
    for i in range(n):
        d=d+w[i]
        if(d>x):
            break
        if(d>=10000):
            break
   
    print(i+1)

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

d=0
for i in range(n+1):
   d=d+w_list[i]
   if(d>x):
       break
   if(d>10000):
       break
   
   
print(i+1)

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

d=0
for i in range(n+1):
   d=d+w_list[i]
   if(d>x):
       break
   
print(i+1)

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

d=0
for i in range(n+1):
   d=d+w_list[i]
   if(d>x):
       break
print(i+1)

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

d=0
for i in range(n+1):
   d=d+w_list[i]
   if(d>x):
       break
print(i+1)

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

d=0
for i in range(n+1):
   d=d+w_list[i]
   if(d>x):
       break
print(i+1)
Problem p02582 (python)

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

Buggy submission (verdict: Runtime Error):
s = input()
sum_ = 0
if s[0] == 'R':
  sum_ += 1
  if s[1] == 'R':
    sum_ += 1
    if s[2] == 'R':
      sum_ += 1
  else:
    sum_ = 1
else:
  if s[1] == 'R':
    sum_ += 1
    if s[2] == 'R':
      sum_ += 1
  else:
    s[2] == 'R':
      sum_ = 1
print(sum_)
Problem p02612 (python)

Fixed submission:
n = input()
if len(n) < 3:
  print(1000 - int(n))
else:
  hasuu = n[len(n) - 3:]
  if hasuu == '000':
    print('0')
  else:
    print(1000-int(hasuu))

Buggy submission (verdict: Runtime Error):
n = input()
if len(n) < 3:
  print(1000 - int(n))
else:
  hasuu = n[len(n) - 3:]
  if hasuu == '000':
    print('0')
  else:
    print(1000-int(hasuu)
Problem p02613 (python)

Fixed submission:
n = int(input())
c0 = 0
c1 = 0
c2 = 0
c3 = 0
for i in range(n):
  s = input()
  if s == 'AC':
    c0 += 1
  elif s == 'WA':
    c1 += 1
  elif s == 'TLE':
    c2 += 1
  else:
    c3 += 1
print(f'AC x {c0}')
print(f'WA x {c1}')
print(f'TLE x {c2}')
print(f'RE x {c3}')

Buggy submission (verdict: Runtime Error):
n = int(input())
c0 = 0
c1 = 0
c2 = 0
c3 = 0
for i in ragne(n):
  s = input()
  if s == 'AC':
    c0 += 1
  elif s == 'WA':
    c1 += 1
  elif s == 'TLE':
    c2 += 1
  else:
    c3 += 1
print(f'AC x {c0}')
print(f'WA x {c1}')
print(f'TLE x {c2}')
print(f'RE x {c3}')
Problem p02628 (python)

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

print(sum(sorted(p)[:k]))

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

print(sum(sorted(p)[:k])
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
import decimal
n = int(input())
a = list(map(int, input().split()))
ans = 1
if 0 in a:
  print(-1)
else:
  flag = True
  for i in a:
    ans *= i
    if ans > (10 ** 18):
      print(-1)
      flag = False
      break
  if flag:
    print(ans)

Buggy submission (verdict: Runtime Error):
import decimal
n = int(input())
a = list(map(int, input().split()))
ans = decimal.Decimal(1)
if 0 in a:
  print(-1)
else:
  for i in a:
    ans *= i
  if ans < (10 ** 18 + 1):
    print(ans)
  else:
    print(-1)
Problem p02658 (python)

Fixed submission:
def main():
  n = int(input())
  a = list(map(int, input().split()))
  if 0 in a:
    print(0)
    return
  
  ans = 1
  for i in a:
    ans *= i
    if ans > (10 ** 18):
      print(-1)
      return
  print(ans)
  
main()

Buggy submission (verdict: Runtime Error):
import decimal
n = int(input())
a = list(map(int, input().split()))
ans = decimal.Decimal(1)
if 0 in a:
    print(-1)
else:
    for i in a:
        ans *= i
    if ans < (10 ** 18 + 1):
        print(ans)
    else:
        print(-1)
Problem p02683 (python)

Fixed submission:
from itertools import product

n,m,x = list(map(int, input().split()))
book = []
for i in range(n):
    book.append(list(map(int, input().split())))

ans = 10 ** 5 * n
flag = False
for i in product([0,1], repeat=n):
    price = 0
    skill = [0] * m
    for index_, bit in enumerate(i):
        if bit:
            for j in range(m):
                skill[j] += book[index_][ j + 1]
            price += book[index_][0]
    if all(v >= x for v in skill):
        ans = min(ans, price)
        flag = True
if flag:
    print(ans)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
n,m,x = list(map(int, input().split()))
book = []
for i in range(n):
  book.append(list(map(int, input().split())))
ans = 10 ** 5 * n
for i in product([0,1], repeat=n):
  price = 0
  skill = [0] * m
  for index_, bit in enumerate(i):
    if bit:
      for j in range(m):
        skill[j] += book[index_][ j + 1]
        price += book[index_][0]
  if all(v >= x for v in skill):
    ans = min(ans, price)
        
print(ans)
Problem p02898 (python)

Fixed submission:
_,a = list(map(int,input().split()))
hoge = list(map(int,input().split()))
count = 0
for i in hoge:
  if i >= a:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
_,b = list(map(int, input()))
hoge = list(map(int,input()))

count = 0
for i in hoge:
  if i >= b:
    count += 1
    
print(count)
Problem p02899 (python)

Fixed submission:
import numpy as np
_ = input()
hoge = np.array(list(map(int, input().split())))

res = ''
for i in np.argsort(hoge):
  res += str(i + 1) + ' '
print(res[:-1])

Buggy submission (verdict: Runtime Error):
import numpy as np
_ = input()
hoge = np.array(list(map(int, input().split())))

res = ''
for i in np.argsort(hoge):
  res += str(i) + ' '
print(res[:-1]
Problem p03456 (python)

Fixed submission:
import math
a,b = input().split()
hoge = int(a + b)
root_hoge = int(math.sqrt(hoge))
if hoge / root_hoge == root_hoge:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
import math
a = input().replace(' ','')
root_a = int(math.sqrt(a))
if a / root_a == root_a:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
import math
a,b = input().split()
hoge = int(a + b)
root_hoge = math.sqrt(hoge)
if a / root_hoge == root_hoge:
  print('Yes')
else:
  print('No')