Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def compute_score(p, c, solved):
    score = 0
    for i, (p_i, c_i, s_i) in enumerate(zip(p, c, solved)):
        score += (i + 1) * 100 * s_i
        if p_i == s_i:
            score += c_i

    return score


if __name__ == '__main__':
    d, g = map(int, input().split())
    p = []
    c = []
    for _ in range(d):
        p_i, c_i = map(int, input().split())
        p.append(p_i)
        c.append(c_i)

    # d = 2
    # g = 700
    # p = [3, 5]
    # c = [500, 800]

    # d = 5
    # g = 25000
    # p = [20, 40, 50, 30, 1]
    # c = [1000, 1000, 1000, 1000, 1000]

    solved = tuple([0 for _ in range(d)])
    scores = dict()
    scores[solved] = 0

    min_n_solved = 10 * 100
    next_solved_set = {solved}
    while True:
        solved = next_solved_set.pop()

        for i in range(d):
            # complete i-th problems
            if solved[i] == p[i]:
                continue

            next_solved = list(solved)
            next_solved[i] += 1
            next_solved = tuple(next_solved)

            if next_solved in scores:
                continue

            next_score = compute_score(p, c, next_solved)
            if g <= next_score:
                min_n_solved = min(min_n_solved, sum(next_solved))
                continue

            scores[next_solved] = next_score
            next_solved_set.add(next_solved)

        if len(next_solved_set) == 0:
            break

    print(min_n_solved)


Fixed submission:
if __name__ == '__main__':
    d, g = map(int, input().split())
    p = []
    c = []
    for _ in range(d):
        p_i, c_i = map(int, input().split())
        p.append(p_i)
        c.append(c_i)

    # d = 2
    # g = 700
    # p = [3, 5]
    # c = [500, 800]

    # d = 5
    # g = 25000
    # p = [20, 40, 50, 30, 1]
    # c = [1000, 1000, 1000, 1000, 1000]

    ans = 10 * 100
    for bit in range(1 << d):
        sum_score = 0
        n_solved = 0
        # 1つも全完しないケースもこのfor文に含まれる
        for i in range(d):
            if bit & (1 << i) != 0:
                sum_score += c[i] + 100 * p[i] * (i + 1)
                n_solved += p[i]

        if g <= sum_score:
            ans = min(ans, n_solved)
            continue

        for i in range(d - 1, -1, -1):
            # already solved
            if bit & (1 << i) != 0:
                continue

            for j in range(p[i]):
                if g <= sum_score:
                    break
                sum_score += 100 * (i + 1)
                n_solved += 1

        ans = min(ans, n_solved)

    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))

    # A = [885, 8, 1, 128, 83, 32, 256, 206, 639, 16, 4, 128, 689, 32, 8, 64, 885, 969, 1]
    # N = len(A)

    n_satisfied = N
    for l in range(N):
        prev_sum_lr = A[l]
        prev_xor_lr = A[l]
        for r in range(l + 1, N):
            # print(A[l: r + 1])
            sum_lr = prev_sum_lr + A[r]
            xor_lr = prev_xor_lr ^ A[r]

            prev_sum_lr = sum_lr
            prev_xor_lr = xor_lr

            if sum_lr != xor_lr:
                break

            # print("OK: ", A[l: r + 1])
            n_satisfied += 1

    print(n_satisfied)


Fixed submission:
if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))

    # A = [885, 8, 1, 128, 83, 32, 256, 206, 639, 16, 4, 128, 689, 32, 8, 64, 885, 969, 1]
    # N = len(A)

    n_satisfied = 0
    sum_lr = 0
    xor_lr = 0
    l, length = 0, 0

    while True:
        while l + length != N and \
                sum_lr + A[l + length] == xor_lr ^ A[l + length]:
            sum_lr += A[l + length]
            xor_lr ^= A[l + length]
            length += 1

        # print("l, length", l, length)
        n_satisfied += length

        if l == N:
            break

        sum_lr -= A[l]
        xor_lr -= A[l]
        l += 1
        length -= 1

    print(n_satisfied)

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
from operator import xor

