Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
l, r = list(map(int, input().split()))
count = 0
amari_list = []

for i in range(l, r+1):
    count_j = 0
    for j in range(i+1, r+1):
        amari_list.append(i * j % 2019)
        if count == 2019:
            break
        count_j += 1

    if count == 2019:
        break
    count += 1

ans = min(amari_list)
print(ans)


Fixed submission:
# https://atcoder.jp/contests/abc133/tasks/abc133_c
# C - Remainder Minimization 2019

l, r = list(map(int, input().split()))
count = 0
amari_list = []

for i in range(l, r+1):
    count_j = 0
    for j in range(i+1, r+1):
        amari_list.append(i * j % 2019)
        if count_j == 2019:
            break
        count_j += 1

    if count == 2019:
        break
    count += 1

ans = min(amari_list)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

N = int(input().split()[0])
a_list = list(map(int, input().split()))
start_w = a_list[0] * 2

# 一番小さいものから決めていく？
for sw in range(start_w + 1):
    w_list = []
    if a_list[0] < sw // 2:
        continue
    w_list.append(sw)
    for i in range(1, N):
        w_list.append((a_list[i - 1] - w_list[i - 1] // 2) * 2)

    if a_list[-1] == (w_list[0] + w_list[-1]) // 2:
        break

ans = " ".join([str(w) for w in w_list])
print(ans)


Fixed submission:
#!/usr/bin/env python3

N = int(input().split()[0])
a_list = list(map(int, input().split()))

r_list = []
total = 0

for i in range(1, N, 2):
    total += a_list[i]

r_list.append(sum(a_list) - total * 2)

for i in range(1, N):
    r = a_list[i - 1] * 2 - r_list[i - 1]
    r_list.append(r)

ans = " ".join([str(w) for w in r_list])
print(ans)
Buggy python submission (verdict: Runtime Error):
import math

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

c_n = (b // c) - ((a - 1) // c)
d_n = (b // d) - ((a - 1) // d)

lcm = (c * d) // math.gcd(c, d)
lcm_n = (b // lcm) - ((a - 1) // lcm)

ans = (b - a + 1) - (c_n + d_n - lcm_n)
print(ans)


Fixed submission:
import fractions

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

c_n = (b // c) - ((a - 1) // c)
d_n = (b // d) - ((a - 1) // d)

lcm = (c * d) // fractions.gcd(c, d)
lcm_n = (b // lcm) - ((a - 1) // lcm)

ans = (b - a + 1) - (c_n + d_n - lcm_n)
print(ans)
Buggy python submission (verdict: Runtime Error):
n, x = list(map(int, input().split()))
l_list = list(map(int, input().split()))

c = 0
d = 0

for i in range(n+1):
    if d <= x:
        d += l_list[i]
        c += 1
    else:
        break

print(c)

Fixed submission:
n, x = list(map(int, input().split()))
l_list = list(map(int, input().split()))

c = 1
d = 0

for i in range(n):
    d += l_list[i]
    if d <= x:
        c += 1
    else:
        break

print(c)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = list(map(int, input().split()))
lr_list = []

for _ in range(m):
    l, r = list(map(int, input().split()))
    lr_list.append((l, r))

card2canopen_dict = {i: True for i in range(1, n+1)}

for n_card in range(1, n+1):
    for i, lr in enumerate(lr_list):
        target_l = lr[0]
        target_r = lr[1]
        if card2canopen_dict[n_card] and target_l <= n_card <= target_r:
            pass
        else:
            card2canopen_dict[n_card] = False
            break

card_list = [key for key, value in card2canopen_dict.items() if value]

ans = len(card_list)
print(ans)


Fixed submission:
n, m = list(map(int, input().split()))
lr_list = []

for _ in range(m):
    l, r = list(map(int, input().split()))
    lr_list.append((l, r))

card2canopen_dict = {i: True for i in range(1, n+1)}

# 重ね合わせの区間を調べれば良い気がする
kukan_min, kukan_max = 1, n

for i, lr in enumerate(lr_list):
    l, r = lr[0], lr[1]
    if l >= kukan_min:
        kukan_min = l
    if r <= kukan_max:
        kukan_max = r

if kukan_max < kukan_min:
    ans = 0
else:
    ans = len(range(kukan_min, kukan_max+1))

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# https://atcoder.jp/contests/abc127/tasks/abc127_c
# C - Prison

n, m = list(map(int, input().split()))
lr_list = []

for _ in range(m):
    l, r = list(map(int, input().split()))
    lr_list.append((l, r))

card2canopen_dict = {i: True for i in range(1, n+1)}

for i, lr in enumerate(lr_list):
    target_l = lr[0]
    target_r = lr[1]
    for n_card in range(1, n+1):
        if card2canopen_dict[n_card] and target_l <= n_card <= target_r:
            pass
        else:
            card2canopen_dict[n_card] = False

card_list = [key for key, value in card2canopen_dict.items() if value]

ans = len(card_list)
print(ans)


Fixed submission:
n, m = list(map(int, input().split()))
lr_list = []

for _ in range(m):
    l, r = list(map(int, input().split()))
    lr_list.append((l, r))

card2canopen_dict = {i: True for i in range(1, n+1)}

# 重ね合わせの区間を調べれば良い気がする
kukan_min, kukan_max = 1, n

for i, lr in enumerate(lr_list):
    l, r = lr[0], lr[1]
    if l >= kukan_min:
        kukan_min = l
    if r <= kukan_max:
        kukan_max = r

if kukan_max < kukan_min:
    ans = 0
else:
    ans = len(range(kukan_min, kukan_max+1))

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import fractions
import itertools
import collections

n = int(input().split()[0])
a_list = list(map(int, input().split()))

def koyakusu(x):
    i = 1
    koyaku_list = []
    while i * i <= x:
        if x % i == 0:
            koyaku_list.append(i)
            koyaku_list.append(x//i)
        i += 1

    koyaku_list = list(set(koyaku_list))
    return koyaku_list

# 最大公約数の最大値
gcd_list = []
all_koyaku_list_list = []
for a in a_list:
    koyaku_list = koyakusu(a)
    # print('{}: {}'.format(a, koyaku_list))
    all_koyaku_list_list.append(koyaku_list)

all_koyaku_list = list(itertools.chain.from_iterable(all_koyaku_list_list))
c = collections.Counter(all_koyaku_list)

kouho_list = [k for k, v in c.items() if v in [n, n-1]]
# print(kouho_list)
ans = max(kouho_list)

print(ans)


Fixed submission:
import fractions
import itertools
import collections

n = int(input().split()[0])
a_list = list(map(int, input().split()))
sorted_list = sorted(a_list)
min_a, second_min_a = sorted_list[0], sorted_list[1]

def koyakusu(x):
    i = 1
    koyaku_list = []
    while i * i <= x:
        if x % i == 0:
            koyaku_list.append(i)
            koyaku_list.append(x//i)
        i += 1

    koyaku_list = list(set(koyaku_list))
    return koyaku_list

kouho_list = []
# print('{}: {}'.format(min_a, koyakusu(min_a)))
kouho_list += koyakusu(min_a)

# print('{}: {}'.format(second_min_a, koyakusu(second_min_a)))
kouho_list += koyakusu(second_min_a)
kouho_list = list(set(kouho_list))
# print(kouho_list)
ans_kouho_list = []

for kouho in kouho_list:
    x_list = [x for x in a_list if x % kouho == 0]
    # print('kouho {} ({})'.format(kouho, len(x_list)))
    if len(x_list) >= n-1:
        ans_kouho_list.append(kouho)
# print(ans_kouho_list)
ans = max(ans_kouho_list)

print(ans)
Buggy python submission (verdict: Runtime Error):
H, W = list(map(int, input().split()))
h, w = list(map(int, input().split()))

ans = (H - h) * (W - w)
print(ansj
      

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

ans = (H - h) * (W - w)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import copy

s = input().split()[0]

def get_kouho_list(box_list):
    kouho_list = []
    for i, color in enumerate(box_list[:-1]):
        if box_list[i] != box_list[i+1]:
            kouho_list.append((i, i+1))
    return kouho_list

def tansaku(now_box_list, koremade_step):
    kouho_list = get_kouho_list(now_box_list)
    for kouho in kouho_list:
        next_box_list = copy.copy(now_box_list)
        del next_box_list[kouho[0]:kouho[1]+1]
        tansaku(next_box_list, koremade_step + 1)
    global max_step
    if koremade_step > max_step:
        max_step = koremade_step
    return

max_step = 0
tansaku(list(s), 0)
print(max_step * 2)


Fixed submission:
import collections

s = input().split()[0]

counter = collections.Counter(list(s))
c_0 = counter['0']
c_1 = counter['1']
step = min(c_0, c_1)
print(step * 2)
Buggy python submission (verdict: Runtime Error):
from sys import stdin

a, b = stdin.readline().rstrip().split()

for i in range(1, 21):
    if a * i > b:
        break

    if b % (a * i) == 0:
        print(a + b)
        break
else:
    print(b - a)

Fixed submission:
from sys import stdin

a, b = stdin.readline().rstrip().split()
a, b = int(a), int(b)

for i in range(1, 21):
    if a * i > b:
        print(b - a)
        break

    if b % (a * i) == 0:
        print(a + b)
        break
else:
    print(b - a)

Buggy python submission (verdict: Runtime Error):
for i in range(1, 21):
    if a * i > b:
        break

    if b % (a * i) == 0:
        print(a + b)
        break
else:
    print(b - a)

Fixed submission:
from sys import stdin

a, b = stdin.readline().rstrip().split()
a, b = int(a), int(b)

for i in range(1, 21):
    if a * i > b:
        print(b - a)
        break

    if b % (a * i) == 0:
        print(a + b)
        break
else:
    print(b - a)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

N, W = list(map(int, input().split()))
item_list = []

for _ in range(N):
    w, v = list(map(int, input().split()))
    item_list.append((w, v))

dp_table = [[0] * (W + 1) for _ in range(N + 1)]

for i in range(1, N + 1):
    w, v = item_list[i - 1]
    for j in range(W + 1):
        # 品物iを入れない場合
        before_best_value = dp_table[i - 1][j]
        dp_table[i][j] = before_best_value
        # 品物iを入れる場合
        if j - w < 0:
            continue
        value = dp_table[i - 1][j - w] + v
        best_value = max(before_best_value, value)
        dp_table[i][j] = best_value

ans = max(dp_table[-1])
print(ans)


Fixed submission:
#!/usr/bin/env python3

N, W = list(map(int, input().split()))
item_list = []

for _ in range(N):
    w, v = list(map(int, input().split()))
    item_list.append((w, v))

dp_table = [[0] * (W + 1) for _ in range(N + 1)]

for i in range(1, N + 1):
    w, v = item_list[i - 1]
    for j in range(W + 1):
        # 品物iを入れない場合
        before_best_value = dp_table[i - 1][j]
        dp_table[i][j] = before_best_value
        # 品物iを入れる場合
        if j - w < 0:
            continue
        value = dp_table[i - 1][j - w] + v
        best_value = max(before_best_value, value)
        dp_table[i][j] = best_value

ans = max(dp_table[-1])
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input().split()[0])

data = dict(25="Christmas", 24="Christmas Eve",
            23="Christmas Eve Eve",
            22="Christmas Eve Eve Eve")

print(data[n])


Fixed submission:
n = int(input().split()[0])

data = {25:"Christmas",
        24:"Christmas Eve",
        23:"Christmas Eve Eve",
        22:"Christmas Eve Eve Eve"}

print(data[n])
Buggy python submission (verdict: Time Limit Exceeded):
# https://atcoder.jp/contests/abc115/tasks/abc115_c
# C - Christmas Eve
import itertools

n, k = list(map(int, input().split()))
h_list = []

for _ in range(n):
    h_list.append(int(input().split()[0]))

# 全探索で頑張る方法
# 多分時間が足りない
p_list = itertools.combinations(h_list, k)
min_value = float('inf')

for p in p_list:
    p = list(p)
    v = max(p) - min(p)
    if v < min_value:
        min_value = v

print(min_value)


Fixed submission:
# https://atcoder.jp/contests/abc115/tasks/abc115_c
# C - Christmas Eve
import itertools

n, k = list(map(int, input().split()))
h_list = []

for _ in range(n):
    h_list.append(int(input().split()[0]))

h_list = sorted(h_list)

min_value = float('inf')

for i, v in enumerate(h_list[:-k+1]):
    diff_h = h_list[i+k-1] - v
    if diff_h < min_value:
        min_value = diff_h

print(min_value)
Buggy python submission (verdict: Runtime Error):
n = int(input().split()[0])
v_list = list(map(int, input().split()))

# 奇数番目の数
odd_list = [str(v) for i, v in enumerate(v_list) if i % 2 == 1]
# 偶数番目の数
even_list = [str(v) for i, v in enumerate(v_list) if i % 2 == 0]

# 奇数の最頻値（No1とNo2)
odd_counter = collections.Counter(odd_list)
odd_1 = odd_counter.most_common()[0][0]

if len(odd_counter) >= 2:
    odd_2 = odd_counter.most_common()[1][0]
else:
    odd_2 = '*' # dummy

# 偶数の最頻値（No1とNo2)
even_counter = collections.Counter(even_list)
even_1 = even_counter.most_common()[0][0]

if len(even_counter) >= 2:
    even_2 = even_counter.most_common()[1][0]
else:
    even_2 = '+' # dummy

# 以前の方法だと条件分岐が複雑になるので
# とりうる操作を全部試して、回数が少ない方をとる

if even_1 == odd_1:
    # 偶数側の操作回数（最頻値で置き換え）
    even_op_count = len([v for v in even_list if v != even_1])
    # 奇数の操作回数
    odd_op_count = len([v for v in odd_list if v != odd_2])
    count_1 = even_op_count + odd_op_count

    # 偶数側の操作回数
    even_op_count = len([v for v in even_list if v != even_2])
    # 奇数側の操作回数（最頻値で置き換え）
    odd_op_count = len([v for v in odd_list if v != odd_1])
    count_2 = even_op_count + odd_op_count

    count = min(count_1, count_2)
else:
    # 偶数側も奇数側も最頻値で置き換えればよい
    even_op_count = len([v for v in even_list if v != even_1])
    odd_op_count = len([v for v in odd_list if v != odd_1])
    count = even_op_count + odd_op_count

print(count)


Fixed submission:
# https://atcoder.jp/contests/abc111/tasks/arc103_a
# C - /\/\/\/
import collections

n = int(input().split()[0])
v_list = list(map(int, input().split()))

# 奇数番目の数
odd_list = [str(v) for i, v in enumerate(v_list) if i % 2 == 1]
# 偶数番目の数
even_list = [str(v) for i, v in enumerate(v_list) if i % 2 == 0]

# 奇数の最頻値（No1とNo2)
odd_counter = collections.Counter(odd_list)
odd_1 = odd_counter.most_common()[0][0]

if len(odd_counter) >= 2:
    odd_2 = odd_counter.most_common()[1][0]
else:
    odd_2 = '*' # dummy

# 偶数の最頻値（No1とNo2)
even_counter = collections.Counter(even_list)
even_1 = even_counter.most_common()[0][0]

if len(even_counter) >= 2:
    even_2 = even_counter.most_common()[1][0]
else:
    even_2 = '+' # dummy

# 以前の方法だと条件分岐が複雑になるので
# とりうる操作を全部試して、回数が少ない方をとる

if even_1 == odd_1:
    # 偶数側の操作回数（最頻値で置き換え）
    even_op_count = len([v for v in even_list if v != even_1])
    # 奇数の操作回数
    odd_op_count = len([v for v in odd_list if v != odd_2])
    count_1 = even_op_count + odd_op_count

    # 偶数側の操作回数
    even_op_count = len([v for v in even_list if v != even_2])
    # 奇数側の操作回数（最頻値で置き換え）
    odd_op_count = len([v for v in odd_list if v != odd_1])
    count_2 = even_op_count + odd_op_count

    count = min(count_1, count_2)
else:
    # 偶数側も奇数側も最頻値で置き換えればよい
    even_op_count = len([v for v in even_list if v != even_1])
    odd_op_count = len([v for v in odd_list if v != odd_1])
    count = even_op_count + odd_op_count

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
# https://atcoder.jp/contests/abc102/tasks/arc100_a
# C - Linear Approximation

N = int(input().split()[0])
a_list = list(map(int, input().split()))
min_b = float('inf')
max_a = max(a_list)

work_list = [a - i - 1 for i, a in enumerate(a_list)]
work_list = list(set(work_list))

for b in work_list:  # 10 ** 5
    total_b = 0
    for i, a in enumerate(a_list):  # 10 ** 5
        total_b += abs(a - (b + i + 1))
    min_b = min(min_b, total_b)

print(min_b)


Fixed submission:
# https://atcoder.jp/contests/abc102/tasks/arc100_a
# C - Linear Approximation

N = int(input().split()[0])
a_list = list(map(int, input().split()))
min_b = float('inf')
max_a = max(a_list)

work_list = [a - (i + 1) for i, a in enumerate(a_list)]
w = sorted(work_list)[int(N / 2)]
ans = sum([abs(x - w) for x in work_list])
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# https://atcoder.jp/contests/abc098/tasks/arc098_a
# C - Attention
import collections

N = int(input().split()[0])
S = input().split()[0]
min_c = float('inf')
for i in range(N):
    w_side = S[:i]
    counter = collections.Counter(w_side)
    c = counter['W']

    if i < N - 1:
        e_side = S[i+1:]
        counter = collections.Counter(e_side)
        c += counter['E']
    min_c = min(min_c, c)

print(min_c)


Fixed submission:
# https://atcoder.jp/contests/abc098/tasks/arc098_a
# C - Attention
import collections

N = int(input().split()[0])
S = input().split()[0]
min_c = float('inf')
count_dict = {}
now_w = 0
w_count_list = []

for i in range(N):
    w_count_list.append(now_w)
    if S[i] == 'W':
        now_w += 1

now_e = 0
e_count_list = []
r_S = list(reversed(S))
for i in range(N):
    e_count_list.append(now_e)
    if r_S[i] == 'E':
        now_e += 1

e_count_list = list(reversed(e_count_list))

ans = min([w + e for w, e in zip(w_count_list, e_count_list)])
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# https://atcoder.jp/contests/abc097/tasks/arc097_a
# C - K-th Substring

s = input().split()[0]
K = int(input().split()[0])

sub_s_list = []

for i in range(len(s)):
    for j in range(len(s)):
        sub_s = s[i:i+j+1]
        sub_s_list.append(sub_s)

sub_s_list = list(set(sub_s_list) - set(['']))
ans = sorted(sub_s_list)[K-1]
print(ans)


Fixed submission:

# https://atcoder.jp/contests/abc097/tasks/arc097_a
# C - K-th Substring

s = input().split()[0]
K = int(input().split()[0])

sub_s_list = []
N = len(s)
sorted_char_list = sorted(list(set(s)))
char_N = len(sorted_char_list)

# Kは最大で5であることに着目する
# 全部列挙する必要はなく、5番目まで見つかればよい
# 最初の1文字目
start_index_list = [i for i, char in enumerate(s) if char == sorted_char_list[0]]
pattern = sorted_char_list[0]
sorted_char_list.remove(pattern)
char_i = 0
j = 1

waiting_list = []

while len(sub_s_list) < 5:
    # print(pattern)
    sub_s_len = len(pattern)
    sub_s_list.append(pattern)
    next_list = [s[i:i+sub_s_len+1]
                for i in start_index_list
                if (i <= N - (sub_s_len + 1)) and (s[i:i+sub_s_len] == pattern)]

    if not next_list:
        if min(start_index_list) + sub_s_len > N:
            # 末尾まで伸びた
            if waiting_list:
                pattern = waiting_list[0]
                waiting_list.remove(pattern)
            elif sorted_char_list:
                pattern = sorted_char_list[0]
                start_index_list = [i for i, char in enumerate(s) if char == sorted_char_list[0]]
                sorted_char_list.remove(pattern)
        else:
            # 末尾まで伸ばす
            next_waiting_list =  [s[i:i+sub_s_len+1] for i in start_index_list
                                    if (i <= N - (sub_s_len + 1))]
            # print(next_waiting_list)
            waiting_list += next_waiting_list
            waiting_list = list(set(waiting_list))

            if waiting_list:
                waiting_list = sorted(waiting_list)
                pattern = waiting_list[0]
                waiting_list.remove(pattern)
            elif sorted_char_list:
                pattern = sorted_char_list[0]
                start_index_list = [i for i, char in enumerate(s) if char == sorted_char_list[0]]
                sorted_char_list.remove(pattern)
    else:
        waiting_list += next_list
        waiting_list = sorted(list(set(waiting_list)))
        pattern = waiting_list[0]
        waiting_list.remove(pattern)
    # print(waiting_list)

sub_s_list = list(set(sub_s_list))
ans = sorted(sub_s_list)[K-1]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

import math
import numpy as np

n = int(input().split()[0])
a_list = list(map(int, input().split()))


def C(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


a_list = sorted(a_list)
max_comb = -float("inf")

for i, ai in enumerate(a_list):
    # aiを固定する
    # aiが偶数の場合は、ai/2、
    # aiが奇数の場合は、(ai-1)/2または(ai+1)/2に
    # 一番近い値が答えになる
    if ai % 2 == 0:
        idx = np.abs(np.asarray(a_list) - ai // 2).argmin()
        aj = a_list[idx]
    else:
        target_1 = (ai - 1) // 2
        idx_1 = np.abs(np.asarray(a_list) - target_1).argmin()
        aj = a_list[idx_1]
        target_2 = (ai + 1) // 2
        idx_2 = np.abs(np.asarray(a_list) - target_2).argmin()

        if abs(a_list[idx_1] - target_1) > abs(a_list[idx_2] - target_2):
            aj = a_list[idx_2]

    comb = C(ai, aj)
    if max_comb < comb:
        max_comb = comb
        comb_set = (ai, aj)

ans = "{} {}".format(ai, aj)
print(ans)


Fixed submission:
#!/usr/bin/env python3

import math
import bisect
import numpy as np

n = int(input().split()[0])
a_list = list(map(int, input().split()))


def C(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


a_list = sorted(a_list)
max_comb = -float("inf")
a_list = sorted(a_list, reverse=True)
ai = a_list[0]
w_list = a_list[1:]
w_list = sorted(w_list)

# 真ん中に一番近い値を取得する
if ai % 2 == 0:
    idx = np.abs(np.asarray(w_list) - ai // 2).argmin()
    aj = w_list[idx]
else:
    t_1 = (ai - 1) // 2
    idx_1 = np.abs(np.asarray(w_list) - t_1).argmin()
    aj_1 = w_list[idx_1]

    t_2 = (ai + 1) // 2
    idx_2 = np.abs(np.asarray(w_list) - t_2).argmin()
    aj_2 = w_list[idx_2]

    if abs(t_1 - aj_1) < abs(t_2 - aj_2):
        aj = aj_1
    else:
        aj = aj_2

ans = "{} {}".format(ai, aj)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = input().split()[0]
a_list = list(map(int, input().split()))

alice_list = []
bob_list = []

for i in range(len(a_list) - 1):
    max_a = max(a_list)
    a_list = a_list.remove(max_a)

    if i % 2 == 0:
        alice_list.append(max_a)
    else:
        bob_list.append(max_a)

answer = sum(alice_list) - sum(bob_list)
print(answer)

Fixed submission:
# https://atcoder.jp/contests/abc088/tasks/abc088_b
n = input().split()[0]
a_list = list(map(int, input().split()))

alice_list = []
bob_list = []
sorted(a_list)

for i in range(len(a_list)):
    max_a = max(a_list)
    a_list.remove(max_a)

    if i % 2 == 0:
        alice_list.append(max_a)
    else:
        bob_list.append(max_a)

answer = sum(alice_list) - sum(bob_list)
print(answer)
Buggy python submission (verdict: Runtime Error):
length_list = []
for _ in range(n):
    x = int(input().split()[0])
    length_list.append(x)

print(len(list(set(length_list))))


Fixed submission:
n = int(input().split()[0])
length_list = []
for _ in range(n):
    x = int(input().split()[0])
    length_list.append(x)

print(len(list(set(length_list))))
Buggy python submission (verdict: Runtime Error):
a, b = list(map(int, input().split()))
s = input()
l = s.split("-")
if len(l) != 2:
  ans = "No"
elif len[0]==a and len[1] == b:
  ans = "Yes"
else:
  ans = "No"
print(ans)


Fixed submission:
a, b = list(map(int, input().split()))
s = input()
l = s.split("-")
if len(l) != 2:
  ans = "No"
elif len(l[0])==a and len(l[1]) == b:
  ans = "Yes"
else:
  ans = "No"
print(ans)
Buggy python submission (verdict: Runtime Error):
r = int(input().split()[0])
g = int(input().split()[0])

next = g * 2 - r
print(next

Fixed submission:
# https://atcoder.jp/contests/abc076/tasks/abc076_a
# A - Rating Goal

r = int(input().split()[0])
g = int(input().split()[0])

next = g * 2 - r
print(next)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

S = input()
N = len(S)
count = 0
is_ok = True

right_index = 0
left_index = N - 1

while right_index != left_index:

    if right_index == left_index:
        break

    if S[right_index] == S[left_index]:
        right_index += 1
        left_index -= 1
        continue
    if S[right_index] == "x":
        count += 1
        right_index += 1
        continue

    if S[left_index] == "x":
        count += 1
        left_index -= 1
        continue

    count = -1
    break

ans = count

print(ans)

Fixed submission:
#!/usr/bin/env python3

S = input()
N = len(S)
count = 0
is_ok = True

right_index = 0
left_index = N - 1

while right_index < left_index:

    if right_index == left_index:
        break

    if S[right_index] == S[left_index]:
        right_index += 1
        left_index -= 1
        continue
    if S[right_index] == "x":
        count += 1
        right_index += 1
        continue

    if S[left_index] == "x":
        count += 1
        left_index -= 1
        continue

    count = -1
    break

ans = count

print(ans)