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

Fixed submission:
import bisect
import heapq
import itertools
import math
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

D, G = list(map(int, sys.stdin.readline().split()))
P, C = list(zip(*[map(int, sys.stdin.readline().split()) for _ in range(D)]))

P = np.array(P, dtype=int)
C = np.array(C, dtype=int)
A = np.arange(1, D + 1, dtype=int) * 100  # 1問のスコア
comp_scores = P * A + C

ans = P.sum()
for i in range(D):
    # i: 途中まで解く
    # comp: True ならその問題は全部解く
    for comp in itertools.product([True, False], repeat=D):
        comp = np.array(comp)
        comp[i] = False
        cnt = P[comp].sum()
        score = comp_scores[comp].sum()
        add_cnt = max(0, min(P[i] - 1, math.ceil((G - score) / A[i])))
        add_score = A[i] * add_cnt
        if score + add_score >= G:
            ans = min(ans, cnt + add_cnt)
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
import os
import sys

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

D, G = list(map(int, sys.stdin.readline().split()))
P, C = list(zip(*[map(int, sys.stdin.readline().split()) for _ in range(D)]))

P = np.array(P, dtype=int)
C = np.array(C, dtype=int)
A = np.arange(1, D + 1, dtype=int) * 100  # 1問のスコア
comp_scores = P * A + C

# ans = P.sum()
# for i in range(D):
#     # i: 途中まで解く
#     # comp: True ならその問題は全部解く
#     for comp in itertools.product([True, False], repeat=D):
#         comp = np.array(comp)
#         comp[i] = False
#         cnt = P[comp].sum()
#         score = comp_scores[comp].sum()
#         add_cnt = max(0, min(P[i] - 1, math.ceil((G - score) / A[i])))
#         add_score = A[i] * add_cnt
#         if score + add_score >= G:
#             ans = min(ans, cnt + add_cnt)
# print(ans)

ans = P.sum()
for i in range(D):
    # i: 途中まで解く
    # True なら全部解く、False なら 1 問も説かない
    patterns = np.array(list(itertools.product([True, False], repeat=D)))
    patterns[:, i] = False
    cnt = np.dot(patterns, P)
    score = np.dot(patterns, comp_scores)
    add_cnt = np.maximum(0, np.minimum(P[i] - 1, np.ceil((G - score) / A[i])))
    add_score = A[i] * add_cnt
    ans = min(ans, ((cnt + add_cnt)[score + add_score >= G]).min())
print(int(ans))
Problem p03304 (python)

Fixed submission:
import itertools
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

N, M, D = list(map(int, sys.stdin.readline().split()))


# 数列の 1 つ目の要素が決まれば数も決まりそう
# 差が D となる数が上にだけある・下にだけある・上にも下にもある・どっちにもない
# 1 <= a <= N-D までは上にある
# D < a <= N までは下にある

def solve(n, m, d):
    arr = list(itertools.product(range(n), repeat=m))
    ans = 0
    for a in arr:
        for i in range(m - 1):
            if abs(a[i] - a[i + 1]) == d:
                ans += 1
    return ans


# 隣り合う要素を 2 つ決めたときに差が D となる組み合わせの数
if D == 0:
    c = N
else:
    c = (N - D) * 2

# # 全部の合計
# # pow(N, M - 2): ある 2 つの要素を決めたときにその位置にそれらを使う数列の数
# s = c * pow(N, M - 2) * (M - 1)
# # 個々の美しさがわからなくても合計がわかれば組み合わせ数で割れば平均になる
# ans = s / pow(N, M)

# ans = c * (M - 1) * pow(N, M - 2) / pow(N, M)
ans = c * (M - 1) / N ** 2
print(ans)

Buggy submission (verdict: Runtime Error):
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

N, M, D = list(map(int, sys.stdin.readline().split()))


# 数列の 1 つ目の要素が決まれば数も決まりそう
# 差が D となる数が上にだけある・下にだけある・上にも下にもある・どっちにもない
# 1 <= a <= N-D までは上にある
# D < a <= N までは下にある

