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

Fixed submission:
N, Q = map(int, input().split())
S = str(input())

q_list = [0] * Q

for q in range(Q):
    q_list[q] = list(map(int, input().split()))

ac_list = [0] * len(S)
count = 0
for i in range(1, len(S)):
    if S[i - 1] == 'A' and S[i] == 'C':
        count += 1
        ac_list[i] = count
    else:
        ac_list[i] = count

for item in q_list:
    l, r = item[0], item[1]

    print(ac_list[r - 1] - ac_list[l - 1])

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

for q in range(Q):
    q_list[q] = list(map(int, input().split()))

ac_list = [0] * len(S)
count = 0
for i in range(1, len(S)):
    if S[i - 1] == 'A' and S[i] == 'C':
        count += 1
        ac_list[i] = count
    else:
        ac_list[i] = count

for item in q_list:
    l, r = item[0], item[1]
    print(ac_list[r - 1] - ac_list[l - 1])

Buggy submission (verdict: Runtime Error):
import math
N, Q = map(int, input().split())
S = str(input())

for q in range(Q):
    q_list[q] = list(map(int, input().split()))

ac_list = [0] * len(S)
count = 0
for i in range(1, len(S)):
    if S[i - 1] == 'A' and S[i] == 'C':
        count += 1
        ac_list[i] = count
    else:
        ac_list[i] = count
#print(ac_list)
for item in q_list:
    l, r = item[0], item[1]

    print(ac_list[r - 1] - ac_list[l - 1])
Problem p03240 (python)

Fixed submission:

N = int(input())
xyh = [list(map(int,input().split())) for _ in range(N)]
xyh.sort(key=lambda x:-x[2])
for cx in range(101):
    for cy in range(101):
        H = 0
        ok = True
        for i in range(N):
            x,y,h = xyh[i]
            if h != 0:
                if H == 0:
                    H = h+abs(cx-x)+abs(cy-y)
                else:
                    ok = H==h+abs(cx-x)+abs(cy-y)
            else:
                ok = abs(cx-x)+abs(cy-y)-H>=0
            if not ok:
                break
        if ok:
            break
    if ok:
        break
    
print('{} {} {}'.format(cx,cy,H))

Buggy submission (verdict: Runtime Error):

Copy
Copy
N = int(input())
xyh = [list(map(int,input().split())) for _ in range(N)]
xyh.sort(key=lambda x:-x[2])
for cx in range(101):
    for cy in range(101):
        H = 0
        ok = True
        for i in range(N):
            x,y,h = xyh[i]
            if h != 0:
                if H == 0:
                    H = h+abs(cx-x)+abs(cy-y)
                else:
                    ok = H==h+abs(cx-x)+abs(cy-y)
            else:
                ok = abs(cx-x)+abs(cy-y)-H>=0
            if not ok:
                break
        if ok:
            break
    if ok:
        break
    
print('{} {} {}'.format(cx,cy,H))
Problem p03309 (python)

Fixed submission:
from collections import Counter
from statistics import median
N = int(input())
a_lis = list(map(int, input().split()))

new_lis = [item - i - 1 for i, item in enumerate(a_lis)]

mode = median(new_lis)

count = 0
for i in range(N):
    count += abs(a_lis[i] - mode - i - 1)
    
print(int(count))

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

maximum = max(a_lis)
minimum = min(a_lis)


new_mx = maximum - N + 1
count = [0] * (max(new_mx, minimum) + 1 - min(new_mx, minimum))
for num in range(min(new_mx, minimum), max(new_mx, minimum) + 1):
    tmp = 0
    for i in range(N):
        tmp += abs(a_lis[i] - num - i)
    count[num - min(new_mx, minimum)] = tmp
print(min(count))
Problem p03339 (python)

Fixed submission:
from collections import Counter

N = int(input())
S = input()

count_E = Counter(S)['E']
count_W = Counter(S)['W']

right = 0
left = count_E
tmp = N
for i in range(N):
    if S[i] == 'E':
        left -= 1
    if right + left < tmp:
        tmp = right + left
    if S[i] == 'W':
        right += 1
print(tmp)

Buggy submission (verdict: Runtime Error):
%%time
from collections import Counter

N = int(input())
S = input()

count_E = Counter(S)['E']
count_W = Counter(S)['W']

