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

Fixed submission:
import itertools
import sys

input = sys.stdin.readline

n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = 0
a_cum = [0] + list(itertools.accumulate(a))
b_cum = [0] + list(itertools.accumulate(b))

y = m  # len(b_cum) - 1
for x in range(len(a_cum)):
    if a_cum[x] > k:
        break
    while b_cum[y] > k - a_cum[x]:
        y -= 1
    ans = max(ans, x + y)

print(ans)

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

input = sys.stdin.readline

n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = 0
a_cum = [0] + list(itertools.accumulate(a))
b_cum = [0] + list(itertools.accumulate(b))

y = m
for x in range(len(a_cum)):
    if a_cum[x] > k:
        break
    while b[y] > k - a[x]:
        y -= 1
    ans = max(ans, x + y)

print(ans)

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

input = sys.stdin.readline

n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = 0
a_cum = [0] + list(itertools.accumulate(a))
b_cum = [0] + list(itertools.accumulate(b))

y = m
for x in range(len(a_cum) + 1):
    if a_cum[x] > k:
        break
    while b[y] > k - a[x]:
        y -= 1
    ans = max(ans, x + y)

print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque

n, m, k = map(int, input().split())
a = deque(map(int, input().split()))
b = deque(map(int, input().split()))

ans = 0
minutes = 0
while True:
    if len(a) == 0 and len(b) == 0:
        break
    elif len(a) > 0 and len(b) > 0:
        if a[0] == b[0]:
            if ans + a[0] <= k:
                if a[1] >= b[1]:
                    minutes += 1
                    ans += b.popleft()
                else:
                    minutes += 1
                    ans += a.popleft()
            else:
                break
        elif a[0] > b[0]:
            if ans + b[0] <= k:
                minutes += 1
                ans += b.popleft()
            else:
                break
        else:
            if ans + a[0] <= k:
                minutes += 1
                ans += a.popleft()
            else:
                break

    elif len(b) == 0 and (a[0] + ans) <= k:
        minutes += 1
        ans += a.popleft()
    elif len(a) == 0 and (b[0] + ans) <= k:
        minutes += 1
        ans += b.popleft()
    else:
        break

print(minutes)
# print(ans)
Problem p02831 (python)

Fixed submission:
import fractions

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


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


print(lcm(A, B))

Buggy submission (verdict: Runtime Error):
import math

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


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


print(lcm(A, B))
Problem p03834 (python)

Fixed submission:
s = input()
s1, s2, s3 = s.split(',')
print(s1, s2, s3)

Buggy submission (verdict: Runtime Error):
s = input()
s1, s2, s3 = s.split(',')
print(s1, s2. s3)
Problem p02598 (python)

Fixed submission:
import sys
import math
sys.setrecursionlimit(10**8)
stdin = sys.stdin


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


def naa(N): return [na() for _ in range(N)]


def ns(): return stdin.readline().rstrip()  # ignore trailing spaces


N, K = na()
A_array = na()

min_length = 0
max_length = 2 * 10 ** 9

while(max_length - min_length > 0.01):
    mid = (min_length + max_length) / 2
    cut_cnt = 0
    for a in A_array:
        c = a // mid
        if a - mid * c > 0:
            c += 1
        cut_cnt += (c - 1)
    # print(mid, cut_cnt)
    if cut_cnt <= K:
        max_length = mid
    else:
        min_length = mid

# print(max_length)


ans1 = math.floor(max_length)
ans2 = math.ceil(max_length)

if ans1 == 0:
    print(1)
    exit()

cut_cnt = 0
for a in A_array:
    c = a // ans1
    if a - ans1 * c > 0:
        c += 1
    cut_cnt += (c - 1)

if cut_cnt <= K:
    print(ans1)
else:
    print(ans2)

Buggy submission (verdict: Runtime Error):
import sys
import math
sys.setrecursionlimit(10**8)
stdin = sys.stdin


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


def naa(N): return [na() for _ in range(N)]


def ns(): return stdin.readline().rstrip()  # ignore trailing spaces


N, K = na()
A_array = na()

min_length = 0
max_length = 2 * 10 ** 9