def solve(n, m, d):
    arr = list(itertools.product(range(n), repeat=m))
    ans = 0
    for a in arr:
        for i in range(m - 1):
            if abs(a[i] - a[i + 1]) == d:
                ans += 1
    return ans


# 隣り合う要素を 2 つ決めたときに差が D となる組み合わせの数
if D == 0:
    c = N
else:
    c = (N - D) * 2

# 全部の合計
# pow(N, M - 2): ある 2 つの要素を決めたときにその位置にそれらを使う数列の数
s = c * pow(N, M - 2) * (M - 1)
# 個々の美しさがわからなくても合計がわかれば組み合わせ数で割れば平均になる
ans = s / pow(N, M)
print(ans)
Problem p03305 (python)

Fixed submission:
import heapq
import sys

import numpy as np

sys.setrecursionlimit(10000)
INF = float('inf')


def dijkstra(graph, start):
    """
    :param list of (list of (int, int)) graph:
    :param int start:
    :return:
    """
    dist = [INF for _ in range(len(graph))]
    dist[start] = 0
    heap = []
    heapq.heappush(heap, (0, start))

    while len(heap) > 0:
        w, v = heapq.heappop(heap)
        if w > dist[v]:
            continue
        for u, dw in graph[v]:
            if w + dw < dist[u]:
                dist[u] = w + dw
                heapq.heappush(heap, (w + dw, u))
    return dist


N, M, S, T = list(map(int, input().split()))
graph_yen = [[] for _ in range(N + 1)]
graph_snuuk = [[] for _ in range(N + 1)]
for _ in range(M):
    u, v, a, b = list(map(int, input().split()))
    graph_yen[u].append((v, a))
    graph_yen[v].append((u, a))
    graph_snuuk[u].append((v, b))
    graph_snuuk[v].append((u, b))

# yen_mins[i]: S から i まで行くときの最小金額
yen_mins = np.array(dijkstra(graph_yen, start=S))
# snuke_mins[i]: T から i まで行くときの最小金額
snuke_mins = np.array(dijkstra(graph_snuuk, start=T))

# totals[i]: i で両替して S から T まで行くときの最大金額
totals = 10 ** 15 - (yen_mins + snuke_mins)[1:]
# 後ろから累積最大値とる
for a in np.maximum.accumulate(totals[::-1])[::-1]:
    print(int(a))

Buggy submission (verdict: Runtime Error):
import sys

import numpy as np
from scipy.sparse import coo_matrix
from scipy.sparse.csgraph import dijkstra

sys.setrecursionlimit(10000)
INF = float('inf')

N, M, S, T = list(map(int, input().split()))
U = []
V = []
A = []
B = []
for _ in range(M):
    u, v, a, b = list(map(int, input().split()))
    U.append(u)
    V.append(v)
    A.append(a)
    B.append(b)

graph_yen = coo_matrix((A, (U, V)), shape=(N + 1, N + 1))
graph_snuke = coo_matrix((B, (U, V)), shape=(N + 1, N + 1))

# yen_mins[i]: S から i まで行くときの最小金額
yen_mins = dijkstra(graph_yen, indices=S, directed=False, unweighted=False)
# snuke_mins[i]: T から i まで行くときの最小金額
snuke_mins = dijkstra(graph_snuke, indices=T, directed=False, unweighted=False)

# total_mins[i]: i で両替して S から T まで行くときの最小金額
total_mins = 10 ** 15 - (yen_mins + snuke_mins)[1:]

# 後ろから累積最大値とる
for a in np.maximum.accumulate(total_mins[::-1])[::-1]:
    print(int(a))
Problem p03353 (python)

Fixed submission:
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

S = sys.stdin.readline().rstrip()
K = int(sys.stdin.readline())

s = set()
for k in range(1, K + 1):
    for i in range(len(S)):
        s.add(S[i:i + k])