right = 0
left = count_E
tmp = N
for i in range(N):
    if right + left < tmp:
        tmp = right + left
    if S[i] == 'W':
        right += 1
    else:
        left -= 1
print(tmp)
Problem p03401 (python)

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

A_n = [0] * (N + 1)
for i in range(1, N):
    A_n[i] = abs(A[i] - A[i - 1])
A_n[0] = abs(A[0] - 0)
A_n[N] = abs(A[N - 1] - 0)

A_total = sum(A_n)
A_added = [0] + A + [0]
for i in range(1, N + 1):
    if A_added[i + 1] >= A_added[i] and A_added[i] >= A_added[i - 1]:
        print(A_total)
    elif A_added[i + 1] >= A_added[i - 1] and A_added[i - 1] >= A_added[i]:
        print(A_total - 2 * abs(A_added[i] - A_added[i - 1]))
    elif A_added[i] >= A_added[i + 1] and A_added[i + 1] >= A_added[i - 1]:
        print(A_total - 2 * abs(A_added[i + 1] - A_added[i]))
    elif A_added[i] >= A_added[i - 1] and A_added[i - 1] >= A_added[i + 1]:
        print(A_total - 2 * abs(A_added[i] - A_added[i - 1]))
    elif A_added[i - 1] >= A_added[i] and A_added[i] >= A_added[i + 1]:
        print(A_total)
    elif A_added[i - 1] >= A_added[i + 1] and A_added[i + 1] >= A_added[i]:
        print(A_total - 2 * abs(A_added[i] - A_added[i + 1]))
    else:
        print(0)

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

for i in range(1, N):
    A_n[i] = abs(A[i] - A[i - 1])
A_n[0] = abs(A[0] - 0)
A_n[N] = abs(A[N - 1] - 0)

A_total = sum(A_n)
A_added = [0] + A + [0]
for i in range(1, N + 1):
    if A_added[i + 1] >= A_added[i] and A_added[i] >= A_added[i - 1]:
        print(A_total)
    elif A_added[i + 1] >= A_added[i - 1] and A_added[i - 1] >= A_added[i]:
        print(A_total - 2 * abs(A_added[i] - A_added[i - 1]))
    elif A_added[i] >= A_added[i + 1] and A_added[i + 1] >= A_added[i - 1]:
        print(A_total - 2 * abs(A_added[i + 1] - A_added[i]))
    elif A_added[i] >= A_added[i - 1] and A_added[i - 1] >= A_added[i + 1]:
        print(A_total - 2 * abs(A_added[i] - A_added[i - 1]))
    elif A_added[i - 1] >= A_added[i] and A_added[i] >= A_added[i + 1]:
        print(A_total)
    elif A_added[i - 1] >= A_added[i + 1] and A_added[i + 1] >= A_added[i]:
        print(A_total - 2 * abs(A_added[i] - A_added[i + 1]))
Problem p03476 (python)

Fixed submission:
import bisect
import math

def prime(n):
    for j in range(2, int(math.sqrt(n) + 1)):
        if n % j == 0:
            return False
    return True

lis = []
for i in range(3, 100000, 2):
    if prime(i) and prime((i + 1) / 2):
        lis.append(i)

Q = int(input())
for q in range(Q):
    l, r = map(int, input().split())
    left_ind = bisect.bisect_left(lis, l)
    right_ind = bisect.bisect_right(lis, r)
    print(right_ind - left_ind)

Buggy submission (verdict: Runtime Error):
import math
import bisect


def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = []
    needed_prime = [2]
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return needed_prime + data
        prime.append(p)
        if int((p + 1) / 2) in prime and p != 2:
            needed_prime.append(p)
        data = [e for e in data if (e % p != 0)]


arr = get_sieve_of_eratosthenes(100000)


Q = int(input())
for q in range(Q):
    l, r = map(int, input().split())
    left_ind = bisect.bisect_left(arr_2, l)
    right_ind = bisect.bisect_right(arr_2, r)
    print(right_ind - left_ind)
Problem p03625 (python)

Fixed submission:
from collections import Counter
import sys
N = int(input())
A = [int(_) for _ in input().split()]

key_val_lis = []
for key, value in Counter(A).items():
    if value >= 2:
        key_val_lis.append((key, value))

ans_lis = sorted(key_val_lis, key=lambda x: -x[0])