while(max_length - min_length > 0.01):
    mid = (min_length + max_length) / 2
    cut_cnt = 0
    for a in A_array:
        c = a // mid
        if a - mid * c > 0:
            c += 1
        cut_cnt += (c - 1)
    # print(mid, cut_cnt)
    if cut_cnt <= K:
        max_length = mid
    else:
        min_length = mid

# print(max_length)


ans1 = math.floor(max_length)
ans2 = math.ceil(max_length)


cut_cnt = 0
for a in A_array:
    c = a // ans1
    if a - ans1 * c > 0:
        c += 1
    cut_cnt += (c - 1)

if cut_cnt <= K:
    print(ans1)
else:
    print(ans2)
Problem p02679 (python)

Fixed submission:
import sys
import math


stdin = sys.stdin


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


def ns(): return stdin.readline().rstrip()  # ignore trailing spaces


N = ni()

AB_array = [na() for _ in range(N)]

# print(AB_array)

plus_dic = {}
minus_dic = {}
ans = 1
fish_count = 0
mod = 10 ** 9 + 7
zero_count = 0
for ab in AB_array:
    a, b = ab
    if a == 0 and b == 0:
        zero_count += 1
        continue
    fish_count += 1
    if a == 0:
        vec = (0, 1)
        if vec in plus_dic:
            plus_dic[vec] += 1
        else:
            plus_dic[vec] = 1
        continue
    elif b == 0:
        vec = (1, 0)
        if vec in minus_dic:
            minus_dic[vec] += 1
        else:
            minus_dic[vec] = 1
        continue
    c = math.gcd(a, b)
    a = a // c
    b = b // c
    if a < 0:
        a *= -1
        b *= -1
    if b > 0:
        vec = (a, b)
        if vec in plus_dic:
            plus_dic[vec] += 1
        else:
            plus_dic[vec] = 1
    else:
        vec = (a, b)
        if vec in minus_dic:
            minus_dic[vec] += 1
        else:
            minus_dic[vec] = 1


# print(plus_dic, minus_dic, fish_count)

for k, vp in plus_dic.items():
    x, y = k
    if (y, -x) in minus_dic:
        vm = minus_dic[(y, -x)]
        ans = ans * (pow(2, vp, mod) + pow(2, vm, mod) - 1) % mod
        fish_count -= (vp + vm)

ans = ans * pow(2, fish_count, mod) % mod

print((ans - 1 + zero_count) % mod)

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


stdin = sys.stdin


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


def ns(): return stdin.readline().rstrip()  # ignore trailing spaces


N = ni()

AB_array = [na() for _ in range(N)]

# print(AB_array)

plus_dic = {}
minus_dic = {}
ans = 1
fish_count = 0
mod = 10 ** 9 + 7
for ab in AB_array:
    a, b = ab
    if a == 0 and b == 0:
        continue
    fish_count += 1
    if a == 0:
        vec = (0, 1)
        if vec in plus_dic:
            plus_dic[vec] += 1
        else:
            plus_dic[vec] = 1
    elif b == 0:
        vec = (1, 0)
        if vec in minus_dic:
            minus_dic[vec] += 1
        else:
            minus_dic[vec] = 1
    c = math.gcd(a, b)
    a = a // c
    b = b // c
    if a < 0:
        a *= -1
        b *= -1
    if b > 0:
        vec = (a, b)
        if vec in plus_dic:
            plus_dic[vec] += 1
        else:
            plus_dic[vec] = 1
    else:
        vec = (a, b)
        if vec in minus_dic:
            minus_dic[vec] += 1
        else:
            minus_dic[vec] = 1


# print(plus_dic, minus_dic, fish_count)

for k, vp in plus_dic.items():
    x, y = k
    if (y, -x) in minus_dic:
        vm = minus_dic[(y, -x)]
        ans = ans * (pow(2, vp, mod) + pow(2, vm, mod) - 1) % mod
        fish_count -= (vp + vm)

ans = ans * pow(2, fish_count, mod) % mod

print((ans - 1) % mod)
Problem p02851 (python)