s = list(sorted(list(s)))
print(s[K - 1])

Buggy submission (verdict: Runtime Error):
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

S = sys.stdin.readline().rstrip()
K = int(sys.stdin.readline())


def prune(it):
    hist = set()
    ret = []
    for s, l in it:
        if s not in hist:
            hist.add(s)
        if len(hist) > K:
            break
        ret.append((s, l))
    return ret


collections = prune(sorted([(c, L) for L, c in enumerate(S)]))
for size in range(1, len(S)):
    threshold, _ = collections[-1]
    for s, left in collections:
        r = left + size + 1
        if len(s) == size and r <= len(S):
            t = S[left:r]
            if t <= threshold:
                collections.append((t, left))
    collections = prune(sorted(collections))

strings = list(set([s for s, _ in collections]))
strings.sort()
print(strings[K - 1])

Buggy submission (verdict: Runtime Error):
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

S = sys.stdin.readline().rstrip()
K = int(sys.stdin.readline())


def prune(it):
    print(list(it))
    hist = set()
    ret = []
    for s, l in it:
        if s not in hist:
            hist.add(s)
        if len(hist) > K:
            break
        ret.append((s, l))
    return ret


collections = prune(sorted([(c, L) for L, c in enumerate(S)]))
for size in range(1, len(S)):
    threshold, _ = collections[-1]
    for s, left in collections:
        r = left + size + 1
        if len(s) == size and r <= len(S):
            t = S[left:r]
            if t <= threshold:
                collections.append((t, left))
    collections = prune(sorted(collections))

strings = list(set([s for s, _ in collections]))
strings.sort()
print(strings[K - 1])
Problem p03385 (python)

Fixed submission:
import functools

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


def inl():
    return list(map(int, input().split()))


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper


s = list(input())
s.sort()
if s == list('abc'):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import functools

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


def inl():
    return list(map(int, input().split()))


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper


s = list(input())
if list(s.sort()) == ['a','b','c']:
    print('Yes')
else:
    print('No')
Problem p03386 (python)

Fixed submission:
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

# N, M, X = list(map(int, sys.stdin.readline().split()))
# A = np.array(list(map(int, sys.stdin.readline().split())))
#
# print(min(len(A[A > X]), len(A[A<X])))

A, B, K = list(map(int, sys.stdin.readline().split()))

a = list(range(A, min(B, A + K)))
b = list(range(max(A, B - K + 1), B + 1))



print('\n'.join(map(str, list(sorted(set(a + b))))))

Buggy submission (verdict: Runtime Error):
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

A, B, K = list(map(int, sys.stdin.readline().split()))

arr = list(range(A, B + 1))
a = list(range(A, min(B, A + K)))
b = list(range(max(A, B - K + 1), B + 1))



print('\n'.join(map(str, list(sorted(set(a + b))))))

Buggy submission (verdict: Runtime Error):
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

# N, M, X = list(map(int, sys.stdin.readline().split()))
# A = np.array(list(map(int, sys.stdin.readline().split())))
#
# print(min(len(A[A > X]), len(A[A<X])))

A, B, K = list(map(int, sys.stdin.readline().split()))

arr = list(range(A, B + 1))

print('\n'.join(map(str, list(sorted(set(arr[:K] + arr[-K:]))))))
Problem p03412 (python)

Fixed submission:
import bisect
import functools
import os
import sys

sys.setrecursionlimit(10000)
INF = float('inf')

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


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        ret = fn(*args, **kwargs)
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        print(ret)
        return ret

    return wrapper


