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

Fixed submission:
x = list(map(int, input().split()))
print(x.index(0) + 1)

Buggy submission (verdict: Runtime Error):
 x = list(map(int, input().split()))
print(x.index(0) + 1)
Problem p02677 (python)

Fixed submission:
import math

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

rad = 0
deg_long = M * 6
deg_short = 30 * H + M / 2

if abs(deg_long - deg_short) > 180:
    rad = math.radians(360 - abs(deg_long - deg_short))
else:
    rad = math.radians(abs(deg_long - deg_short))

print(math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(rad)))

Buggy submission (verdict: Runtime Error):
import math

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

deg_long = M * 6
deg_short = 30 * H + M / 2

if abs(deg_long - deg_short) > 180:
    rad = math.radians(360 - abs(deg_long - deg_short))
else:
    math.radians(abs(deg_long - deg_short))

print(math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(rad)))
Problem p02681 (python)

Fixed submission:
S = str(input())
T = str(input())

if S == T[0:-1]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
S = str(input())
T = str(input())

if S == T[0:-1]:
    print('Yes')
else
    print('No')
Problem p02612 (python)

Fixed submission:
N = int(input())
ans = 0
if 1 <= N <= 10000:
    if N%1000 != 0:
        ans = ((N//1000) + 1)*1000 - N
    else:
        ans = 0
else:
    ans = "choose another number"
print(ans)

Buggy submission (verdict: Runtime Error):
N = input()
N = int(N)
ans = 0
if 1 <= N <= 10000:
    if N%1000 != 0:
        ans = 1000 - int(str(N)[1:])
    else:
        ans = 0
else:
    ans = "choose another number"
print(int(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 0
if N%1000 != 0:
    ans = 1000 - int(str(N)[1:])
    print(ans)
else:
    print(int(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
if 1 <= N <= 10000:
    if N%1000 != 0:
        ans = 1000 - int(str(N)[1:])
    else:
        ans = 0
else:
    ans = "choose another number"
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 0
if 1 <= N <= 10000:
    if N%1000 != 0:
        ans = 1000 - int(str(N)[1:])
    else:
        ans = 0
else:
    ans = "choose another number"
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 0
if N%1000 != 0:
    ans = 1000 - int(str(N)[1:])
    print(ans)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 0
if N%1000 != 0:
    ans = 1000 - int(str(N)[1:])
    print(ans)
else:
    print(ans)
Problem p02675 (python)

Fixed submission:
N = int(input())

if N < 1000:
    num = str(N)
    if num[-1] == "3":
        print("bon")
    elif num[-1] in ["0", "1", "6", "8"]:
        print("pon")
    else:
        print("hon")
else:
    print("Please enter an interger between not exceeding 999")

Buggy submission (verdict: Runtime Error):
from math import cos, pi

value = input().split()
A = int(value[0])
B = int(value[1])
H = int(value[2])
M = int(value[3])

if 1 <= A <= 1000 and 1 <= B <= 1000 and 0 <= H <=11 and 0 <= M <= 59:
    if abs(float(H)*30 - float(M)*6) == 90 :
        print(pow(float(A)**2 + float(B)**2, 0.5))
    else:
        print(pow(float(A)**2 + float(B)**2 - 2*float(A)*float(B)*cos(pi*(float(H)*30 - float(M)*6)/180),0.5))
else:
    print("Choose value in interval define on the exercise")

Buggy submission (verdict: Runtime Error):
K = int(input(), 10)
S = input().lower()

if 0 < K < 101 and 0 < len(S) < 101:
    if len(S) < K:
        print(S)
    else:
        print(S[:K] + "...") 
else:
    print("Try again with K and length of S between 1 and 100")
Problem p02606 (python)

Fixed submission:
L, R, d = map(int,input().split())



ans = 0

for i in range(L, R+1):
    if i % d == 0:
        ans = ans + 1
        
print(ans)

Buggy submission (verdict: Runtime Error):
L, R, d = input().split()

L = int()
R = int()
d = int()

ans = 0

for i in range(L, R+1):
    if i % d == 0:
        ans = ans + 1
        
print(ans)
Problem p02612 (python)

Fixed submission:
a = input()
a= int(a)

if 1<= a < 1000:
    print(1000 - a)
if 1000 < a < 2000:
    print(2000 - a)
if 2000 < a < 3000:
    print(3000 - a)
if 3000 < a < 4000:
    print(4000 - a)
if 4000< a < 5000:
    print(5000 - a)
if 5000< a < 6000:
    print(6000 - a)
if 6000< a < 7000:
    print(7000 - a)
if 7000 < a < 8000:
    print(8000 - a)
if 8000 < a < 9000:
    print(9000 - a)
if 9000 < a <10000:
    print(10000 - a)
if a == 1000:
    print(0)
if a == 2000:
    print(0)
if a == 3000:
    print(0)
if a == 4000:
    print(0)
if a == 5000:
    print(0)
if a == 6000:
    print(0)
if a == 7000:
    print(0)
if a == 8000:
    print(0)
if a == 9000:
    print(0)
if a == 10000:
    print(0)

# (物の値段/入力)a + （おつり）N = 1000?
#Nは整数だから　print(おつり)
#　N　＝　1000? - a

#input 1900  print 100 (2000)
# input 1525 print 475 (2000)
# input 2500 print 500 (3000)

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

a = 0
w = 0
t = 0
r = 0

for i in range(n):
    b = input()
    if b == "AC":
        a += 1
    if b == "WA":
        w += 1
    if b == "TLE":
        t += 1
    if b == "RE":
        r += 1
print("AC x", a)
print("WA x", w)
print("TLE x", t)
print("RE x", r)
Problem p02607 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = 0

for i in range(n):
    if ((i+1) * a[i]) % 2 != 0:
        ans += 1

print(ans)

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

for i in range(a):
    if (i+1) * a[i] % 2 != 1:
        ans += 1
print(ans)
Problem p02630 (python)

Fixed submission:
import collections
n = int(input())
li = list(map(int,input().split()))
q = int(input())
num_li=[list(map(int,input().split())) for i in range(q)]

c = collections.Counter(li)

li_sum = sum(li)

for i,j in num_li:
    s = 0
    if i in c:
        cnt = c.pop(i)
        c[j] += cnt
        li_sum = li_sum - (i*cnt) + (j*cnt)
    print(li_sum)

Buggy submission (verdict: Runtime Error):
import collections
n = int(input())
li = list(map(int,input().split()))
q = int(input())
num_li=[list(map(int,input().split())) for i in range(q)]

c = collections.Counter(li)

li_sum = sum(li)

for i,j in num_li:
    s = 0
    if i in c:
        cnt = c.pop(i)
        c[j] += cnt
    
    li_sum = li_sum - (i*cnt) + (j*cnt)
    print(li_sum)
Problem p02657 (python)

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

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

Buggy submission (verdict: Runtime Error):
print(int(input()) * int(input()))
Problem p02713 (python)

Fixed submission:
k = int(input())
li=[1, 9, 30, 76, 141, 267, 400, 624, 885, 1249, 1590, 2208, 2689, 3411, 4248, 5248, 6081, 7485, 8530, 10248, 11889, 13687, 15228, 17988, 20053, 22569, 25242, 28588, 31053, 35463, 38284, 42540, 46581, 50893, 55362, 61824, 65857, 71247, 76884, 84388, 89349, 97881, 103342, 111528, 120141, 128047, 134580, 146316, 154177, 164817, 174438, 185836, 194157, 207927, 218812, 233268, 245277, 257857, 268182, 288216, 299257, 313635, 330204, 347836, 362973, 383709, 397042, 416448, 434025, 456967, 471948, 499740, 515581, 536073, 559758, 583960, 604833, 633651, 652216, 683712, 709065, 734233, 754734, 793188, 818917, 846603, 874512, 909496, 933081, 977145, 1006126, 1041504, 1073385, 1106467, 1138536, 1187112, 1215145, 1255101, 1295142, 1342852, 1373253, 1422195, 1453816, 1502376, 1553361, 1595437, 1629570, 1691292, 1726717, 1782111, 1827492, 1887772, 1925853, 1986837, 2033674, 2089776, 2145333, 2197483, 2246640, 2332104, 2379085, 2434833, 2490534, 2554600, 2609625, 2693919, 2742052, 2813988, 2875245, 2952085, 3003306, 3096024, 3157249, 3224511, 3306240, 3388576, 3444609, 3533637, 3591322, 3693924, 3767085, 3842623, 3912324, 4027884, 4102093, 4181949, 4270422, 4361548, 4427853, 4548003, 4616104, 4718640, 4812789, 4918561, 5003286, 5131848, 5205481, 5299011, 5392008, 5521384, 5610705, 5739009, 5818390, 5930196, 6052893, 6156139, 6239472, 6402720, 6493681, 6623853, 6741078, 6864016, 6953457, 7094451, 7215016, 7359936, 7475145, 7593865, 7689630, 7886244, 7984165, 8130747, 8253888, 8403448, 8523897, 8684853, 8802826, 8949612, 9105537, 9267595, 9376656, 9574704, 9686065, 9827097, 9997134, 10174780, 10290813, 10493367, 10611772, 10813692]
print(li[k-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
import math
ans = 0
n = int(input())
for i in range(1,n+1):
    for j in range(1,n+1):
        t = math.gcd(i,j)
        for k in range(1,n+1):
            ans += math.gcd(t,k)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
import math
ans = 0
t=0
n = int(input())
for i in range(1,k+1):
    for j in range(1,k+1):
        t = math.gcd(i,j)
        for k in range(1,k+1):
            ans += math.gcd(t,k)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
import math
ans = 0
n = int(input())
for i in range(1,k+1):
    for j in range(1,k+1):
        t = math.gcd(i,j)
        for k in range(1,k+1):
            ans += math.gcd(t,k)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
ans = 0
n = int(input())
for i in range(1,k+1):
    for j in range(1,k+1):
        for k in range(1,k+1):
            ans += math.gcd(i,math.gcd(j,k))
print(ans)
Problem p02741 (python)

Fixed submission:
li= [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(li[int(input())-1])

Buggy submission (verdict: Runtime Error):
h, w = map(int,input().split())
masu = h*w
if h == 1 or w == 1:
    print(1)
elif masu % 2 == 0:
    print(masu//2)
else:
    print(masu//2 + 1)
Problem p02843 (python)

Fixed submission:
x = int(input())
kosuu, amari = x // 100, x % 100
ans = 0

for i in range(kosuu):
    amari -= 5
    if amari <= 0:
        ans = 1
        break

print(ans)

Buggy submission (verdict: Runtime Error):
x = int(input())
kosuu, amari = x // 100, x % 100
ans = 0

for i in kosuu:
    amari -= 5
    if amari <= 0:
        ans = 1
        break

print(ans)
Problem p02939 (python)

Fixed submission:
s = list(input())
cnt, i = 0, 1
l = len(s)

while i < l:
    if s[i] == s[i-1]:
        cnt += 1
        i += 2
    i += 1

print(l-cnt)

Buggy submission (verdict: Runtime Error):
s = list(input())
cnt, i = 0, 0
l = len(s)

while i < l:
    if s[i] == s[i+1]:
        cnt += 1
        i += 2
    i += 1

print(l-cnt)

Buggy submission (verdict: Runtime Error):
from collections import deque
s = deque(list(input()))
cnt, i = 0, 0
l = len(s)

while i < l:
    if s[i] == s[i+1]:
        cnt += 1
        i += 2
    i += 1

print(l-cnt)
Problem p02995 (python)

Fixed submission:
import fractions

a, b, c, d =map(int,input().split())

under_a = a -1
cd_gcd = fractions.gcd(c, d)

b_mul = b - (b//c)-(b//d)+(b//(c*d//cd_gcd))
under_a_mul = under_a - (under_a//c)-(under_a//d)+(under_a//(c*d//cd_gcd))

print(int(b_mul-under_a_mul))

Buggy submission (verdict: Runtime Error):
import math

a, b, c, d =map(int,input().split())

under_a = a -1
cd_gcd = math.gcd(c, d)

b_mul = b - (b//c)-(b//d)+(b//(c*d//cd_gcd))
under_a_mul = under_a - (under_a//c)-(under_a//d)+(under_a//(c*d//cd_gcd))

print(int(b_mul-under_a_mul))
Problem p03001 (python)

Fixed submission:
w, h, x, y = map(int,input().split())

if w / 2 == x and h / 2 == y:
    print(w * h / 2, 1)
else:
    print(w * h / 2, 0)

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

if w / 2 == x and h / 2 == y:
    print((w - x) * h,end=" ")
    print(1)
elif x == 0 and y == 0:
    print(w * h / 2,end=" ")
    print(0)
elif x == 0:
    print(max(((h - y) * w) / 2,(y * w) / 2),end=" ")
    print(0)
elif y == 0:
    print(max(((w - x) * h) / 2,(x * h) / 2),end=" ")
    print(0)
elif w / x == h / y:
    print(w * h / 2,end=" ")
    print(0)
elif w / 2 == x:
    print(x * h,end=" ")
    print(0)
elif h / 2 == y:
    print(w * y,end=" ")
    print(0)
else:
    print(max(w * y,x * h,((w-x)*(h-y))/2,end=" "))
    print(0)

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

if w / 2 == x and h / 2 == y:
    print((w - x) * h,end=" ")
    print(1)
elif x == 0 and y == 0:
    print(w * h / 2,end=" ")
    print(0)
elif x == 0:
    print(max(((h - y) * w) / 2,(y * w) / 2),end=" ")
    print(0)
elif y == 0:
    print(max(((w - x) * h) / 2,(x * h) / 2),end=" ")
    print(0)
elif w / x == h / y:
    print(w * h / 2,end=" ")
    print(0)
elif w / 2 == x:
    print(x * h,end=" ")
    print(0)
elif h / 2 == y:
    print(w * y,end=" ")
    print(0)
else:
    print(max(w * y,x * h,((w-x)*(h-y))/2,end=" ")
    print(0)

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

if w / 2 == x and h / 2 == y:
    print((w - x) * h,end=" ")
    print(1)
elif w / x == h / y:
    print(w * h / 2,end=" ")
    print(0)
elif w / 2 == x:
    print(x * h,end=" ")
    print(0)
elif h / 2 == y:
    print(w * y,end=" ")
    print(0)
else:
    print(max(w * y,x * h),end=" ")
    print(0)
Problem p03037 (python)

Fixed submission:
n,m = map(int,input().split())
li=[list(map(int,input().split())) for i in range(m)]
max_l,min_r=0,10**9

for i in li:
    max_l = max(max_l,i[0])
    min_r = min(min_r,i[1])
if min_r >= max_l:
    print(min_r-max_l+1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
li=[list(map(int,input().split())) for i in range(m)]
max_l,min_r=0,10**9

for i in li:
    max_l = max(max_l,li[0])
    min_r = min(min_r,li[1])
print(min_r-max_l+1)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
li=[list(map(int,input().split())) for i in range(m)]
cnt = ()
ans=[]

for j in li:
    cnt.add(set(num for num in range(j[0],j[1]+1)))

ans = cnt[0]
for k in range(len(cnt)-1):
    ans = ans & cnt[k+1]
print(len(ans))
Problem p03067 (python)

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

if a > c > b or a < c < b:
    print("Yes")
else:
    print("No")

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

if a > c > c or a < c < b:
    print("YES)
else:
    print("No")
Problem p03238 (python)

Fixed submission:
input_num = input()

if input_num == '1':
    print('Hello World')

else:
    a = int(input())
    b = int(input())
    print(a + b)

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

if input_num != 1:
    a = int(input())
    b = int(input())
    print(a + b)
else:
    print('Hello World')
Problem p03282 (python)

Fixed submission:
s = list(map(int, list(input())))
k = int(input())
ans = 1

if len(s) <= k:
    for i in s:
        if i != 1:
            ans = i
            break
else:
    for i in range(0,k):
        if s[i] != 1:
            ans = s[i]
            break

print(ans)

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

if s[0] == 1:
    print(s[1])
else:
    print(s[0])
Problem p03545 (python)

Fixed submission:
from itertools import product
s = list(input())
n = len(s)

pattern = list(product(['+', '-'], repeat=n-1))

for i in range(2 ** (n-1)):
    formula = s[0]
    for j, k in zip(pattern[i], s[1:]):
        formula += (j + k)
    if eval(formula) == 7:
        print("{}=7".format(formula))
        break

Buggy submission (verdict: Runtime Error):
from itertools import product
s = list(input())
n = len(s)

pattern = list(product(['+', ''], repeat=n-1))

for i in range(2 ** (n-1)):
    formula = s[0]
    for j, k in zip(pattern[i], s[1:]):
        formula += (j + k)
    if eval(formula) == 7:
        print("{}=7".format(formula))
        break
Problem p03738 (python)

Fixed submission:
def main():

    a = int(input())
    b = int(input())

    if a > b:
        print("GREATER")
    elif a == b:
        print("EQUAL")
    else:
        print("LESS")

main()

Buggy submission (verdict: Runtime Error):
def main():

    a = int(input())
    b = int(input())

    if a > b:
        print("GREATER")
    elif a = b:
        print("EQUAL")
    else:
        print("LESS")

main()
Problem p03760 (python)

Fixed submission:
o = list(input())
e = list(input())
ans = []

if len(o) != len(e):
    e += [""]

for i in range(len(o)):
    ans += [o[i],e[i]]
print(*ans,sep="")

Buggy submission (verdict: Runtime Error):
o = list(input())
e = list(input())
ans = []

for i in range(len(o)):
    ans = ans+ [o[i],e[i]]
print(*ans,sep="")

Buggy submission (verdict: Runtime Error):
o = list(input())
e = list(input())
ans = []

for i in range(len(o)):
    ans += [o[i],e[i]]
print(*ans,sep="")
Problem p03853 (python)

Fixed submission:
h,w = map(int,input().split())
li = [input() for _ in range(h)]

for i in li:
    print(i,i,sep="\n")

Buggy submission (verdict: Runtime Error):
h,w = map(int,input().split())
li = [input() for _ in range(h)]

for i in li:
    print(i,i,sep="\n")***.
Problem p02742 (python)

Fixed submission:
h, w = map(int,input().split())

if w == 1 or h == 1:
    print(1)
    exit()

ans = (w // 2) * h
if w % 2 == 1:
    if h % 2 == 0:
        ans += h // 2
    else:
        ans += h // 2 + 1
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
h, w = map(int,input().split())

if h % 2 == 0:
    tmp1 = h // 2
    ans = tmp1 * w
else:
    tmp1 = h // 2
    #print(tmp1 * w)
    #print(w % 2)
    if w % 2 == 0:
        ans = (tmp1 * wl) + (w // 2)
    else:
        ans = (tmp1 * w) + (w // 2 + 1)
print(ans)
Problem p02767 (python)

Fixed submission:
# -*- coding: utf-8 -*-
n = int(input())
x = [int(i) for i in input().split()]

ans = 2147483647
tmp = 0
for i in range(-1000, 1001): #iは集会を開く場所
    for j in range(n):
        tmp += pow(x[j] - i, 2)
    if ans > tmp:
        ans = tmp
    tmp = 0
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
ans = sys.maxint

n = int(input())
x = [int(i) for i in input().split()]


tmp = 0
for i in range(-1000, 1001): #iは集会を開く場所
    for j in range(n):
        tmp += pow(x[j] - i, 2)
    if ans > tmp:
        ans = tmp
    tmp = 0
print(ans)
Problem p02843 (python)

Fixed submission:
# -*- coding: utf-8 -*-
x = int(input())

tmp1 = (x % 100) // 5
tmp2 = ((x % 100) - tmp1 * 5) // 4
tmp3 = ((x % 100) - tmp1 * 5 - tmp2 * 4) // 3
tmp4 = ((x % 100) - tmp1 * 5 - tmp2 * 4 - tmp3 * 3) // 2
tmp5 = (x % 100) - tmp1 * 5 - tmp2 * 4 - tmp3 * 3 - tmp4 * 2
if x // 100 >= tmp1 + tmp2 + tmp3 + tmp4 + tmp5:
    print(1)
else:
    print(0)

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

dp = [0 for _ in range(x + 1)] #0:"No", 1:"Yes"
dp[0] = 1
if x < 100:
    print(dp[x])
    exit()
for i in range(100, 106):
    dp[i] = 1
for i in range(106, x + 1):
    if dp[i-100] == 1 or dp[i-101] == 1 or dp[i-102] == 1 or dp[i-103] == 1 or dp[i-104] == 1 or dp[i-105] == 1:
        dp[i] = 1
print(dp[x])

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

dp = [0 for _ in range(x + 1)] #0:"No", 1:"Yes"
dp[0] = 1
for i in range(100, 106):
    dp[i] = 1
for i in range(106, x + 1):
    if dp[i-100] == 1 or dp[i-101] == 1 or dp[i-102] == 1 or dp[i-103] == 1 or dp[i-104] == 1 or dp[i-105] == 1:
        dp[i] = 1
print(dp[x])

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

dp = [0 for _ in range(x + 1)] #0:"No", 1:"Yes"
dp[0] = 1
for i in range(100, 106):
    dp[i] = 1
for i in range(106, x + 1):
    if dp[i-100] == 1 or dp[i-101] == 1 or dp[i-102] == 1 or dp[i-103] == 1 or dp[i-104] == 1 or dp[i-105] == 1:
        dp[i] = 1
print(dp[x])
Problem p02854 (python)

Fixed submission:
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()] 

su = [0 for _ in range(n)] #鉄の棒の切れ目の座標
for i in range(n):
    su[i] = su[i-1] + a[i]
#print(su)

tmp = 2 * pow(10, 10) + 1
for i in su:
    if abs(i - su[-1]/2) < tmp:
        tmp = abs(i - su[-1]/2)
#print(su[-1]/2, tmp)

"""
#中心に一番近い鉄の棒の切れ目と中心との距離の差
l = 0
r = n-1
while (l - r) >= 1:
    c = (l + r) // 2
    #print(l, r, c)
    if su[c] < su[-1] / 2:
        l = c
    elif su[c] > su[-1] / 2:
        r = c
#print(su[l], su[r])
tmp = min(abs(su[l] - su[-1]/2), abs(su[r] - su[-1]/2))
print(tmp)
"""

ans = 2 * tmp
print(int(ans))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = int(input())
a = [int(i) for i in input().split()]

ans = []
x = 0

for h in range(N):
    B = [0]
    for i in range(1,N+1):
        B.append(a[i-1] + B[i-1])

    for i in range(N):
        if B[N] - B[i] == B[i]:
            ans.append(x)
        else:
            a[h] += 1
            x += 1


for h in range(N):
    B = [0]
    for i in range(1,N+1):
        B.append(a[i-1] + B[i-1])

    for i in range(N):
        if B[N] - B[i] == B[i]:
            ans.append(x)
        else:
            a[h] -= 1
            x += 1

#print(ans)
print(min(ans))
Problem p02972 (python)

Fixed submission:
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()]

count = [0 for _ in range(n)]
for i in reversed(range(1, n + 1)):
    tmp = 0
    for j in range(i, n+1, i):
        tmp += count[j-1]
    #print(tmp)
    if a[i-1] % 2 != tmp % 2:
        count[i-1] += 1
#print(count)
m = sum(count)
ans = []
for i in range(n):
    if count[i] == 1:
        ans.append(str(i+1))

print(m)
print(' '.join(ans))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()]

count = [0 for _ in range(n)]
for i in reversed(range(1, n + 1)):
    tmp = 0
    for j in range(i, n, i):
        tmp += a[j]
    if a[i-1] % 2 != tmp % 2:
        count[i] += 1
m = sum(count)
ans = []
for i in range(n):
    if count[i] == 1:
        ans.append(str(i))

print(m)
print(' '.join(ans))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()]

count = [0 for _ in range(n)]
for i in reversed(range(1, n + 1)):
    tmp = 0
    for j in range(i, n, i):
        if j % i == 0:
            tmp += a[j]
    if a[i-1] % 2 != tmp % 2:
        count[i] += 1
m = sum(count)
ans = []
for i in range(n):
    if count[i] == 1:
        ans.append(str(i))

print(m)
print(' '.join(ans))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()]

count = [0 for _ in range(n)]
for i in reversed(range(1, n + 1)):
    tmp = 0
    for j in range(i, n, i):
        if j % i == 0:
            tmp += a[j]
    if a[i-1] % 2 != tmp % 2:
        count[i] += 1
m = count.count(1)
ans = []
for i in range(n):
    if count[i] == 1:
        ans.append(str(i))

print(m)
print(' '.join(ans))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()]

count = [0 for _ in range(n)]
for i in reversed(range(1, n + 1)):
    tmp = 0
    for j in range(i, n):
        if j % 1 == 0:
            tmp += a[j]
    if a[i-1] % 2 != tmp % 2:
        count[i] += 1
m = count.count(1)
ans = []
for i in range(n):
    if count[i] == 1:
        ans.append(str(i))

print(m)
print(' '.join(ans))
Problem p02994 (python)

Fixed submission:
# -*- coding: utf-8 -*-
N, L = map(int,input().split())

taste = []
for i in range(1,N + 1):
    taste.append(L + i - 1)

SUM = sum(taste)

DIF = abs(SUM - (SUM - taste[0]))
ans = SUM - taste[0]
for i in range(1,N):
    x = SUM - taste[i]
    if abs(SUM - x) < DIF:
        DIF = abs(SUM - x)
        ans = x
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N, L = map(int,input().split())

taste = []
for i in range(1,N + 1):
    taste.append(L + i - 1)

SUM = sum(taste)

DIF = abs(SUM - (SUM - taste[0]))
ans = SUM - taste[0]
for i in range(1,N + 1):
    x = SUM - taste[i]
    if abs(SUM - x) < DIF:
        DIF = abs(SUM - x)
        ans = x
print(ans)
Problem p03068 (python)

Fixed submission:
# -*- coding: utf-8 -*-
N = int(input())
S = list(str(input()))
K = int(input())

for i in range(N):
    if S[i] != S[K - 1]:
        S[i] = "*"

Z = ''.join(S)
print(Z)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = int(input())
S = list(str(input()))
K = int(input())

for i in range(N):
    if S[i] != S[K]:
        S[i] = "*"
"".join(S)
print(S)