if len(ans_lis) <= 1 or ans_lis[0][1] is None:
        print(0)
        sys.exit()

area_1 = ans_lis[0][0] * ans_lis[1][0]
area_2 = 0
if ans_lis[0][1] >= 4:
    area_2 = ans_lis[0][0] ** 2
print(max(area_1, area_2))

Buggy submission (verdict: Runtime Error):
from collections import Counter
import sys
N = int(input())
A = [int(_) for _ in input().split()]

key_val_lis = []
for key, value in Counter(A).items():
    if value >= 2:
        key_val_lis.append((key, value))

ans_lis = sorted(key_val_lis, key=lambda x: -x[0])

if len(ans_lis) == 1 and ans_lis[0][1] < 4:
    print(0)
    sys.exit()

area_1 = ans_lis[0][0] * ans_lis[1][0]
area_2 = 0
if ans_lis[0][1] >= 4:
    area_2 = ans_lis[0][0] ** 2
print(max(area_1, area_2))

Buggy submission (verdict: Runtime Error):
from collections import Counter
import sys
N = int(input())
A = [int(_) for _ in input().split()]

key_val_lis = []
for key, value in Counter(A).items():
    if value >= 2:
        key_val_lis.append((key, value))

ans_lis = sorted(key_val_lis, key=lambda x: -x[0])

if ans_lis[0] is None:
    print(0)
    sys.exit()

if ans_lis[1] is not None:
    area_1 = ans_lis[0][0] * ans_lis[1][0]
    area_2 = 0
    if ans_lis[0][1] >= 4:
        area_2 = ans_lis[0][0] ** 2
    print(max(area_1, area_2))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
from collections import Counter
import sys
N = int(input())
A = [int(_) for _ in input().split()]

key_val_lis = []
for key, value in Counter(A).items():
    if value >= 2:
        key_val_lis.append((key, value))

ans_lis = sorted(key_val_lis, key=lambda x: -x[0])

if len(ans_lis) == 1 and ans_lis[0][0] < 4:
    print(0)
    sys.exit()

area_1 = ans_lis[0][0] * ans_lis[1][0]
area_2 = ans_lis[0][0] ** 2
print(max(area_1, area_2))
Problem p03695 (python)

Fixed submission:
from collections import Counter

