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

Fixed submission:
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))
# map(int, input().split())
# int(input())
# input().split()
# mojiretu = ','.join(str_list)
# sorted(input())

def primes(n):
    isp = [True for _ in range(n+1)]
    isp[0] = False
    isp[1] = False
    l = ceil(sqrt(n))
    n += 1
    for i in range(2, l):
        if not isp[i]: continue
        for j in range(i*2, n, i): isp[j] = False
    return isp

q = int(input())
maxv = 10**5
isp = primes(maxv)
cnt = [0 for _ in range(maxv + 1)]

for i in range(3, maxv+1):
    if i%2 and isp[i] and isp[(i+1)//2]:
        cnt[i] = 1
#print(cnt[:10])
acc = list(accumulate(cnt))
for _ in range(q):
    l, r = map(int, input().split())
    print(acc[r] - acc[l-1])

Buggy submission (verdict: Runtime Error):
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))
# map(int, input().split())
# int(input())
# input().split()
# mojiretu = ','.join(str_list)
# sorted(input())

def primes(n):
    isp = [True for _ in range(n+1)]
    isp[0] = False
    isp[1] = False
    l = ceil(sqrt(n))
    n += 2
    i = 4
    while i < n:
        isp[i] = False
        i += i
    for i in range(3, l, 2):
        if not isp[i]:
            continue
        for j in range(i*2, n, i):
            isp[j] = False
    return isp

q = int(input())
maxv = 10**5
isp = primes(maxv)
cnt = [0 for _ in range(maxv + 1)]

ans = 0
for i in range(3, maxv+1):
    if i%2 and isp[i] and isp[(i+1)//2]:
        cnt[i] = 1
acc = list(accumulate(cnt))
for _ in range(q):
    l, r = map(int, input().split())
    print(acc[r] - acc[l-1])
Problem p02811 (python)

Fixed submission:
k,x=map(int,input().split())
print("Yes" if 500*k>=x else "No")

Buggy submission (verdict: Runtime Error):
k,x=map(int,input(),split())
print("Yes" if 500*k>=x else "No")
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):
H,W=map(int,input().split())
h,w=map(int,input(),split())
print((H-h)*(W-w))

Buggy submission (verdict: Runtime Error):
H,W=map(int,input().split())
h,w=map(int,input(),split())
print((H-h)*(W-w))
Problem p03597 (python)

Fixed submission:
n=int(input())
a=int(input())
print(n*n-a)

Buggy submission (verdict: Runtime Error):
n,a=map(int,input().split())
print(n*n-a)

Buggy submission (verdict: Runtime Error):
n,a=int(input())
print(n*n-a)
Problem p03635 (python)

Fixed submission:
n,m=map(int,input().split())
print((n-1)*(m-1))

Buggy submission (verdict: Runtime Error):
n,m=map(intput().split())
print((n-1)*(m-1))

Buggy submission (verdict: Runtime Error):
n,m=int(intput().split())
print((n-1)*(m-1))
Problem p02705 (python)

Fixed submission:
# coding: utf-8


def main():
    R = int(input())
    
    return R * 2 * 3.1415


print(main())

Buggy submission (verdict: Runtime Error):
# coding: utf-8


def main():
    R = input(int())
    return R * 2 * 3.1415


print(main())
Problem p02756 (python)

Fixed submission:
# coding: utf-8

S = input()
Q = int(input())


heads = {}
tails = {}
h = 0
t = 0
rev = False
for _ in range(Q):
    line = input()

    if line[0] == "1":
        rev = not rev

    else:
        if line[2] == "1":
            if rev:
                # S = "".join([S, line[4]])
                tails[t] = line[4]
                t += 1
            else:
                # S = "".join([line[4], S])
                heads[h] = line[4]
                h += 1
        else:
            if rev:
                # S = "".join([line[4], S])
                heads[h] = line[4]
                h += 1
            else:
                # S = "".join([S, line[4]])
                tails[t] = line[4]
                t += 1

head = [None] * h
tail = [None] * t

for i in range(h):
    head[i] = heads[i]
head = head[::-1]

for i in range(t):
    tail[i] = tails[i]