if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))

    # A = [2, 5, 4, 6]
    # N = len(A)

    n_satisfied = N
    for l in range(N):
        for r in range(l + 1, N):
            # print(A[l: r + 1])
            sum_lr = reduce(lambda a, b: a + b, A[l:r + 1])
            xor_lr = reduce(xor, A[l:r + 1])
            if sum_lr == xor_lr:
                n_satisfied += 1

    print(n_satisfied)


Fixed submission:
if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))

    # A = [885, 8, 1, 128, 83, 32, 256, 206, 639, 16, 4, 128, 689, 32, 8, 64, 885, 969, 1]
    # N = len(A)

    n_satisfied = 0
    sum_lr = 0
    xor_lr = 0
    l, length = 0, 0

    while True:
        while l + length != N and \
                sum_lr + A[l + length] == xor_lr ^ A[l + length]:
            sum_lr += A[l + length]
            xor_lr ^= A[l + length]
            length += 1

        # print("l, length", l, length)
        n_satisfied += length

        if l == N:
            break

        sum_lr -= A[l]
        xor_lr -= A[l]
        l += 1
        length -= 1

    print(n_satisfied)
Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    s = input()
    K = int(input())
    # # s = 'aba'
    # s = 'atcoderandatcodeer'
    # K = 5

    candidates = set()
    for start in range(0, len(s)):
        for end in range(start + 1, len(s) + 1):
            candidates |= {s[start:end]}

    candidates = sorted(candidates)
    # print(candidates)
    print(candidates[K - 1])

    #
    # length_to_candidates = defaultdict(list)
    # for length in range(1, len(s) + 1):
    #     for start in range(0, len(s) + 1 - length):
    #         sub = s[start:start + length]
    #         if sub not in length_to_candidates[length]:
    #             length_to_candidates[length].append(sub)
    #         # length_to_candidates |= {s[start:start + length]}
    #
    # all_candidates = []
    # for v in length_to_candidates.values():
    #     all_candidates += list(v)
    #
    # print(all_candidates)
    # print(all_candidates[K - 1])

    # print(length_to_candidates)


Fixed submission:
if __name__ == '__main__':
    s = input()
    K = int(input())
    # s = 'aba'
    # s = 'atcoderandatcodeer'
    # K = 5

    candidates = set()
    for start in range(0, len(s)):
        for length in range(1, K + 1):
            candidates |= {s[start:start + length]}

    candidates = sorted(candidates)
    print(candidates[K - 1])
Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    A, B, K = map(int, input().split())

    candidates = {v for v in range(A, B + 1)}

    satisfied_integers = set()
    for i in range(K):
        satisfied_integers |= {A + i}

    for i in range(K):
        satisfied_integers |= {B - K + 1 + i}
        
    satisfied_integers = sorted(candidates & satisfied_integers)
    for v in satisfied_integers:
        print(v)


Fixed submission:
if __name__ == '__main__':
    A, B, K = map(int, input().split())

    satisfied_integers = set()
    for i in range(K):
        if A + i <= B:
            satisfied_integers |= {A + i}
            
        if A <= B - K + 1 + i:
            satisfied_integers |= {B - K + 1 + i}

    satisfied_integers = sorted(satisfied_integers)
    for v in satisfied_integers:
        print(v)
Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))

    A.insert(0, 0)

    d_map = dict()
    d_map[(0,)] = 0

    for i in range(1, N + 1):
        prev_path = (0,)
        for j in range(1, N + 1):
            if i == j:
                continue

            path = prev_path + (j,)
            d_map[path] = d_map[prev_path] + abs(A[j] - A[prev_path[-1]])
            prev_path = path

        path = prev_path + (0,)
        d_map[path] = d_map[prev_path] + abs(A[0] - A[prev_path[-1]])
        print(d_map[path])


