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

Fixed submission:
n, t = map(int, input().split())
routes = []
for _ in range(n):
  routes.append(tuple(map(int, input().split())))
try:
  print(min(route[0] for route in routes if route[1]<=t))
except:
  print("TLE")

Buggy submission (verdict: Runtime Error):
n, t = map(int, input().split())
routes = []
for _ in range(n):
  routes.append(tuple(map(int, input().split())))
print(min(route[0] for route in routes if route[1]<t))

Buggy submission (verdict: Runtime Error):
n, t = map(int, input().split)
routes = []
for _ in range(n):
  routes.append(tuple(map(int, input().split)))
print(min(route[0] for route in routes if route[1]<t))
Problem p03281 (python)

Fixed submission:
n = int(input())

if n >= 195:
    print(5)
elif n >= 189:
    print(4)
elif n >= 165:
    print(3)
elif n >= 135:
    print(2)
elif n >= 105:
    print(1)
else:
    print(0)

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

if n >= 195:
    print(5)
elif n >= 189:
    print(4)
elif n >= 165:
    print(3)
elif n >= 135:
    print(2)
elif n >= 105:
    print(1)
else:
    print(0)
Problem p03294 (python)

Fixed submission:
n = int(input())
a_list = list(map(int, input().split(" ")))
a_list = [ a - 1 for a in a_list]
print(sum(a_list))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce


def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)


def lcm(numbers):
    return reduce(lcm_base, numbers, 1)


n = int(input())
a_list = list(map(int, input().split(" ")))

max_iter = lcm(a_list)
# print(max_iter)

max_val = -1

for i in range(max_iter + 1):
    # print("===============")
    # print("Max val = {}, i = {}".format(max_val, i))
    val = sum([i % a for a in a_list])
    max_val = max(max_val, val)

print(max_val)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce


def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)


def lcm(numbers):
    return reduce(lcm_base, numbers, 1)


n = int(input())
a_list = list(map(int, input().split(" ")))

max_iter = lcm(a_list)
# print(max_iter)

max_val = -1

for i in range(max_iter + 1):
    # print("===============")
    # print("Max val = {}, i = {}".format(max_val, i))
    val = sum([i % a for a in a_list])
    max_val = max(max_val, val)

print(max_val)
Problem p03310 (python)

Fixed submission:
import sys
 
n = int(input())
a = list(map(int, input().split()))
aa = [0]
for i in range(n):
    aa.append(aa[i] + a[i])
 
ans = sys.maxsize
 
def getdiff(left, center, right):
    return abs((aa[center] - aa[left]) - (aa[right] - aa[center]))
 
L = 1
R = 3
 
for C in range(2, n):
    while L + 1 < C and getdiff(0, L, C) > getdiff(0, L + 1, C):
        L += 1
    while R + 1 < n and getdiff(C, R, n) > getdiff(C, R + 1, n):
        R += 1
    pqrs = [aa[L], aa[C] - aa[L], aa[R] - aa[C], aa[n] - aa[R]]
    pqrs.sort()
    ans = min(ans, pqrs[3] - pqrs[0])
 
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
 
n = int(input())
a = list(map(int, input().split()))
aa = [0] + [sum(A[:i + 1]) for i in range(N)] 
ans = sys.maxsize
 
def getdiff(left, center, right):
    return abs((aa[center] - aa[left]) - (aa[right] - aa[center]))
 
L = 1
R = 3
 
for C in range(2, n):
    while L + 1 < C and getdiff(0, L, C) > getdiff(0, L + 1, C):
        L += 1
    while R + 1 < n and getdiff(C, R, n) > getdiff(C, R + 1, n):
        R += 1
    pqrs = [aa[L], aa[C] - aa[L], aa[R] - aa[C], aa[n] - aa[R]]
    pqrs.sort()
    ans = min(ans, pqrs[3] - pqrs[0])
 
print(ans)

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

summation = sum(A_list)
quarter_sum = summation / 4

temp_sum = 0
sum_list = []

for i in range(N):
    old_temp_sum = temp_sum
    temp_sum += A_list[i]
    if i == N - 1:
        sum_list.append(temp_sum)
        break

    if temp_sum >= quarter_sum:
        if abs(quarter_sum - temp_sum) >= abs(quarter_sum - old_temp_sum):
            sum_list.append(old_temp_sum)
            temp_sum = A_list[i]
        else:
            sum_list.append(temp_sum)
            temp_sum = 0