head_joint = "".join(head)
tail_joint = "".join(tail)
joint = "".join([head_joint, S, tail_joint])

if rev:
    print(joint[::-1])
else:
    print(joint)

Buggy submission (verdict: Runtime Error):
# coding: utf-8

S = input()
Q = int(input())


rev = False
for _ in range(Q):
    line = input()

    if line[0] == "1":
        rev = not rev

    else:
        if line[2] == "1":
            if rev:
                S = "".join(S, line[4])
            else:
                S = "".join(line[4], S)
        else:
            if rev:
                S = "".join(line[4], S)
            else:
                S = "".join(S, line[4])

if rev:
    print(S[::-1])
else:
    print(S)
Problem p03074 (python)

Fixed submission:
# coding: utf-8

n, k = map(int, input().split())
s = input()
s += "2"
n += 1

nums = []
if s[0] == "0":
    nums.append(0)

fin = False
i = 0
while i < n:
    if fin:
        break
    for j in range(i, n):
        if s[j] != s[i]:
            nums.append(j-i)
            i = j
            break
        if i == n-1:
            fin = True
            break

if s[-2] == "0":
    nums.append(0)
# print(nums)
length = min([2*k+1, len(nums)])

ans = 0
for i in range(0, length):
    ans += nums[i]

oldsum = ans
for i in range(0, len(nums), 2):
    if i + length + 1 < len(nums):
        newsum = oldsum - (nums[i] + nums[i+1]) + (nums[length+i] + nums[length+i+1])
        if newsum > ans:
            ans = newsum
        oldsum = newsum
    else:
        break

print(ans)

Buggy submission (verdict: Runtime Error):
# coding: utf-8

n, k = map(int, input().split())
s = input()
s += "2"
n += 1

nums = []
if s[0] == "0":
    nums.append(0)

fin = False
i = 0
while i < n:
    if fin:
        break
    for j in range(i, n):
        if s[j] != s[i]:
            nums.append(j-i)
            i = j
            break
        if i == n-1:
            fin = True
            break

if s[-2] == "0":
    nums.append(0)
# print(nums)
length = min([2*k+1, len(nums)])

ans = 0
for i in range(0, length):
    ans += nums[i]

oldsum = ans
for i in range(0, length, 2):
    if i + length + 1 < len(nums):
        newsum = oldsum - (nums[i] + nums[i+1]) + (nums[length+i] + nums[length+2])
        if newsum > ans:
            ans = newsum
        oldsum = newsum
    else:
        break

print(ans)
Problem p03151 (python)

Fixed submission:
# coding: utf-8

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

    if sum(A) < sum(B):
        return -1

    diff_sum = 0
    diff_cnt = 0
    diff_list = [0] * N
    for i in range(N):
        diff_list[i] = A[i] - B[i]
        if A[i] < B[i]:
            diff_sum += B[i] - A[i]
            diff_cnt += 1

    diff_list_sorted = sorted(diff_list, reverse=True)

    use_sum = 0
    for i in range(N):
        if use_sum >= diff_sum:
            break
        use_sum += diff_list_sorted[i]
        diff_cnt += 1

    return diff_cnt


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

Buggy submission (verdict: Runtime Error):
# coding: utf-8

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

    if sum(A) < sum(B):
        return -1

    diff_sum = 0
    diff_cnt = 0
    diff_list = [0] * N
    for i in range(N):
        diff_list[i] = A[i] - B[i]
        if A[i] < B[i]:
            diff_sum += B[i] - A[i]
            diff_cnt += 1

    diff_list_sorted = sorted(diff_list, reverse=True)

    use_sum = 0
    for i in range(N):
        if use_sum >= diff_sum:
            break
        use_sum += diff_list_sorted[i]
        diff_cnt += 1

    return diff_cnt