Fixed submission:
import sys
import heapq
from collections import defaultdict

stdin = sys.stdin


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


def naa(N): return [na() for _ in range(N)]


def ns(): return stdin.readline().rstrip()  # ignore trailing spaces


N, K = na()

A_array = na()

cusum = 0
mod_array = [0]
for i, a in enumerate(A_array):
    cusum = (cusum + a) % K
    mod = (cusum + K - (i+1)) % K
    mod_array.append(mod)

# print(mod_array)

ans = 0
mod_queue = []
cnt_dic = defaultdict(int)
for i, v in enumerate(mod_array):
    heapq.heappush(mod_queue, (i, 1, v))

while(len(mod_queue)):
    i, q, v = heapq.heappop(mod_queue)
    if q == 1:
        ans += cnt_dic[v]
        cnt_dic[v] += 1
        if i + K <= N:
            heapq.heappush(mod_queue, (i+K-0.5, 2, v))
    else:
        cnt_dic[v] -= 1
    # print(i, v, q, ans)

print(ans)

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

stdin = sys.stdin


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


def naa(N): return [na() for _ in range(N)]


def ns(): return stdin.readline().rstrip()  # ignore trailing spaces


N, K = na()

A_array = na()

cusum = 0
mod_array = [0]
for i, a in enumerate(A_array):
    cusum = (cusum + a) % K
    mod = (cusum + K - (i+1)) % K
    mod_array.append(mod)

# print(mod_array)

ans = 0
mod_queue = []
cnt_array = [0] * K
for i, v in enumerate(mod_array):
    heapq.heappush(mod_queue, (i, 1, v))

while(len(mod_queue)):
    i, q, v = heapq.heappop(mod_queue)
    if q == 1:
        ans += cnt_array[v]
        cnt_array[v] += 1
        heapq.heappush(mod_queue, (i+K-0.5, 2, v))
    else:
        cnt_array[v] -= 1
    # print(i, v, q, ans)

print(ans)

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

stdin = sys.stdin


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


def naa(N): return [na() for _ in range(N)]


def ns(): return stdin.readline().rstrip()  # ignore trailing spaces


N, K = na()

A_array = na()

cusum = 0
mod_array = [0]
for i, a in enumerate(A_array):
    cusum = (cusum + a) % K
    mod = (cusum + K - (i+1)) % K
    mod_array.append(mod)

# print(mod_array)

ans = 0
mod_queue = []
cnt_array = [0] * N
for i, v in enumerate(mod_array):
    heapq.heappush(mod_queue, (i, 1, v))

while(len(mod_queue)):
    i, q, v = heapq.heappop(mod_queue)
    if q == 1:
        ans += cnt_array[v]
        cnt_array[v] += 1
        heapq.heappush(mod_queue, (i+K-0.5, 2, v))
    else:
        cnt_array[v] -= 1
    # print(i, v, q, ans)

print(ans)
Problem p03053 (python)

Fixed submission:
from scipy import ndimage
import numpy as np
import sys
input = sys.stdin.readline

H, W = map(int, input().split())

A_array = np.array(
    [[0 if s == "#" else 1 for s in input()[:-1]] for i in range(H)])
# print(A_array)


# print(A_array)
b = ndimage.morphology.distance_transform_cdt(
    A_array, metric="taxicab")
print(np.max(b))

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

H, W = map(int, input().split())
A_array = [input()[:-1] for s in range(H)]

ans_array = [[10000] * W for i in range(H)]
# print(ans_array)

for i, A in enumerate(A_array):
    black_index = [i for i, x in enumerate(A) if x == "#"]
    # print(black_index)
    for black in black_index:
        ans_array = [[
            min(ans_array[h][w],
                abs(h - i) + abs(w - black)) for w in range(W)
        ] for h in range(H)]
print(max([max(ans_array[i]) for i in range(H)]))
Problem p03253 (python)

Fixed submission:
# from scipy.misc import comb

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

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

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

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

    return result