@debug
def calc_bit(k):
    """
    答えの下から k ビット目を返す
    :param int k:
    :return:
    """
    # 答えの k ビット目が偶数なら 0、奇数なら 1

    # これ以上の桁は不要
    mod = 1 << (k + 1)
    amod = [a & (mod - 1) for a in A]
    bmod = [b & (mod - 1) for b in B]
    amod.sort()
    bmod.sort()
    ret = 0

    # bmod + amod のうち k ビット目が 1 となる数
    # => (1 << k) 以上 (2 << k) 未満または (3 << k) 以上 (4 << k) 未満
    # しゃくとる
    b01 = bisect.bisect_left(bmod, (1 << k) - amod[0])
    b10 = bisect.bisect_left(bmod, (2 << k) - amod[0])
    b11 = bisect.bisect_left(bmod, (3 << k) - amod[0])
    for a in range(len(amod)):
        while b01 - 1 >= 0 and bmod[b01 - 1] >= (1 << k) - amod[a]:
            b01 -= 1
        while b10 - 1 >= 0 and bmod[b10 - 1] >= (2 << k) - amod[a]:
            b10 -= 1
        while b11 - 1 >= 0 and bmod[b11 - 1] >= (3 << k) - amod[a]:
            b11 -= 1
        # (1 << k) 以上 (2 << k) 未満
        ret += b10 - b01
        # (3 << k) 以上 (4 << k) 未満
        ret += len(bmod) - b11

    return ret % 2


ans = 0
for i in range(30):
    ans += calc_bit(i) * (2 ** i)
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
from operator import xor

import numpy as np
import re
import sys

sys.setrecursionlimit(10000)
INF = float('inf')

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
print(reduce(xor, np.add.outer(A, B).flat))
Problem p03415 (python)

Fixed submission:
import functools

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


def inl():
    return list(map(int, input().split()))


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper


a = inps()
b = inps()
c = inps()
print(a[0] + b[1] + c[2])

Buggy submission (verdict: Runtime Error):
import functools

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


def inl():
    return list(map(int, input().split()))


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper


a = inls()
b = inls()
c = inls()
print(a[0] + b[1] + c[2])
Problem p03457 (python)

Fixed submission:
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

N = int(sys.stdin.readline())
T, X, Y = list(zip(*[map(int, sys.stdin.readline().split()) for _ in range(N)]))

t, x, y = 0, 0, 0
ok = True
for i in range(N):
    dt = T[i] - t
    d = abs(x - X[i]) + abs(y - Y[i])
    if not (dt >= d and (dt - d) % 2 == 0):
        ok = False
    t = T[i]
    x = X[i]
    y = Y[i]
if ok:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
/// ローカル環境なら _in.txt から入力を受ける
fn read_input() -> String {
    use std::fs::File;
    use std::io::Read;
    let mut s = String::new();
    match option_env!("LOCAL") {
        Some(_) => File::open("src/_in.txt")
            .expect("File not found")
            .read_to_string(&mut s)
            .unwrap(),
        None => std::io::stdin().read_to_string(&mut s).unwrap(),
    };
    s
}

fn main() {
    let s = read_input();
    let mut ws = s.split_whitespace();
    let in_n: i32 = ws.next().unwrap().parse().unwrap();
    let mut txy: Vec<(i32, i32, i32)> = (0..in_n)
        .map(|_| {
            let t: i32 = ws.next().unwrap().parse().unwrap();
            let x: i32 = ws.next().unwrap().parse().unwrap();
            let y: i32 = ws.next().unwrap().parse().unwrap();
            (t, x, y)
        })
        .collect();
    txy.insert(0, (0, 0, 0));

    let mut ok = true;
    for window in txy.windows(2) {
        let ((t1, x1, y1), (t2, x2, y2)) = (window[0], window[1]);
        let dt = t2 - t1;
        let d = (x1 - x2).abs() + (y1 - y2).abs();
        ok &= dt >= d && (dt - d) % 2 == 0
    }
    println!("{}", if ok { "Yes" } else { "No" });
}
Problem p03490 (python)

Fixed submission:
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

S = sys.stdin.buffer.readline().decode().rstrip()
X, Y = list(map(int, sys.stdin.buffer.readline().split()))

# X 軸と Y 軸は独立に考えられる。
d = 0
cnt = 0
xy = [[], []]
for c in S:
    if c == 'F':
        cnt += 1
    else:
        xy[d].append(cnt)
        cnt = 0
        d = d + 1 & 1