if __name__ == "__main__":
    print(main()
Problem p03160 (python)

Fixed submission:
# coding: utf-8

"""
20191116
"""

N = int(input())
h = list(map(int, input().split()))

cost = [0, abs(h[1]-h[0])] + [None for _ in range(N-2)]

for i in range(2, N):
    cost[i] = min(cost[i-1] + abs(h[i]-h[i-1]), cost[i-2] + abs(h[i]-h[i-2]))

print(cost[N-1])

Buggy submission (verdict: Runtime Error):
# coding: utf-8

"""
20191116
"""

N = int(input())
h = list(map(int, input().split()))
cost = [0, abs(h[1]-h[0])] + [None for _ in range(N-2)]


def dp(i):
    cost[i] = min((cost[i-1] if cost[i-1] is not None else dp(i-1)) + abs(h[i]-h[i-1]),
                  (cost[i-2] if cost[i-2] is not None else dp(i-2)) + abs(h[i]-h[i-2]))
    return cost[i]


if __name__ == "__main__":
    ans = dp(N-1)
    print(ans)

Buggy submission (verdict: Runtime Error):
# coding: utf-8

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

inf = pow(10, 10)

# current_shortests = [0] + [inf] * (n-1)

in_processing = [0]  # node-number
in_processing_len = [0]
shortest_fixed = []  # node-number
shortest_fixed_len = []


def argmin(l):
    output = 0
    for i in range(len(l)):
        if l[i] < l[output]:
            output = i

    return output


def search(l, v):
    for i in range(len(l)):
        if l[i] == v:
            return i


def fun():
    k = argmin(in_processing_len)
    node = in_processing[k]

    # print("---------")
    # print(in_processing)
    # print(in_processing_len)
    # print(shortest_fixed)
    # print(shortest_fixed_len)
    # print(k)
    # print(node)
    # print("---------")

    if node == n-1:
        return in_processing_len[k]

    shortest_fixed.append(node)
    shortest_fixed_len.append(in_processing_len[k])
    del in_processing[k]
    del in_processing_len[k]

    if node+1 < n and node+1 not in shortest_fixed:
        if node+1 not in in_processing:
            in_processing.append(node+1)
            in_processing_len.append(
                shortest_fixed_len[-1] + abs(h[node+1] - h[node]))
        else:
            idx = search(in_processing, node+1)
            if in_processing_len[idx] > shortest_fixed_len[-1] + abs(h[node+1] - h[node]):
                in_processing_len[idx] = shortest_fixed_len[-1] + abs(h[node+1] - h[node])
    if node+2 < n and node+2 not in shortest_fixed:
        if node+2 not in in_processing:
            in_processing.append(node+2)
            in_processing_len.append(
                shortest_fixed_len[-1] + abs(h[node+2] - h[node]))
        else:
            idx = search(in_processing, node+2)
            if in_processing_len[idx] > shortest_fixed_len[-1] + abs(h[node+2] - h[node]):
                in_processing_len[idx] = shortest_fixed_len[-1] + abs(h[node+2] - h[node])

    output = fun()

    return output


ans = fun()

print(ans)
Problem p03240 (python)

Fixed submission:
# -*- coding: utf-8 -*-

N = int(input())
x = [None] * N
y = [None] * N
h = [None] * N
for i in range(N):
    x[i], y[i], h[i] = map(int, input().split())


def distance(a,b):
    a_x = a[0]
    a_y = a[1]
    b_x = b[0]
    b_y = b[1]

    return abs(a_x - b_x) + abs(a_y - b_y)


for cx in range(101):
    for cy in range(101):
        ans = True
        c = [cx, cy]
        for i in range(N):
            if h[i] != 0:
                ch = distance(c, [x[i], y[i]]) + h[i]
                break
        # ch = distance(c, [x[0], y[0]]) + h[0]  # cx, cyを仮定するとchが定まる
        for i in range(N):
            if max([ch - distance(c, [x[i], y[i]]), 0]) != h[i]:
                ans = False
                break
        if ans:
            break
    if ans:
        break

print(" ".join(list(map(str, [cx, cy, ch]))))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

N = int(input())
x = [None] * N
y = [None] * N
h = [None] * N
for i in range(N):
    x[i], y[i], h[i] = map(int, input().split())


def distance(a,b):
    a_x = a[0]
    a_y = a[1]
    b_x = b[0]
    b_y = b[1]

    return abs(a_x - b_x) + abs(a_y - b_y)


for cx in range(101):
    for cy in range(101):
        ans = True
        c = [cx, cy]
        for i in range(N):
            if h[i] != 0:
                ch = distance(c, [x[i], y[i]]) + h[i]
                break
        x.pop(i)
        y.pop(i)
        h.pop(i)
        # ch = distance(c, [x[0], y[0]]) + h[0]  # cx, cyを仮定するとchが定まる
        for i in range(1, N):
            if ch - distance(c, [x[i], y[i]]) != h[i]:
                ans = False
                break
        if ans:
            break
    if ans:
        break

print(" ".join(list(map(str, [cx, cy, ch]))))
Problem p03263 (python)

Fixed submission:
# coding: utf-8

# https://atcoder.jp/contests/abc109
# -18:59 done


def main():
    H, W = map(int, input().split())
    a = [None] * H
    for i in range(H):
        a[i] = list(map(int, input().split()))

    operates = []
    for i in range(H):
        for j in range(W-1):
            if a[i][j] % 2 == 1:
                a[i][j] -= 1
                a[i][j+1] += 1
                operates.append("{} {} {} {}".format(i+1, j+1, i+1, j+2))
        if i < H-1 and a[i][-1] % 2 == 1:
            a[i][-1] -= 1
            a[i+1][-1] += 1
            operates.append("{} {} {} {}".format(i+1, W, i+2, W))

    N = len(operates)
    print(N)
    for i in range(N):
        print(operates[i])


main()
# print(main())

Buggy submission (verdict: Runtime Error):
# coding: utf-8

# https://atcoder.jp/contests/abc109


def main():
    H, W = map(int, input().split())
    a = [None] * H
    for i in range(H):
        a[i] = list(map(int, input().split()))

    operates = []
    for i in range(H):
        for j in range(W-1):
            if a[i][j] % 2 == 1:
                a[i][j] -= 1
                a[i][j+1] += 1
                operates.append("{} {} {} {}".format(i+1, j+1, i+1, j+2))
        if i < H-1 and a[i][-1] % 2 == 1:
            a[i][j] -= 1
            a[i+1][j] += 1
            operates.append("{} {} {} {}".format(i+1, j+1, i+2, j+1))

    N = len(operates)
    print(N)
    for i in range(N):
        print(operates[i])


main()
# print(main())
Problem p03323 (python)

Fixed submission:
# -*- coding: utf-8 -*-

A, B = map(int, input().split())

if A<=8 and B<=8:
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

A = int(input())
B = int(input())

if A<=8 and B<=8:
    print("Yay!")
else:
    print(":(")
Problem p03471 (python)

Fixed submission:
# coding: utf-8

# https://atcoder.jp/contests/abc085/tasks/abc085_c
# 19:24-19:38


def main():
    N, Y = map(int, input().split())
    y = Y // 1000

    for b in range(N+1):
        if (y-N-4*b) >= 0 and (y-N-4*b) % 9 == 0:
            c = (y-N-4*b) // 9
            a = N - b - c
            if a >= 0:
                return "{} {} {}".format(c, b, a)

    return "-1 -1 -1"


print(main())

Buggy submission (verdict: Runtime Error):
# coding: utf-8

# https://atcoder.jp/contests/abc085/tasks/abc085_c
# 19:24-


def main():
    N, Y = map(int, input().split())
    y = Y // 1000

    for b in range(N+1):
        if (y-N-4*b) % 9 == 0:
            c = (y-N-4*b) // 9
            a = N - b - c
            if a >= 0:
                return f"{c} {b} {a}"

    return "-1 -1 -1"


print(main())
Problem p03597 (python)

Fixed submission:
# -*- coding: utf-8 -*-

n = int(input())
a = int(input())

print(n*n - a)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

inlist = list(map(int, input().split()))
a = inlist[0] * 100
b = inlist[1] * 100
c = inlist[2]
d = inlist[3]
e = inlist[4]
f = inlist[5]

tupleList = []

for i in range((f//a) + 1):
    for j in range((f - a*i)//b + 1):
        for k in range((f - a*i - b*j)//c + 1):
            for l in range((f - a*i - b*j - c*k)//d + 1):
                if (c*k + d*l)*(100 + e) <= (a*i + b*j + c*k + d*l)*e:
                    tupleList.append([i, j, k, l])
tupleList.remove([0, 0, 0, 0])

def concentration(i, j, k, l):
    return (c*k + d*l)/(a*i + b*j + c*k + d*l)

max_con = concentration(tupleList[0][0], tupleList[0][1], tupleList[0][2], tupleList[0][3])
max_tuple = tupleList[0]

for i in range(len(tupleList) - 1):
    if max_con < concentration(tupleList[i+1][0], tupleList[i+1][1], tupleList[i+1][2], tupleList[i+1][3]):
        max_con = concentration(tupleList[i + 1][0], tupleList[i + 1][1], tupleList[i + 1][2], tupleList[i + 1][3])
        max_tuple = tupleList[i + 1]

print(str(a*max_tuple[0] + b*max_tuple[1] + c*max_tuple[2] + d*max_tuple[3]) \
      + " " + str(c*max_tuple[2] + d*max_tuple[3]))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

n = int(input())
k = int(input())
x = list(map(int, input().split())) #x[0->(n-1)]

sum = 0

for i in x:
    if i < k - i:
        sum = sum + i
    else:
        sum = sum + k - i

print(sum)
Problem p03605 (python)

Fixed submission:
# -*- coding: utf-8 -*-

n = int(input())
fst = n % 10
snd = n // 10

if (fst == 9) | (snd == 9):
    print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
fst = n % 10
snd = n / 10

if (fst == 9) || (snd == 9):
    print("Yes")
elif :
    print("No")
Problem p02796 (python)

Fixed submission:
import sys
input = sys.stdin.readline


N = int(input())
start = []
end = []
itv = []
for i in range(N):
    X, L = (int(i) for i in input().split())
    itv.append([X+L, X-L])
    #start.append(X-L)
    #end.append(X+L)

#XL = [[int(i) for i in input().split()] for i in range(N)] 

#line = [0] * (2*(10**9) +1)

itv.sort()

#print(itv)

ass = 0
tt = 0-10**9
for i in range(N):
    if tt <= itv[i][1]:
        ass += 1
        tt = itv[i][0]
print(ass)

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


N = int(input())
start = []
end = []
itv = []
for i in range(N):
    X, L = (int(i) for i in input().split())
    itv.append([X+L, X-L])
    #start.append(X-L)
    #end.append(X+L)

#XL = [[int(i) for i in input().split()] for i in range(N)] 

count = N
#line = [0] * (2*(10**9) +1)
XL = sorted(XL)


itv.sort()

ass = 0
tt = 0
for i in range(N):
    if tt < itv[i][1]:
        ass += 1
        tt = itv[i][0]
print(ass)
Problem p02797 (python)

Fixed submission:
import sys
input = sys.stdin.readline

N, K, S = (int(i) for i in input().split())  
#a = [int(i) for i in input().split()] 
#e = [[int(i) for i in input().split()] for i in range(n)] 

seq = []
i = 0
for i in range(K):
    seq.append(S)

for j in range(0, N-K):
    if 2*S > 10**8:
        seq.append(1)
    else:
        seq.append(2*S)

print(" ".join(map(str, seq)))

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

N, K, S = (int(i) for i in input().split())  
#a = [int(i) for i in input().split()] 
#e = [[int(i) for i in input().split()] for i in range(n)] 

seq = []

for i in range(K):
    seq.append(S)

for j in range(i+1, N):
    seq.append(2*S)

print(" ".join(map(str, seq)))
Problem p02995 (python)

Fixed submission:
def gcd(x, y):
    while y > 0:
        x, y = y, x%y
    return x

def lcm(x, y):
    return x/gcd(x, y)*y


a, b, c, d = (int(i) for i in input().split())
m = int(lcm(c, d))
#print(m)
print((b-a+1)-(int((b)//c)-int((a-1)//c))-(int((b)//d)-int((a-1)//d))+(int((b)//(m))-int((a-1)//(m))))
##print(m)
#print("b-a", (b-a+1))
#print(int((b)//c)-int((a-1)//c))
#print((int((b)//d)-int((a-1)//d)))
#print((int((b-1)//m)-int((a-1)//m)))

Buggy submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)


a, b, c, d = (int(i) for i in input().split())
m = lcm(c, d)
#print(m)
print((b-a+1)-(int((b)/c)-int((a-1)/c))-(int((b)/d)-int((a-1)/d))+(int((b)/(m))-int((a-1)/(m))))
#print("b-a", (b-a))
#print(int((b)/c)-int((a-1)/c))
#print((int((b)/d)-int((a-1)/d)))
#print((int((b-1)/m)-int((a-1)/m)))
Problem p02996 (python)

Fixed submission:
N = int(input())
WS = [[int(i) for i in input().split()] for i in range(N)]
WS = sorted(WS, key=lambda x: x[1])
total = 0
for w in WS:
    total += w[0]
    if total > w[1]:
        print("No")
        exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
import math
N, K = (int(i) for i in input().split())
R = N-K

def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result


for i in range(1, K+1):
    print(((cmb(K-1, i-1))*cmb(i+1+R-(i-1)-1, R-(i-1)))%(10**9+7))
Problem p02601 (python)

Fixed submission:
li = list(map(int,input().split()))
a=int(input())
magic = 0
for i in range(0,8):
    if li[0] >= li[1]:
        li[1] = li[1] * 2
        magic = magic + 1

for i in range(0,8):
    if li[1] >= li[2]:
        li[2] = li[2] * 2
        magic = magic + 1
if a >= magic:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
li = int(input().split())
a=int(input())
magic = 0
for i in range(0,3):
    if li[0] >= li[1]:
        li[1] = li[1] * 2
        magic = magic + 1

for i in range(0,3):
    if li[1] >= li[2]:
        li[2] = li[2] * 2
        magic = magic + 1
if a >= magic:
    print("Yes")
else:
    print("No")
Problem p02600 (python)

Fixed submission:
n = int(input())
 
if n >= 1800: print(1)
elif n >= 1600: print(2)
elif n >= 1400: print(3)
elif n >= 1200: print(4)
elif n >= 1000: print(5)
elif n >= 800: print(6)
elif n >= 600: print(7)
elif n >= 400: print(8)

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

if n >= 1800: print(1)
elif n >= 1600: print(2)
elif n >= 1400: print(3)
elif n >= 1200: print(4)
elif n >= 1000: print(5)
elif n >= 800: print(6)
elif n >= 600: print(7)
elif n >= 400:: print(8)
Problem p02657 (python)

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

print(int(arr[0]) * int(arr[1]))

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


def mult():
    if 0 in arr:
        return 0
    else:
        a = 1
        for i in arr:
            a = a * int(i)
            if a > 1000000000000000000:
                return -1
            else: continue
        return a

print(mult())
Problem p02658 (python)

Fixed submission:
n = int(input())
arr = input().split()


def mult():
    if "0" in arr:
        return 0
    else:
        a = 1
        for i in arr:
            a = a * int(i)
            if a > 1000000000000000000:
                return -1
        return a

print(mult())

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = input().split()
def mult():
	if 0 in arr:
  		print(0)
        return 0
    a = 1
    for i in arr:
      a = a * i
    if a > 1000000000000000000:
      print(-1)
      return 0
    else: 
      print(a)
      return 0

mult()

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = list(map(int, input().split()))
if 0 in arr: print(0)
else:
	prod = 1
	for i in arr:
		count *= i
	if count > 1000000000000000000: count = -1
	print(count)

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

arr = input().split()
count = 1
if "0" in arr:
  count = 0
else: for i in arr:
        count *= int(i)
      if count > 1000000000000000000: count = -1
  
print(count)
Problem p02694 (python)

Fixed submission:
req = int(input())
count = 0
p = 100
while p < req:
  p = p * 101//100
  p = int(p)
  count +=1
  
print(count)

Buggy submission (verdict: Runtime Error):
req = int(input())
count = 0
p = 100
while P < req:
  p += int(p/100)
  count +=1
  
print(count)

Buggy submission (verdict: Runtime Error):
req = int(input())
count = 0
while P < req:
  p += int(P/100)
  count +=1
  
print(count)