def solve(n,m):
    maxdiv = int(m**0.5)
    l = []
    tmp = 2
    num = 0
    while tmp <= maxdiv:
        if m % tmp == 0:
            m /= tmp
            num += 1
        else:
            tmp += 1
            if num != 0:
                l.append(num)
                num = 0
    if m != 1:
        l.append(1)
    res = 1
    for div in l:
        tmp = cmb(n+div-1,div)%(10**9+7)
        res = res * tmp % (10**9+7)
    return int(res)
        

if __name__ == '__main__':
    n,m = map(int,input().split())
    print(solve(n,m))

Buggy submission (verdict: Runtime Error):
from scipy.misc import comb

def solve(n,m):
    maxdiv = int(m**0.5)
    l = []
    tmp = 2
    num = 0
    while tmp <= maxdiv:
        if m % tmp == 0:
            m /= tmp
            num += 1
        else:
            tmp += 1
            if num != 0:
                l.append(num)
                num = 0
    if m != 1:
        l.append(1)
    res = 1
    for div in l:
        tmp = comb(n+div-1,div,exact=True)%(10**9+7)
        res = res * tmp % (10**9+7)
    return int(res)
        

if __name__ == '__main__':
    n,m = map(int,input().split())
    print(solve(n,m))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb

def solve(n,m):
    maxdiv = int(m**0.5)
    l = []
    tmp = 2
    num = 0
    while tmp <= maxdiv:
        if m % tmp == 0:
            m /= tmp
            num += 1
        else:
            tmp += 1
            if num != 0:
                l.append(num)
                num = 0
    if m != 1:
        l.append(1)
    res = 1
    for div in l:
        tmp = comb(n+div-1,div,exact=True)%(10**9+7)
        res = res * tmp % (10**9+7)
    return int(res)
        

if __name__ == '__main__':
    n,m = map(int,input().split())
    print(solve(n,m))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb

def solve(n,m):
    maxdiv = int(m**0.5)
    l = []
    tmp = 2
    num = 0
    while tmp <= maxdiv:
        if m % tmp == 0:
            m /= tmp
            num += 1
        else:
            tmp += 1
            if num != 0:
                l.append(num)
                num = 0
    if m != 1:
        l.append(1)
    res = 1
    for div in l:
        tmp = comb(n+div-1,div,exact=True)%(10**9+7)
        res = res * tmp % (10**9+7)
    return int(res)
        

if __name__ == '__main__':
    n,m = map(int,input().split())
    print(solve(n,m))
Problem p03805 (python)

Fixed submission:
import itertools

N, M = map(int, input().split())

path = [[False] * N for i in range(N)]

for i in range(M):
    a, b = map(int, input().split())
    path[a-1][b-1] = True
    path[b-1][a-1] = True

count = 0
for i in itertools.permutations(list(range(N)),N):
    if i[0] == 0:
        for j in range(N):
            if j == N-1:
                count += 1
                break
            if not path[i[j]][i[j+1]]:
                break
    

print(count)

Buggy submission (verdict: Runtime Error):
import itertools

M, N = map(int, input().split())

lis = [[] for i in range(N)]

for i in range(M):
    a, b = map(int, input().split())
    lis[a-1].append(b-1)
    lis[b-1].append(a-1)

count = 0
for i in itertools.permutations(list(range(1,N)),N-1):
    s = 0
    for j in range(N-1):
        if i[j] not in lis[s]:
            break
        
        s = i[j]
    else:
        count += 1
    

print(count)
Problem p03835 (python)

Fixed submission:
import math

k, s = map(int, input().split())

res = 0

for x in range(k+1):
    for y in range(k+1):
        z = s - x - y
        if 0 <= z <= k:
            res += 1

print(res)

Buggy submission (verdict: Runtime Error):
import math

k, s = map(int, imput().split())

res = 0

for x in range(k+1):
    for y in range(k+1):
        if x+y < s:
            z = s - x - y
            res += 1

print(res)

Buggy submission (verdict: Runtime Error):
import math

k, s = map(int, imput().split())

res = 0

for x in range(k+1):
    for y in range(k+1):
        if x+y < s:
            z = s - x - y
            res += 1

print(res)
Problem p02695 (python)

Fixed submission:

import itertools