print(max(sum_list) - min(sum_list))
Problem p03361 (python)

Fixed submission:
# 方針：黒く塗られるべきマスの隣（縦or横）に、同様のマスがあれば塗れる→Yes
# 逆に、黒く塗られるべきマスに接していない、黒く塗られるべきマスがあると、達成は不可能→No

# 行数・列数の入力(Row, Column)
R, C = list(map(int, input().split(" ")))
# print(R, C)

# Want map = 設計図、Can map = 塗れるかのマップ
want_map = []
can_map = []

for r in range(R):
    # 一行ずつ、両マップを更新
    want_map.append(list(input()))
    can_map.append(["?"] * C)
#    print("Want Map: {}".format(want_map))

    for c in range(C):
        if can_map[r][c] != "feasible":
            if want_map[r][c] == ".":
                can_map[r][c] = "feasible"

            else:
                if c + 1 < C:
                    if want_map[r][c+1] == "#":
                        can_map[r][c] = "feasible"
                        can_map[r][c+1] = "feasible"
        else:
            if c + 1 < C:
                if want_map[r][c + 1] == "#":
                    can_map[r][c + 1] = "feasible"

        if r != 0:
            if (want_map[r][c] == "#") & (want_map[r-1][c] == "#"):
                can_map[r][c] = "feasible"
                can_map[r-1][c] = "feasible"

#    print("Can Map: {}".format(can_map))


# can_mapの中に"?"が残っていたらNo, なければYes
can_elements = []

for can_map_row in can_map:
    can_elements.extend(can_map_row)

if "?" in can_elements:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
# 方針：黒く塗られるべきマスの隣（縦or横）に、同様のマスがあれば塗れる→Yes
# 逆に、黒く塗られるべきマスに接していない、黒く塗られるべきマスがあると、達成は不可能→No

# 行数・列数の入力(Row, Column)
H, W = list(map(int, input().split(" ")))

# 全入力を２次元配列へと変換
paint_map = []
for h in range(H):
    paint_map.append(list(input()))

# 各マス目の周りに黒があるかを確認する
ans = True  # 最終的な出力。始めは、塗ることが可能であるとして初期化してある

dx = [1, -1, 0, 0]
dy = [0, 0, 1, -1]

for i in range(H):
    for j in range(W):
        if paint_map[i][j] == "#":
            found = False  # 注目している黒マスの周りに、別の黒マスを見つけたか

            for k in range(k):
                ii = i + dx[k]
                jj = j + dy[k]

                if (H > ii >= 0) & (W > jj >= 0) & (paint_map[ii][jj] == "#"):  # 注目している座標がキャンパス上にあり、かつ黒色なら。
                    found = True

            if not found:  # もしも注目している黒マスの周りに、別の黒マスが見つからなかったら
                ans = False

print("Yes") if ans else print("No")
Problem p03371 (python)

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

# A 1枚、B 1枚を2C円で買うと捉え直す。
# ピザは、最大でも10**5枚（A, Bそれぞれに対して）
# A, Bのセットを、1~10**セットまで動かして一番安い組を考える

cheapest = float("inf")

for i in range(max(X, Y) + 1):

    price = 2 * C * i + A * max(0, X - i) + B * max(0, Y - i)

    cheapest = min(cheapest, price)

print(cheapest)

Buggy submission (verdict: Runtime Error):
A, B, C, X, Y = list(map(int, input().split()))

# A 1枚、B 1枚を2C円で買うと捉え直す。
# ピザは、最大でも10**5枚（A, Bそれぞれに対して）
# A, Bのセットを、1~10**セットまで動かして一番安い組を考える

cheapest = float("inf")

for i in range(max(X, Y) + 1):

    price = 2 * C * i + A * max(0, X - i) + B * max(Y - i)

    cheapest = min(cheapest, price)

print(cheapest)
Problem p03386 (python)

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

a_upper = min(b, a+k-1)
b_lower = max(a, b-k+1)

u = set(range(a, a_upper+1))
v = set(range(b_lower, b+1))

for i in sorted(list(u | v)):
    print(i)

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