xy[d].append(cnt)
X -= xy[0].pop(0)


def can_make(moves, obj):
    if obj < -8000:
        return False
    obj = 1 << (8000 + obj)
    dp = 1 << 8000
    for mv in moves:
        if mv == 0:
            continue
        dp = (dp << mv) | (dp >> mv)
    return (dp & obj) > 0


ok = can_make(xy[0], X) and can_make(xy[1], Y)
if ok:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

S = sys.stdin.buffer.readline().decode().rstrip()
X, Y = list(map(int, sys.stdin.buffer.readline().split()))

# X 軸と Y 軸は独立に考えられる。
d = 0
cnt = 0
xy = [[], []]
for c in S:
    if c == 'F':
        cnt += 1
    else:
        xy[d].append(cnt)
        cnt = 0
        d = d + 1 & 1
xy[d].append(cnt)
X -= xy[0].pop(0)


def can_make(moves, obj):
    obj = 1 << (8000 + obj)
    dp = 1 << 8000
    for mv in moves:
        if mv == 0:
            continue
        dp = (dp << mv) | (dp >> mv)
    return (dp & obj) > 0


ok = can_make(xy[0], X) and can_make(xy[1], Y)
if ok:
    print('Yes')
else:
    print('No')
Problem p03546 (python)

Fixed submission:
import sys

import numpy as np
from scipy.sparse.csgraph import dijkstra

sys.setrecursionlimit(10000)
INF = float('inf')

H, W = list(map(int, input().split()))
C = np.array([list(map(int, input().split())) for _ in range(10)], dtype=int)
A = np.array([list(map(int, input().split())) for _ in range(H)], dtype=int)

mp = dijkstra(C, directed=True)[:, 1]
ans = 0
for n in range(10):
    ans += mp[n] * np.sum(A == n)
print(int(round(ans)))

Buggy submission (verdict: Runtime Error):
import sys

import numpy as np
from scipy.sparse.csgraph import dijkstra

sys.setrecursionlimit(10000)
INF = float('inf')

H, W = list(map(int, input().split()))
C = np.array([list(map(int, input().split())) for _ in range(10)], dtype=int)
A = np.array([list(map(int, input().split())) for _ in range(H)], dtype=int)
A[A == -1] = 1

mp = dijkstra(C, directed=True)[:, 1]
nums, counts = np.unique(A, return_counts=True)
print(int((mp[nums] * counts).sum()))
Problem p03551 (python)

Fixed submission:
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

N, M = list(map(int, sys.stdin.readline().split()))

# 1 回の時間は M*1900 + (N-M)*100
time = M * 1900 + (N - M) * 100
# AC になる確率
p_ac = 1 / 2 ** M

print(int(1 / p_ac * time))

Buggy submission (verdict: Runtime Error):
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

N, M = list(map(int, sys.stdin.readline().split()))

N, M = list(map(int, sys.stdin.readline().split()))
# 1 回の時間は M*1900 + (N-M)*100
time = M * 1900 + (N - M) * 100
# AC になる確率
p_ac = 1 / 2 ** M

print(int(1 / p_ac * time))
Problem p03612 (python)

Fixed submission:
import sys

sys.setrecursionlimit(10000)
INF = float('inf')

N = int(sys.stdin.readline())
P = list(map(int, sys.stdin.readline().split()))
P.insert(0, -1)

ans = 0
for i in range(len(P)):
    if i == P[i]:
        if i + 1 < len(P):
            P[i], P[i + 1] = P[i + 1], P[i]
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import bisect
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

sys.setrecursionlimit(10000)
INF = float('inf')

N = int(sys.stdin.readline())
P = list(map(int, sys.stdin.readline().split()))
P.insert(0, -1)

ans = 0
for i in range(len(P)):
    if i == P[i]:
        if i + 1 < len(P):
            P[i], P[i + 1] = P[i + 1], P[i]
        ans += 1
print(ans)