n, m, q = map(int, input().split())
query = []
for i in range(q):
    query.append(list(map(int, input().split())))

choices = list(itertools.combinations_with_replacement([i for i in range(1, m+1)], n))
ans = -1
for choice in choices:
    score = 0
    for q in query:
        if choice[q[1]-1] - choice[q[0]-1] == q[2]:
            score += q[3]
    ans = max(ans, score)
print(ans)

Buggy submission (verdict: Runtime Error):

import itertools

n, m, q = map(int, input().split())


n, m, q = map(int, input().split())
query = []
for i in range(q):
    query.append(list(map(int, input().split())))

choices = list(itertools.combinations_with_replacement([i for i in range(1, m+1)], n))
ans = -1
for choice in choices:
    score = 0
    for q in query:
        if choice[q[1]-1] - choice[q[0]-1] == q[2]:
            score += q[3]
    ans = max(ans, score)
print(ans)
Problem p02598 (python)

Fixed submission:
def check(lis,k,mid):
	for i in lis:
		if(i%mid==0):
			k+=1
		k-=(i//mid)
	return k>=0
n,k=map(int,input().split())
lis=list(map(int,input().split()))
a,b=1,max(lis)
ans=b
while(a<=b):
	mid=(a+b)//2
	if(check(lis,k,mid)):
		ans=mid
		b=mid-1
	else:
		a=mid+1
print(ans)

Buggy submission (verdict: Runtime Error):
mport math
def check(lis,k,mid):
	for i in lis:
		k-=(i//mid)
	return k>=0
n,k=map(int,input().split())
lis=list(map(int,input().split()))
a,b=1,max(lis)
ans=b
while(a<=b):
	mid=(a+b)/2
	if(check(lis,k,mid)):
		ans=mid
		b=mid-0.000001
	else:
		a=mid+0.000001
print(int(math.ceil(ans)))

Buggy submission (verdict: Runtime Error):
def check(lis,k,mid):
	for i in lis:
		k-=(i//mid)
	return k>=0
n,k=map(int,input().split())
lis=list(map(int,input().split()))
a,b=0,max(lis)
ans=b
while(a<=b):
	mid=(a+b)//2
	if(check(lis,k,mid)):
		ans=mid
		b=mid-1
	else:
		a=mid+1
print(ans)
Problem p02659 (python)

Fixed submission:
import decimal
a,b=input().split()
a=int(a)
b=decimal.Decimal(b)
print(int(a*b))

Buggy submission (verdict: Runtime Error):
a=int(input())
b=float(input())
print(int(a*b))
Problem p02707 (python)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
jousi={}
for i in range(N+1):
    jousi[str(i)]=0

for i in range(N-1):
    jousi[str(a[i])]+=1
    
for i in range(1,N+1):
    print(jousi[str(i)])

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
jousi={}
for i in range(N):
    itmp=str(i)
    jousi[itmp]=0
for i in range(N-1):
    atmp=str(a[i])
    jousi[atmp]+=1
for i in range(1,N+1):
    print(jousi[str(i)])
Problem p02880 (python)

Fixed submission:
N = int(input())
flag = 0

for i  in range(9):
    atai = N / (i + 1) 
    for j in range(9):
        if atai == j + 1:
            flag = 1
            break
    if flag == 1:
        break
if flag == 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):

    N = int(input())
    flag = 0
    
    for i  in range(9):
        atai = N / (i + 1) 
        for j in range(9):
            if atai == j + 1:
                flag = 1
                break
        if flag == 1:
            break
    if flag == 1:
        print("Yes")
    else:
        print("No")
Problem p02594 (python)

Fixed submission:

a = int(input())
if a >= 30:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a = input()
if a >= 30:
    print('Yes')
else:
    print('No')
Problem p02682 (python)

Fixed submission:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import itertools
import queue
import copy
import time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

A, B, C, K = inpl()
if A >= K:
    print(K)
    exit()
if A+B >= K:
    print(A)
    exit()

print(A - (K-A-B))

Buggy submission (verdict: Runtime Error):
A, B, C, K = inpl()
if A >= K:
    print(K)
    exit()
if A+B >= K:
    print(A)
    exit()
print(A-(K-A-B))
Problem p02831 (python)

Fixed submission:
import fractions
a, b = map(int, input().split())
ans = (a * b) //fractions.gcd(a, b)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
ans = (a * b) // math.gcd(a, b)
print(ans)
Problem p03834 (python)

Fixed submission:
a = input()

b = a.replace(",", " ")

print(b)

Buggy submission (verdict: Runtime Error):
happy,newyear,enjoy
Problem p02984 (python)

Fixed submission:
N = int(input())
As = [int(i) for i in input().split()]

x_0 = sum(As) - 2 * sum(As[1::2])
print(int(x_0), end=" ")
x = x_0

for i in range(N-2):
    x = 2*As[i] - x
    print(int(x), end=" ")

x = 2*As[N-2] - x
print(int(x))

Buggy submission (verdict: Runtime Error):
import numpy as np

N = int(input())
As = [int(i) for i in input().split()]

mat = np.array([np.zeros(N) for _ in range(N)])

for i in range(N-1):
    mat[i][i], mat[i][i+1] = 1, 1

mat[N-1][0], mat[N-1][N-1] = 1, 1

for i in range(N):
    C = mat[i][i]
    As[i] /= C
    for j in range(N):
        mat[i][j] /= C
    for k in range(N):
        if k == i: continue
        D = mat[k][i]
        for j in range(N):
            mat[k][j] -= mat[i][j] * D
        As[k] -= As[i] * D

print(*[int(i)*2 for i in As])
Problem p02759 (python)

Fixed submission:
n = int(input())
res = n // 2
if n % 2 == 1:
  res += 1
print(res)

Buggy submission (verdict: Runtime Error):
n = int(intput())
res = n // 2
if n % 2 == 1:
  res += 1
print(res)

Buggy submission (verdict: Runtime Error):
n = int(intput())
res = n // 2
if n % 2 == 1:
  res += 1
print(res)

Buggy submission (verdict: Runtime Error):
n = int(intput())
res = n // 2
if n % 2 == 1:
  res += 1
print(res)

Buggy submission (verdict: Runtime Error):
n = int(intput())
res = n // 2
if n % 2 == 1:
  res += 1
print(res)

Buggy submission (verdict: Runtime Error):
n = int(intput())
res = n // 2
if res % 2 == 1:
  res += 1
print(res)

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

res = n // 2
if res % 2 == 1:
  res += 1
  
print(res)

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

res = n //2 

if n%2 == 1:
  res += 1
  
return res

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

res = n//2
if res % 2 == 1:
  res += 1

return res
Problem p02881 (python)

Fixed submission:
import math
n = int(input())
min = n - 1
#√n を算出
split = n / math.sqrt(n)


for i in range(int(split),0,-1):
    if n % i == 0:
        min = i + n/i -2
        break

print(int(min))

Buggy submission (verdict: Runtime Error):
n = int(input())
min = n
for i in range(1,n+1):
  if n % i == 0:
      if min < x + n/i
      
print(min)

Buggy submission (verdict: Runtime Error):
n = int(input())
min = -1
for i in range(1,n+1):
  if min == -1:
    if n % i == 0:
      if min < x + n/i
      
print(min)
Problem p02970 (python)

Fixed submission:
N, D = map(int, input().split())

people = N / (2*D+1)
if people % 1.0 != 0:#割り切れないのであれば？？
    people+=1
print(int(people))

Buggy submission (verdict: Runtime Error):
import math
N,D = map(int,input().split())

people = math.ceil(N // (2D+1))
print(people)
Problem p03075 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
array=[a,b,c,d,e]
flag=True
 
for i in range(5):
  for j in range(5):
    if array[i]-array[j] > k:
      flag=False
      print(":(")
      break
  if not flag:
    break
      
if flag:
  print("Yay!")

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
c=input()
d=input()
e=input()
k=input()
array=[a,b,c,d,e]
flag=True

for i in range(5):
  for j in range(5):
    if array[i]-array[j] >= k:
      flag=False
      print(":(")
      break
  if not flag:
    break
      
if flag:
  print("Yay!")