N = int(input())
A = [int(_) // 400 if int(_) <= 3199 else 8 for _ in input().split()]

min_counter = Counter(A).copy()
if 8 in min_counter.keys():
    min_counter.pop(8)
    if not min_counter:
        minimum = 1
    else:
        minimum = len(min_counter)
else:
    minimum = len(min_counter)

maximum = 0
max_counter = Counter(A).copy()

if 8 in max_counter.keys():
    maximum = max_counter[8]
    max_counter.pop(8)
    maximum += len(max_counter)
else:
    maximum += len(max_counter)

print(minimum, maximum)

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

N = int(input())
A = [int(_) // 400 if int(_) < 3199 else 8 for _ in input().split()]

min_counter = Counter(A)
if 8 in min_counter.keys():
    min_counter.pop(8)
maximum = 0
max_counter = Counter(A)
if max_counter[8] >= 8:
    maximum = 8
else:
    if 8 in max_counter.keys():
        maximum = max_counter[8]
        max_counter.pop(8)
    maximum += len(max_counter)
minimum = len(min_counter)
print(f"{minimum} {maximum}")
Problem p03734 (python)

Fixed submission:
from itertools import accumulate
N, W = map(int, input().split())
w_0, v_0 = map(int, input().split())
v_list = [[] for _ in range(4)]
v_list[0].append(v_0)

for _ in range(N - 1):
    w_in, v_in = map(int, input().split())
    v_list[w_in - w_0].append(v_in)
v_list = [[0] + list(accumulate(sorted(v, reverse=True))) for v in v_list]
ans = 0

#print(v_list)

for i in range(len(v_list[0])):
    for j in range(len(v_list[1])):
        for k in range(len(v_list[2])):
            for l in range(len(v_list[3])):
                if (i * w_0) + (j * (w_0 + 1)) + (k * (w_0 + 2)) + (l * (w_0 + 3)) <= W:
                    ans = max(ans, v_list[0][i] + v_list[1][j] + v_list[2][k] + v_list[3][l])
                else:
                    break
print(ans)

Buggy submission (verdict: Runtime Error):
from itertools import accumulate
N, W = map(int, input().split())
w_0, v_0 = map(int, input().split())
v_list = [[] for _ in range(4)]
v_list[0].append(v_0)

for _ in range(n - 1):
    w_in, v_in = map(int, input().split())
    v_list[w_in - w_0].append(v_in)
v_list = [[0] + list(accumulate(sorted(v, reverse=True))) for v in v_list]
ans = 0

#print(v_list)

for i in range(len(v_list[0])):
    for j in range(len(v_list[1])):
        for k in range(len(v_list[2])):
            for l in range(len(v_list[3])):
                if (i * w_0) + (j * (w_0 + 1)) + (k * (w_0 + 2)) + (l * (w_0 + 3)) <= W:
                    ans = max(ans, v_list[0][i] + v_list[1][j] + v_list[2][k] + v_list[3][l])
                else:
                    break
print(ans)
Problem p03862 (python)

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

answer = 0
if A[0] > x:
    answer += A[0] - x
    A[0] = x
    
for i in range(N-1):
    diff = A[i] + A[i+1] - x
    if diff > 0:
        answer += diff
        A[i+1] -= diff

print(answer)

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

answer = 0
if A[0] > X:
    answer += A[0] - X
    A[0] = X
    
for i in range(N-1):
    diff = A[i] + A[i+1] - X
    if diff > 0:
        answer += diff
        A[i+1] -= diff

print(answer)
Problem p03944 (python)

Fixed submission:
import numpy as np
import sys
from collections import Counter
W, H, N = map(int, input().split())

grid = np.array([[0] * W] * H)

for n in range(N):
    tmp_w, tmp_h, a = map(int, input().split())
    if a == 1:
        grid.T[: tmp_w] = 1
    if a == 2:
        grid.T[tmp_w:] = 1
    if a == 3:
        grid[0: tmp_h] = 1
    if a == 4:
        grid[tmp_h: ] = 1
    #print(grid)

print(Counter((grid.reshape(1, W * H).tolist())[0])[0])

Buggy submission (verdict: Runtime Error):
import sys
W, H, N = map(int, input().split())
area = W * H

right, left, bottom, top = W, 0, 0, H

for n in range(N):
    tmp_w, tmp_h, a = map(int, input().split())
    if left <= tmp_w <= right and bottom <= tmp_h <= top:
        if a == 1:
            tmp_area = (tmp_w - left) * (top - bottom)
            area -= tmp_area
            left = tmp_w
        if a == 2:
            tmp_area = (right - tmp_w) * (top - bottom)
            area -= tmp_area
            right = tmp_w
        if a == 3:
            tmp_area = (tmp_h - bottom) * (right - left)
            area -= tmp_area
            bottom = tmp_h
        if a == 4:
            tmp_area = (top - tmp_h) * (right - left)
            area -= tmp_area
            top = tmp_h
    else:
        if a == 1:
            if tmp_w >= right:
                tmp_area = tmp_w * H
            else:
                tmp_area = 0
        if a == 2:
            if tmp_w <= left:
                tmp_area = (W - tmp_w) * H
            else:
                tmp_area = 0
        if a == 3:
            if tmp_h >= top:
                tmp_area = tmp_h * W
            else:
                tmp_area = 0
        if a == 4:
            if tmp_h <= bottom:
                tmp_area = (H - tmp_h) * W
            esle:
                tmp_area = 0
        area -= tmp_area
        if area < 0:
            print(0)
            sys.exit()
print(area)
Problem p03951 (python)

Fixed submission:
import sys
N = int(input())
s = str(input())
t = str(input())

answer = 2 * N
for i in range(N, 2 * N + 1):
    if s[len(s) - (2 * N - i):] == t[:2 * N - i]:
        answer = i
        break
    
print(answer)

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

word = s + t

for i in range(N):
    if word[len(s) - 1] == word[len(s)] and :
        s = s[:N - 1]
        word = s + t
    
print(len(word))

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
s = str(input())
t = str(input())

word = s + t

for letter in s:
  if letter not in letter_list:
    letter_list.append(letter)
    
for letter in t:
  if letter not in list(letter_dict.keys()):
    letter_dict[letter] = 1
    
if s == t:
  print(N)
  sys.exit()
else:
  print(len(letter_dict))

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
s = str(input())
t = str(input())

word = s + t

if s == t:
  print(N)
  sys.exit()

for letter in s:
  if letter not in letter_list:
    letter_list.append(letter)
    
for letter in t:
  if letter not in list(letter_dict.keys()):
    letter_dict[letter] = 1
    
print(len(letter_dict))

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

word = s + t

if s == t:
  print(N)

for letter in s:
  if letter not in letter_list:
    letter_list.append(letter)
    
for letter in t:
  if letter not in list(letter_dict.keys()):
    letter_dict[letter] = 1
    
print(len(letter_dict))
Problem p04031 (python)

Fixed submission:
import math
N = int(input())
a = [int(_) for _ in input().split()]

floor = math.floor(sum(a) / len(a))
ceil = math.ceil(sum(a) / len(a))

ceil_sum = sum([(item - ceil) ** 2 for item in a])
floor_sum = sum([(item - floor) ** 2 for item in a])

print(min(ceil_sum, floor_sum))

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
a = [int(_) for _ in input().split()]

floor = math.floor(sum(a) / len(a))
ceil = math.ceil(sum(a) / len(a))

ceil_sum = sum([(item - ceil) ** 2 for item in a])
floor_sum = sum([(item - floor) ** 2 for item in a])

print(min(ceil_sum, floor_sum, median_sum))

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [int(_) for _ in input().split()]

floor = math.floor(sum(a) / len(a))
ceil = math.ceil(sum(a) / len(a))

ceil_sum = sum([(item - ceil) ** 2 for item in a])
floor_sum = sum([(item - floor) ** 2 for item in a])

print(min(ceil_sum, floor_sum, median_sum))
Problem p04033 (python)

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

if a <= 0 and b >= 0:
    print("Zero")
elif a > 0 and b > 0:
    print('Positive')
elif a < 0 and b < 0:
    if (b - a + 1) % 2:
        print('Negative')
    else:
        print('Positive')

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

if a <= 0 and b => 0:
    print("Zero")
elif a > 0 and b > 0:
    print('Positive')
elif a < 0 and b < 0:
    if (b - a + 1) % 2:
        print('Negative')
    else:
        print('Positive')

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

if a <= 0 and b => 0:
    print(0)
elif a > 0 and b > 0:
    print('Positive')
elif a < 0 and b < 0:
    if (b - a + 1) % 2:
        print('Negative')
    else:
        print('Positive')
Problem p04045 (python)

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

num_exclude = list(map(int, input().split()))

dec_num = [i for i in range(0, 10)]

able_use_num_lis = list(map(str, set(dec_num) - set(num_exclude)))

num_len = len(str(N))

output_list = []

def dfs(cur, num, able_use_num_lis):
    if num != '':
        if int(num) >= N:
            output_list.append(int(num))
    if len(str(N)) + 1 == cur:
        return
    
    for add_num in able_use_num_lis:
        ret = dfs(cur + 1, num + add_num, able_use_num_lis)
    return output_list

print(min(dfs(0, '', able_use_num_lis)))

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

num_exclude = list(map(int, input().split()))

dec_num = [i for i in range(0, 10)]

able_use_num_lis = list(map(str, set(dec_num) - set(num_exclude)))

num_len = len(str(N))

output_list = []

def dfs(cur, num, able_use_num_lis):
    if num != '':
        if int(num) >= N:
            output_list.append(int(num))
    if len(str(N)) == cur:
        return
    
    for add_num in able_use_num_lis:
        ret = dfs(cur + 1, num + add_num, able_use_num_lis)
    return output_list

print(min(dfs(0, '', able_use_num_lis)))
Problem p03037 (python)

Fixed submission:
import sys
from itertools import accumulate

def main():
    input = sys.stdin.readline
    N, M = map(int, input().split())
    acc = [0] * (N+1)
    for _ in range(M):
        left, right = map(int, input().split())
        acc[left-1] += 1
        acc[right] -= 1

    cnt = 0
    for a in accumulate(acc):
        if a == M:
            cnt += 1

    return cnt


if __name__ == '__main__':
    print(main())

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

card_num, gate_num = map(int,input().split())
d = np.zeros((gate_num,2))
card_valid = [0]*card_num

for i in range(gate_num):
    l, r = map(int, input().split())
    d[i,0] = l
    d[i,1] = r
for i in range(gate_num):
    for ii in range(card_num):
        if ii + 1 >= d[i][0] and ii + 1 <= d[i][1]:
            card_valid[ii] += 1
        else:
            card_valid[ii] += 0
counter = 0
for i in range(card_num):
    if card_valid[i] == gate_num:
        counter += 1
        
print(counter)

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

card_num, gate_num = map(int,input().split())
d = np.zeros((gate_num,2))
card_valid = [0]*card_num

for i in range(gate_num):
    l, r = map(int, input().split())
    d[i,0] = l
    d[i,1] = r
for i in range(gate_num):
    for ii in range(card_num):
        if ii + 1 >= d[i][0] and ii + 1 <= d[i][1]:
            card_valid[ii] += 1
        else:
            card_valid[ii] += 0
counter = 0
for i in range(card_num):
    if card_valid[i] == gate_num:
        counter += 1
print(counter)
Problem p02612 (python)

Fixed submission:
N = int(input())
a = N % 1000
b = 1000 - a if a!=0 else 0
print(b)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = N % 1000
b = a!= 0 ? 1000 - a : 0
print(b)
Problem p02613 (python)

Fixed submission:
N = int(input())
Ss = [input() for i in range(N)]

for j in ["AC", "WA", "TLE", "RE"]:
  print("{} x {}".format(j, Ss.count(j)))

Buggy submission (verdict: Runtime Error):
N = int(input())
Ss = []
for i in range(N):
  Ss.append(int(input()))

C0, C1, C2, C3 = 0, 0, 0, 0
for S in Ss:
  if S == 'AC':
    C0 += 1
  elif S == 'WA':
    C1 += 1
  elif S == 'TLE':
    C2 += 1
  else:
    C3 += 1
print("AC X {}".format(C0))
print("WA X {}".format(C1))
print("TLE X {}".format(C2))
print("RE X {}".format(C3))
Problem p02898 (python)

Fixed submission:
def calculate(people_num, limit, height_array):
    permission = [height for height in height_array if height >= limit]
    return len(permission)
 
if __name__ == "__main__":
    people_num, limit = map(int, input().split())
    height_array = map(int, input().split())
    result_num = calculate(people_num, limit, height_array)
    print(result_num)

Buggy submission (verdict: Runtime Error):
def calculate(people_num, limit, height_array):
    permission = [height for height in height_array if height >= limit]
    return len(permission)

if __name__ == "__main__":
    input_data = '\n'.join(iter(raw_input, '')).split()
    people_num = input_data[0]
    limit= input_data[1]
    height_array = input_data[2:len(input_data)-1]
    result_num = calculate(people_num, limit, height_array)
    print(result_num)

Buggy submission (verdict: Runtime Error):
def calculate(people_num, limit, height_array):
    permission = [height for height in height_array if height >= limit]
    return len(permission)

if __name__ == "__main__":
    input_data = '\n'.join(iter(raw_input, '')).split()
    people_num = input_data[0]
    limit= input_data[1]
    height_array = input_data[2:len(input_data)]
    result_num = calculate(people_num, limit, height_array)
    print(result_num)

Buggy submission (verdict: Runtime Error):
def calculate(peoople_num, limit, height_array):
    permission = [height for height in height_array if height < limit]
    return len(permission)

if __name__ == "__main__":
    input_data = '\n'.join(iter(raw_input, '')).split()
    people_num = input_data[0]
    limit= input_data[1]
    height_array = input_data[2:len(input_data)]
    result_num = calculate(people_num, limit, height_array)
    print(result_num)

Buggy submission (verdict: Runtime Error):
def calculate(people_num, limit, height_array):
  permit = [height for height_array if height < limit]
  return len(permit)

if __name__ == "__main__":
  input_data = '\n'.join(iter(raw_input, ''))split()
  people_num = input_data[0]
  limit= input_data[1]
  height_array = input_data[2:len(input_data)]
  result_num = calculate(people_num, limit, height_array)
  print(result_num)
Problem p02612 (python)

Fixed submission:
a=int(input())
b=0
while b<a:
    b+=1000
print(b-a)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=0
while b=<a:
    b+=1000
print(b-a)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=0
while b=<a
    b+=1000
print(b-a)