Fixed submission:
if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))

    # N = 6
    # A = [-679, -2409, -3258, 3095, -3291, -4462]

    # N = 3
    # A = [3, 5, -1]

    # 始点を追加
    A = [0] + A
    A = A + [0]
    cum_map = dict()

    # for i in range(1, N + 1):
    #     cum_map[(i - 1, i)] = abs(A[i] - A[i - 1])

    cum_map[(0, 0)] = 0
    for k in range(1, N + 1):
        cum_map[(0, k)] = cum_map[(0, k - 1)] + abs(A[k] - A[k - 1])

    for i in range(1, N + 1):
        if i == 1:
            d = abs(A[i + 1] - A[0]) + cum_map[(0, N)] - cum_map[
                (0, i + 1)] + abs(A[N] - A[0])
        elif i == N:
            d = abs(A[N - 1] - A[0]) + cum_map[(0, N - 1)]
        else:
            d = cum_map[(0, i - 1)] + abs(A[N] - A[0]) \
                + abs(A[i + 1] - A[i - 1]) \
                + (cum_map[(0, N)] - cum_map[(0, i + 1)])
        # print("i:", d)
        print(d)

    # print(cum_map)
Buggy python submission (verdict: Runtime Error):
def dfs(start, edges, n_nodes):
    node_values = [0 for _ in range(n_nodes)]
    not_visited = set(range(n_nodes))

    # start node
    not_visited.remove(start)

    # not connected nodes
    not_connected_nodes = set([node for node, connected in edges.items()
                               if len(connected) == 0])
    not_visited -= not_connected_nodes

    if start in not_connected_nodes:
        return True

    next_node_candidates = {start}
    while not_visited:
        curr_node = next_node_candidates.pop()

        connected_nodes = edges[curr_node].keys()
        for c in connected_nodes:
            if c in not_visited:
                next_node_candidates |= {c}
                not_visited.remove(c)
                node_values[c] = node_values[curr_node] + edges[curr_node][c]

    # validate edges
    for e1, e2_and_d in edges.items():
        for e2, d in e2_and_d.items():
            if edges[e1][e2] != node_values[e2] - node_values[e1]:
                return False

    # all edges are valid: return True
    return True


if __name__ == '__main__':
    N, M = map(int, input().split())
    if M == 0:
        print("Yes")
        exit(0)

    Ls, Rs, Ds = zip(*[list(map(int, input().split())) for _ in range(M)])

    # N, M = 10, 3
    # Ls, Rs, Ds = zip(*[[8, 7, 100],
    #                    [7, 9, 100],
    #                    [9, 8, 100]])

    edges = {i: dict() for i in range(N)}
    # visited = [None] * N
    for L, R, D in zip(Ls, Rs, Ds):
        edges[L - 1][R - 1] = D
        edges[R - 1][L - 1] = -D

    for start in range(N):
        is_valid = dfs(start, edges, N)
        if not is_valid:
            print("No")
            exit(0)

    print("Yes")


Fixed submission:
import sys

sys.setrecursionlimit(200002)


def dfs(start, edges, nodes):
    for adj_node, distance in edges[start].items():
        # まだ訪れていない隣接ノード
        if nodes[adj_node] is None:
            nodes[adj_node] = nodes[start] + distance
            # adj_nodeを開始位置にしてまだ訪れていないノードを探索する
            # 探索中にノード値とエッジの関係性が一致しなくなればFalse
            if not dfs(adj_node, edges, nodes):
                return False
        # 既に訪れた隣接ノード
        else:
            if nodes[adj_node] - nodes[start] != distance:
                return False

    return True


if __name__ == '__main__':
    N, M = map(int, input().split())
    if M == 0:
        print("Yes")
        exit(0)

    Ls, Rs, Ds = zip(*[list(map(int, input().split())) for _ in range(M)])

    # N, M = 10, 3
    # Ls, Rs, Ds = zip(*[[8, 7, 100],
    #                    [7, 9, 100],
    #                    [9, 8, 100]])

    edges = {i: dict() for i in range(N)}

    for L, R, D in zip(Ls, Rs, Ds):
        edges[L - 1][R - 1] = D
        edges[R - 1][L - 1] = -D

    nodes = [None] * N

    valid_list = []
    for start in range(N):
        if nodes[start] is None:
            nodes[start] = 0
            # ノード値とエッジの関係性が一致しなくなればfalse
            valid_list.append(dfs(start, edges, nodes))

    if all(valid_list):
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
print(sum(list(int(input()))))

Fixed submission:
print(sum([int(i) for i in list(input())]))