l = list(range(a, b + 1))
l_low = l[:k]
l_up = l[-k:]

ll = sorted(list(set(l_low + l_up)))
for i in ll:
    print(i)

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

l = list(range(a, b + 1))
l_low = l[:k]
l_up = l[-k:]

ll = sorted(list(set(l_low + l_up)))

for i in ll:
    print(i)

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

l = list(range(a, b + 1))
l_low = l[:k]
l_up = l[-k:]

ll = sorted(list(set(l_low + l_up)))
for i in ll:
    print(i)
Problem p03633 (python)

Fixed submission:
from functools import reduce


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm_base(a, b):
    return a * b // gcd(a, b)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


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

for _ in range(n):
    T.append(int(input()))

print(lcm(*T))

Buggy submission (verdict: Runtime Error):
from math import gcd
from functools import reduce


def lcm_base(a, b):
    return (a * b) // gcd(a, b)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


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

for _ in range(n):
    T.append(int(input()))

print(lcm(*T))
Problem p03695 (python)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
count = [0 for _ in range(9)]
for i in range(n):
    if A[i] // 400 >= 8:
        count[8] += 1
    elif count[A[i] // 400] == 0:
        count[A[i] // 400] += 1

if count[8] == sum(count):
    print(1, sum(count))
else:
    print(sum(count)-count[8], sum(count))

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))
count= [0 for _ in range(9)]
for i in range(n):
    if a[i] // 400 >= 8:
        count[8] += 1
    elif count[a[i] // 400] == 0:
        count[a[i] // 400] += 1

if count[8] == sum(count):
    print(1, sum(count))
else:
    print(sum(count)-count[8], sum(count))
Problem p03323 (python)

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

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a<=8:
    if b<=8:
        print('Yay!')
    else:
        print(': (')
else:
    print(': (')

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a<=8 and b<=8:
    print('Yay!')
else:
    print(': (')

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a<=8 and b<=b:
    print('Yay!')
else:
    print(': (')
Problem p03363 (python)

Fixed submission:
import collections
n=int(input())
A=list(map(int,input().split()))
x=0
lst=[]
for i in range(n):
    x+=A[i]
    lst.append(x)
c=collections.Counter(lst)

 
def conv(n,m):
    if n==m or m==0:
        return 1
    else:
        return conv(n-1,m-1)+conv(n-1,m)
ans=0
for k in c.keys():
    if c[k]==1:
        if k==0:
            ans+=1
        else:
            continue
    elif k==0:
        ans+=c[k]+int(c[k]*(c[k]-1)/2)
    else:
        ans+=int(c[k]*(c[k]-1)/2)
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
n=int(input())
A=list(map(int,input().split()))
x=0
lst=[]
for i in range(n):
    x+=A[i]
    lst.append(x)
c=collections.Counter(lst)

 
def conv(n,m):
    if n==m or m==0:
        return 1
    else:
        return conv(n-1,m-1)+conv(n-1,m)
ans=0
for k in c.keys():
    if c[k]==0:
        continue
    if c[k]==1:
        if k==0:
            ans+=1
        else:
            continue
    elif k==0:
        ans+=c[k]+conv(c[k],2)
    else:
        ans+=conv(c[k],2)
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
n=int(input())
A=list(map(int,input().split()))
x=0
lst=[]
for i in range(n):
    x+=A[i]
    lst.append(x)
c=collections.Counter(lst)

 
def conv(n,m):
    if n==m or m==0:
        return 1
    else:
        return conv(n-1,m-1)+conv(n-1,m)
ans=0
for k in c.keys():
    if c[k]==1:
        if k==0:
            ans+=1
        else:
            continue
    elif k==0:
        ans+=c[k]+conv(c[k],2)
    else:
        ans+=conv(c[k],2)
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
A=list(map(int,input().split()))
x=0
lst=[]
for i in range(n):
    x+=A[i]
    lst.append(x)
ans=0

    
def conv(n,m):
    if n==m or m==0:
        return 1
    else:
        return conv(n-1,m-1)+conv(n-1,m)

for num in lst:
    x=lst.count(num)
    if x==0:
        break
    if x==1:
        if num==0:
            ans+=1
    elif num!=0:
        ans+=conv(x,2)
    elif num==0:
        ans+=x+conv(x,2)
    
    lst=[i for i in lst if i!=num]
    
    
    

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
A=list(map(int,input().split()))
x=0
lst=[]
for i in range(n):
    x+=A[i]
    lst.append(x)
ans=0

    
def conv(n,m):
    if n==m or m==0:
        return 1
    else:
        return conv(n-1,m-1)+conv(n-1,m)
used=[]
for num in lst:
    if num in used:
        continue
    x=lst.count(num)
    used.append(num)
    if x==1 and num!=0:
        continue
    if num==0:
        if x!=1:
            ans+=x+conv(x,2)
        else: 
            ans+=1
    else:
        ans+=conv(x,2)
    
    

print(ans)
Problem p03721 (python)

Fixed submission:
n,k=map(int,input().split())
list=[]
for i in range(n):
    a,b=map(int,input().split())
    list.append([a,b])
list.sort()
sum=0
for x in list:
    sum+=x[1]
    if sum >=k:
        print(x[0])
        break

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
list=[]
for i in range(n):
    a,b=map(int,input().split())
    list.append(str(a)*b)
list.sort
print(list[k])
Problem p03836 (python)

Fixed submission:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

def main():
    sx,sy,tx,ty = na()
    ret = ""
    for i in range(tx-sx):
        ret += "R"
    for i in range(ty-sy):
        ret += "U"
    for i in range(tx-sx):
        ret += "L"
    for i in range(ty-sy):
        ret += "D"
    ret += "L"
    for i in range(ty-sy+1):
        ret += "U"
    for i in range(tx-sx+1):
        ret += "R"
    ret += "D"
    ret += "R"
    for i in range(ty-sy+1): ret += "D"
    for i in range(tx-sx+1): ret += "L"
    ret += "U"
    print(ret)
    pass


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
2. 
3.stdin = sys.stdin
4.na = lambda: list(map(int, stdin.readline().split()))
5. 
6.k,s = na()
7.ans = 0
8.for x in range(k+1):
9.    for y in range(k+1):
10.        z = s - (x+y)
11.        if z >= 0 and z <= k:
12.            ans += 1
13.print(ans)
Problem p04039 (python)

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


while 1:
    for i in range(len(str(n))):
        if int(str(n)[i]) in dislike:
            break
        if i==len(str(n))-1:
            print(n)
            exit()
    n+=1

Buggy submission (verdict: Runtime Error):
def base_N(N,n,n_N):#N進数に変換
    if n==0:
        return int(n_N[::-1])
    else:
        n_N+=str(n%N)
        n=n//N
        return base_N(N,n,n_N)
"""
def base_N_10(N,n):#N進数を10進数に変換
    n_10=0
    for i in range(len(str(n))):
        n_10+=int(str(n)[i])*N**(len(str(n))-i-1)
    return n_10
"""


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

usable=[i for i in range(10)]
for number in dislike:
    usable.remove(number)

N=len(usable)
M=0
bit=''
num_s=''    
num_i=0



while 1:
    M+=1
    bit=str(base_N(N,M,''))
    for i in range(len(bit)):
        num_s+=str(usable[int(bit[i])])
    num_i=int(num_s)
    if num_i>=n:
        print(num_i)
        exit()
    else:
        num_s=''
        bit=''
        num_i=0

Buggy submission (verdict: Runtime Error):
def base_N(N,n,n_N):#N進数に変換
    if n==0:
        return int(n_N[::-1])
    else:
        n_N+=str(n%N)
        n=n//N
        return base_N(N,n,n_N)
"""
def base_N_10(N,n):#N進数を10進数に変換
    n_10=0
    for i in range(len(str(n))):
        n_10+=int(str(n)[i])*N**(len(str(n))-i-1)
    return n_10
"""


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

usable=[i for i in range(10)]
for number in dislike:
    usable.remove(number)

N=len(usable)
M=0
bit=''
num_s=''    
num_i=0



while 1:
    M+=1
    bit=str(base_N(N,M,''))
    for i in range(len(bit)):
        num_s+=str(usable[int(bit[i])])
    num_i=int(num_s)
    if num_i>=n:
        print(num_i)
        exit()
    else:
        num_s=''
        bit=0
        num_i=0

Buggy submission (verdict: Runtime Error):
def base_N(N,n,n_N):#N進数に変換
    if n==0:
        return int(n_N[::-1])
    else:
        n_N+=str(n%N)
        n=n//N
        return base_N(N,n,n_N)

def base_N_10(N,n):#N進数を10進数に変換
    n_10=0
    for i in range(len(str(n))):
        n_10+=int(str(n)[i])*N**(len(str(n))-i-1)
    return n_10



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

usable=[i for i in range(10)]
for number in dislike:
    usable.remove(number)

N=len(usable)
M=0
bit=0
num_s=''    
num_i=0



while 1:
    M+=1
    bit=str(base_N(N,M,''))
    for i in range(len(bit)):
        num_s+=str(usable[int(bit[i])])
    num_i=int(num_s)
    if num_i>=n:
        print(num_i)
        exit()
    else:
        num_s=''
        bit=0
        num_i=0
Problem p03417 (python)

Fixed submission:
N, M = map(int, input().split())
print(abs(N-2)*abs(M-2))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input())
print(abs((N2-)*(M-2)))
Problem p03721 (python)

Fixed submission:
AB = []
N, K = map(int, input().split())

for _ in range(N):
    a, b = map(int, input().split())
    AB.append((a, b))

AB.sort()
for ab in AB:
    K -= ab[1]
    if K <= 0:
        print(ab[0])
        exit()

Buggy submission (verdict: Runtime Error):
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
using namespace std;

long long int N, K;
long long int a, b;


int main(){
    cin >> N >> K;
    vector<pair<long long int, long long int> > pairs(N);

    for(int i = 0; i < N; i++){
        cin >> a >> b;
        pairs[i] = make_pair(a, b);
    }
    sort(pairs.begin(), pairs.end());

    for(int i = 0; i < N; i++){
        K -= pairs[i].second;
        if(K <= 0){
            cout << (pairs[i].first);
            return 0;
        }
    }
    return 0;
}
Problem p03220 (python)

Fixed submission:
import numpy as np

def palace():
    
    N = int(input())
    T, A = np.array(input().split(), dtype="int")[:2]
    H = [int(i) for i in input().split()]
    
    min_dif = 10000
    place = 0
    for i in range(N):
        temp = T - H[i] *0.006
        dif = abs(A-temp)
        
        #誤差の最小値(→候補地も更新)
        if min_dif >= dif:
            min_dif = dif
            place = i+1
    
    print(place)
    
    
palace()

Buggy submission (verdict: Runtime Error):
N = int(input())
T, A = np.array(input().split(), dtype="int")[:2]
H = [int(i) for i in input().split()]
    
min_dif = 10000
place = 0
for i in range(N):
  temp = T - H[i] *0.006
  dif = abs(A-temp)
        
  #誤差の最小値(→候補地も更新)
  if min_dif >= dif:
    min_dif = dif
    place = i+1
    
print(place)
Problem p03254 (python)

Fixed submission:
N,x = input().split()
A = input().split()
a = []
for i in range(int(N)):
  a.append(int(A[i]))
  
a.sort()
X = int(x)
 
idx = 0
while X>0 and idx<int(N):
  X = X-a[idx]
  idx+=1

if X==0:
  idx+=1
  
print(idx-1)

Buggy submission (verdict: Runtime Error):
N,x = input().split()
A = input().split()
a = []
for i in range(int(N)):
  a.append(int(A[i]))
  
a.sort()
a.append(1)
X = int(x)
 
idx = 0
while X>=0:
  X = X-a[idx]
  idx+=1

print(idx-1)

Buggy submission (verdict: Runtime Error):
N,x = input().split()
A = input().split()
a = []
for i in range(N):
  a.append(int(A[1]))

a.sort()
a.reverse()
X = int(x)

idx = 0
while X>0:
  X = X-a[idx]
  idx+=1
  
print(idx)
Problem p03658 (python)

Fixed submission:
N,K = map(int,input().split())
L = list(map(int,input().split()))
L.sort(reverse = True)
print(sum(L[0:K]))

Buggy submission (verdict: Runtime Error):
int main() {
  int N;
  int K;
  int a[55];
  cin >> N >> K;
  
  for(int i=0; i<N; ++i) {
    cin >> a[i];
  }
  sort(a,a+N,greater<int>());
  int ans=0;
  for(int i=0; i<=K; ++i) {
    ans += a[i];
  }
  cout << ans << endl;
}
Problem p03469 (python)

Fixed submission:
s = input()
modify = '2018'+ s[4:]

print(modify)

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

s[:4] = '2018'
print(s)
Problem p03493 (python)

Fixed submission:
s = input()
counter = 0

for i in range(len(s)):
  if s[i]=='1':
    counter += 1

print(counter)

Buggy submission (verdict: Runtime Error):
import numpy as np
 
s_list = [int(i) for i in list(input())]
ans = np.count_nonzero(s_list>0)
 
print(ans)
Problem p03494 (python)

Fixed submission:
N = int(input())
num_list = [int(i) for i in input().split(' ')]

even_counter = 0
for n in range(N):
  if num_list[n]%2 != 0:
    print('0')
    break
  else:
    even_counter += 1
  
  if even_counter == N:
    min_counter = float('inf')
    for i in range(N):
          num =  num_list[i]
          counter = 0
          while num%2 == 0:
            counter += 1
            num //= 2
          if counter <= min_counter:
            min_counter = counter
      
    print(min_counter)

Buggy submission (verdict: Runtime Error):
N = int(input())
num_list = [int(i) for i in input().split(' ')]

even_counter = 0
for n in range(N):
  if num_list[n]%2 != 0:
    print('0')
    break
  else:
    even_counter += 1
  
  if even_counter == N:
    min_counter = float('inf')
    for i in range(N):
      num =  num_list[i]
      counter = 0
      while num%2 == 0:
        counter += 1
      	num //= 2
      if counter <= min_counter:
        min_counter = counter
      
    print(counter)

Buggy submission (verdict: Runtime Error):
N = int(input())
num_list = [int(i) for i in input().split(' ')]

even_counter = 0
for n in range(N):
  if num_list[n]%2 != 0:
    print('0')
    break
  else:
    even_counter += 1
  
  if even_counter == N:
    min_counter = float('inf')
    for i in range(N):
      num =  num_list[i]
      counter = 0
      while num%2 == 0:
        counter += 1
      	num //= 2
      if counter <= min_counter:
        min_counter = counter
      
    print(counter)
Problem p03658 (python)

Fixed submission:
data = [int(i) for i in input().split(' ')]
K = data[1]
ls = sorted([int(i) for i in input().split(' ')], reverse=True)

l_sum = 0
for k in range(K):
    l = ls[k]
    l_sum += l

print(l_sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
ls = sorted([int(i) for i in input().split(' ')], reverse=True)

l_sum = 0
for k in range(K):
    l = ls[k]
    l_sum += l

print(l_sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
ls = sorted([int(i) for i in input().split(' ')], reverse=True)

l_sum = 0
for k in range(K):
    l = ls[k]
    l_sum += l

print(l_sum)
Problem p03693 (python)

Fixed submission:
r,g,b = map(int, input().split())
ans = 100*r+10*g+b

if ans%4==0:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
r,g,b = map(int, input().spilit())
ans = r*100+10*g+b

if ans%4==0:
  print('YES')
else:
  print('NO')
Problem p03220 (python)

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

min_val = 10000

for i in range(len(H)):
    tmp = T - H[i] * 0.006
    sub = abs(tmp - A)
    if min_val > sub:
        ans = i
        min_val = sub


print(ans+1)

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

min_val = 10000

for i in range(len(H)):
    tmp = T - H[i] * 0.006
    sub = abs(tmp - A)
    if min_val > sub:
        ans = i
        min_val = sub2


print(ans+1)
Problem p03285 (python)

Fixed submission:
import math
N = int(input())

flag = False

for i in range(100):
    for j in range(100):
        if flag == True:
            continue
        #print(N - i * 7 - j * 4 )
        if N - i * 7 - j * 4 == 0:
            flag = True

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

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

flag = False

for i in range(ceil(N/7)+1):
    for j in range(ceil(N/4)+1):
        if flag == True:
            continue
        #print(N - i * 7 - j * 4 )
        if N - i * 7 - j * 4 == 0:
            flag = True

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

Buggy submission (verdict: Runtime Error):
for i in range(100):
    for j in range(100):
        if flag == True:
            continue
        print(N - i * 7 - j * 4 )
        if N - i * 7 - j * 4 == 0:
            flag = True

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