Buggy python submission (verdict: Runtime Error):
print(sum(list(input())))

Fixed submission:
print(sum([int(i) for i in list(input())]))
Buggy python submission (verdict: Runtime Error):
i = int(input())
l = [int(n) for n in input().split(' ')]

t = 0
bool = True
while bool:
    t += 1
    for j in l:
        if j % 2 == 1:
            bool = False
            break
        else:
            l /= 2
print(t-1)

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

t = 0
bool = True
while bool:
    t += 1
    for j in range(len(l)):
        if l[j] % 2 == 1:
            bool = False
            break
        else:
            l[j] /= 2
print(t-1)

Buggy python submission (verdict: Runtime Error):
i = int(input())
l = [int(i) for i in list(input())]

j = 0
t = 0
while True:
  k = l[j] % 2
  if k == 1:
    break
  else:
    l[j] /= 2
    
  j = j + 1 % i
  if j == 0:
    t += 1
print(t)

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

t = 0
bool = True
while bool:
    t += 1
    for j in range(len(l)):
        if l[j] % 2 == 1:
            bool = False
            break
        else:
            l[j] /= 2
print(t-1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N == 1:
    print('Hello World')
else:
    a, b = map(int, input().split())
    print(a + b)


Fixed submission:
N = int(input())
if N == 1:
    print('Hello World')
else:
    a = int(input())
    b = int(input())
    print(a + b)
Buggy python submission (verdict: Runtime Error):
N, T = map(int, input().split())
a = 9999
for _ in N:
    c, t = map(int, input().split())
    if t <= T:
        a = min(a, c)
if a == 9999:
    print('TLE')
else:
    print(a)


Fixed submission:
N, T = map(int, input().split())
a = 9999
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T:
        a = min(a, c)
if a == 9999:
    print('TLE')
else:
    print(a)
Buggy python submission (verdict: Runtime Error):
# nの約数を求める
def divisor(n):
    d = []
    for i in range(int(n**(0.5)+1)):
        if n % i == 0:
            d.append(i)
            if i * i != n:
                d.append(n / i)
    return d


N, M = map(int, input().split())
# d はnの約数のベクター
d = divisor(M)
g = M / N
d = [x for x in d if x <= g]
print(max(d))


Fixed submission:
# nの約数を求める
def divisor(n):
    d = []
    for i in range(int(n**(0.5)+1))[1:]:
        if n % i == 0:
            d.append(i)
            if i * i != n:
                d.append(int(n / i))
    return d


N, M = map(int, input().split())
# d はnの約数のベクター
d = divisor(M)
g = int(M / N)
d = [x for x in d if x <= g]
print(max(d))

Buggy python submission (verdict: Runtime Error):
N = int(input())
if N == 1:
    print('Hello World')
else:
    a, b = map(int, input().split())
    print(a + b)


Fixed submission:
# nの約数を求める
def divisor(n):
    d = []
    for i in range(int(n**(0.5)+1))[1:]:
        if n % i == 0:
            d.append(i)
            if i * i != n:
                d.append(int(n / i))
    return d


N, M = map(int, input().split())
# d はnの約数のベクター
d = divisor(M)
g = int(M / N)
d = [x for x in d if x <= g]
print(max(d))
Buggy python submission (verdict: Time Limit Exceeded):
import queue
import sys
input = sys.stdin.readline


def toab(s, ab, node):
    toa, tob = False, False
    for k in ab:
        if k not in node:
            continue
        if s[k - 1] is 'A':
            toa = True
            if tob:
                return True
        elif s[k - 1] is 'B':
            tob = True
            if toa:
                return True
    return False


ab = {}
node = {}
N, M = map(int, input().split())
s = input()
for i in range(M):
    a, b = map(int, input().split())
    if a not in ab:
        ab[a] = {}
    ab[a][b] = True
    if b not in ab:
        ab[b] = {}
    ab[b][a] = True
    node[a] = True
    node[b] = True

for i in range(N + 1):
    if i not in node:
        continue
    q = queue.Queue()
    q.put(i)
    while not q.empty():
        j = q.get()
        if j in node and not toab(s, ab[j], node):
            node.pop(j)
            for k in ab[j]:
                if k in node:
                    q.put(k)

if len(node) == 0:
    print('No')
else:
    print('Yes')


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


def toab(s, ab, node):
    toa, tob = False, False
    for k in ab:
        if k not in node:
            continue
        if s[k - 1] == 'A':
            toa = True
            if tob:
                return True
        elif s[k - 1] == 'B':
            tob = True
            if toa:
                return True
    return False


ab = {}
node = {}
N, M = map(int, input().split())
s = input()
for i in range(M):
    a, b = map(int, input().split())
    if a not in ab:
        ab[a] = {}
    ab[a][b] = True
    if b not in ab:
        ab[b] = {}
    ab[b][a] = True
    node[a] = True
    node[b] = True

for i in range(N + 1):
    if i not in node:
        continue
    q = queue.Queue()
    q.put(i)
    while not q.empty():
        j = q.get()
        if j in node and not toab(s, ab[j], node):
            node.pop(j)
            for k in ab[j]:
                if k in node:
                    q.put(k)

if not node:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
# math.gcd()を使う
import math
N, X = map(int, input().split())
# 一行の入力をリストxに入れる
x = list(map(int, input().split()))
# すべての(x[i]-X)の最大公約数が答え
# 最初の最大公約数
t = x[0] - X
for a in x:
    # 最大公約数を更新
    t = math.gcd(t, a - X)
print(t)


Fixed submission:
A, B = map(int, input().split())
if A % 2 is 0 or B % 2 is 0:
    print('No')
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
# math.gcd()を使う
import math
N, X = map(int, input().split())
# 一行の入力をリストxに入れる
x = list(map(int, input().split()))
# すべての(x[i]-X)の最大公約数が答え
# 最初の最大公約数
t = x[0] - X
for a in x:
    # 最大公約数を更新
    t = math.gcd(t, abs(a - X))
print(t)


Fixed submission:
A, B = map(int, input().split())
if A % 2 is 0 or B % 2 is 0:
    print('No')
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
# math.gcd()を使う
import math
N, X = map(int, input().split())
# 一行の入力をリストxに入れる
x = list(map(int, input().split()))
# すべての(x[i]-X)の最大公約数が答え
# 最初の最大公約数
t = abs(x[0] - X)
for a in x:
    # 最大公約数を更新
    t = math.gcd(t, a - X)
print(t)


Fixed submission:
A, B = map(int, input().split())
if A % 2 is 0 or B % 2 is 0:
    print('No')
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
#include <iostream>
#include <vector>
#include <utility>
#include <numeric>
#include <functional>
#include <stdio.h>
#include <math.h>
#include <string>
#include <algorithm>
#include <deque>
#include <queue>
#include <map>

#define rep(i, m, n) for (int (i)(m); (i)<(n); ++(i))
#define repr(i, m, n) for (int (i)(m - 1); (i)>=(n); --(i))
#define repv(i, v) for (unsigned (i)(0); (i)<(v.size()); ++(i))
#define all(v) (v).begin(), (v).end()
#define sortv(v) sort(all(v))
#define sortgi(v) sort(all(v), greater<int>())
#define sortgd(v) sort(all(v), greater<double>())
#define sortgll(v) sort(all(v), greater<ll>())
#define debug(x) cerr << #x << ": " << x << '\n'

using namespace std;
using pii = pair<int, int>;
using pss = pair<string, string>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vd = vector<double>;
using vvd = vector<vd>;
using vs = vector<string>;
using ll = long long;
using pllll = pair<ll, ll>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using vpii = vector<pii>;
using pqi = priority_queue<int>;
using pqd = priority_queue<double>;
using pqll = priority_queue<ll>;
using pqvi = priority_queue<vi>;
using pqvll = priority_queue<vll>;

int main() {
	int a, b;
	cin >> a >> b;
	if (a % 2 == 0 || b % 2 == 0) {
		cout << "No" << endl;
	}
	else {
		cout << "Yes" << endl;
	}
}


Fixed submission:
A, B = map(int, input().split())
if A % 2 is 0 or B % 2 is 0:
    print('No')
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
#include <iostream>
#include <vector>
#include <utility>
#include <numeric>
#include <functional>
#include <stdio.h>
#include <math.h>
#include <string>
#include <algorithm>
#include <deque>
#include <queue>
#include <map>

#define rep(i, m, n) for (int (i)(m); (i)<(n); ++(i))
#define repr(i, m, n) for (int (i)(m - 1); (i)>=(n); --(i))
#define repv(i, v) for (unsigned (i)(0); (i)<(v.size()); ++(i))
#define all(v) (v).begin(), (v).end()
#define sortv(v) sort(all(v))
#define sortgi(v) sort(all(v), greater<int>())
#define sortgd(v) sort(all(v), greater<double>())
#define sortgll(v) sort(all(v), greater<ll>())
#define debug(x) cerr << #x << ": " << x << '\n'

using namespace std;
using pii = pair<int, int>;
using pss = pair<string, string>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vd = vector<double>;
using vvd = vector<vd>;
using vs = vector<string>;
using ll = long long;
using pllll = pair<ll, ll>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using vpii = vector<pii>;
using pqi = priority_queue<int>;
using pqd = priority_queue<double>;
using pqll = priority_queue<ll>;
using pqvi = priority_queue<vi>;
using pqvll = priority_queue<vll>;

int main() {
	int n;
	cin >> n;
	vs w;
	rep(i, 0, n) {
		string s;
		cin >> s;
		w.push_back(s);
	}
	string s0(w[0]);
	repv(i, w) {
		repv(j, w) {
			if (w[i] == w[j] && i != j) {
				cout << "No" << endl;
				return 0;
			}
		}
	}
	rep(i, 1, n) {
		string s1 = w[i];
		if (s0[s0.size() - 1] != s1[0]) {
			cout << "No" << endl;
			return 0;
		}
		s0 = s1;
	}
	cout << "Yes" << endl;
}


Fixed submission:
import sys
N = int(input())
s = []
for i in range(N):
    s.append(input())
for i, s0 in enumerate(s):
    for j, s1 in enumerate(s):
        if i != j and s0 == s1:
            print('No')
            sys.exit()
s0 = s[0]
for i in range(1, len(s)):
    s1 = s[i]
    if s0[-1] != s1[0]:
        print('No')
        sys.exit()
    s0 = s1
print('Yes')
Buggy python submission (verdict: Runtime Error):
import math
sousuu = int(input())
listnum = list(map(int, input().split()))
posinum = sousuu // 2 if sousuu % 2 == 0 else sousuu // 2 + 1
posival = sum(listnum) // len(listnum)
dst = math.inf
for p in range(posinum - 3, posinum + 3):
    _dst = 0
    for i, s in enumerate(range(p - sousuu//2, p - sousuu//2 + sousuu)):
        _dst += abs(listnum[i] - s)
    if dst > _dst:
        dst = _dst
print(dst)


Fixed submission:
sousuu = int(input())
listnum = list(map(int, input().split()))
_list = []
for i in range(sousuu):
    _list.append(listnum[i] - (1 + i))
num = sorted(_list)[sousuu//2]
dst = 0
for i in range(sousuu):
    dst += abs(listnum[i] - (i+1+num))
print(dst)
Buggy python submission (verdict: Runtime Error):
n, x = map(int, input().split())
don = [int(stdin[i]) for i in range(n)]
dst = (x - sum(don)) // min(don) + n
print(dst)


Fixed submission:
n, x = map(int, input().split())
don = [int(input()) for i in range(n)]
dst = (x - sum(don)) // min(don) + n
print(dst)
Buggy python submission (verdict: Time Limit Exceeded):
suuji = int(input())
cntmax = 0
dst = 1
for i in range(suuji):
    suu = i
    cnt = 0
    while suu % 2 == 0:
        suu /= 2
        cnt += 1
    if cntmax < cnt:
        cntmax = cnt
        dst = i
print(dst)

Fixed submission:
suuji = int(input())
srclist = [1, 2, 4, 8, 16, 32, 64, 128]
dst = 0
for i in range(len(srclist)):
    if srclist[i] > suuji:
        break
print(srclist[i-1])