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

Fixed submission:
X = int(input())

numbers = dict()

for i in range(-200, 200):
    numbers.setdefault(i, i**5)

for i in range(-200, 200):
    for j in range(-200, 200):
        if numbers[i] - numbers[j] == X:
            output = [i, j]
            break

print(output[0], output[1])

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

numbers = dict()

for i in range(-101, 101):
    numbers.setdefault(i, i**5)


for i in range(-101, 101):
    for j in range(-101, 101):
        if numbers[i] - numbers[j] == X:
            output = [i, j]
            break
print(output[0], output[1])
Problem p02720 (python)

Fixed submission:
from collections import deque

q = deque(range(1,10))
K = int(input())

for i in range(K):
    x = q.popleft()
    r =  x % 10
    if r != 0:
        q.append((10 * x) + (r - 1))
    q.append((10 * x) + r)
    if r != 9:
        q.append((10 * x) + (r + 1))

print(x)

Buggy submission (verdict: Runtime Error):
## 解説をみての答え
from collections import deque

q = deque(range(1,10))
K = int(input())

for i in range(K):
    x = q.popleft()
    r =  x % 10
    if r != 0:
        q.append((10 * x) + (r - 1))
    q.append((10 * x) + r)
    if r != 9:
        q.put((10 * x) + (r + 1))

print(x)
Problem p02727 (python)

Fixed submission:
X, Y, A, B, C = [int(i) for i in input().split()]
reds = sorted([int(i) for i in input().split()], reverse=True)
greens = sorted([int(i) for i in input().split()], reverse=True)
clears = sorted([int(i) for i in input().split()], reverse=True)

clear_acc = [0]

for i in clears:
    clear_acc.append(clear_acc[-1]+i)
        
reds = reds[:X]
greens = greens[:Y]

all_apples = sorted(reds+greens)

apple_sum = [sum(all_apples)]


for i in all_apples:
    apple_sum.append(apple_sum[-1]-i)
    

output = []

for i in range(min(X+Y, C+1)):
    output.append(apple_sum[i] + clear_acc[i])

print(max(output))

Buggy submission (verdict: Runtime Error):
X, Y, A, B, C = [int(i) for i in input().split()]
reds = sorted([int(i) for i in input().split()], reverse=True)
greens = sorted([int(i) for i in input().split()], reverse=True)
clears = sorted([int(i) for i in input().split()], reverse=True)

clear_acc = [0]

for i in clears:
    clear_acc.append(rr[-1]+i)
        
reds = reds[:X]
greens = greens[:Y]

all_apples = sorted(reds+greens)

apple_sum = [sum(all_apples)]


for i in all_apples:
    apple_sum.append(apple_sum[-1]-i)
    

output = []

for i in range(min(X+Y, C+1)):
    output.append(apple_sum[i] + clear_acc[i])

print(max(output))
Problem p02742 (python)

Fixed submission:
H, W = [int(i) for i in input().split()]

if H == 1 or W == 1:
    print(1)
elif W % 2 == 0:
    print((H * W) // 2)
else :
    odd_row = (W // 2) + 1
    even_row = W // 2
    if H % 2 == 1:
        odd_row_num = (H // 2) + 1
        even_row_num = H // 2
        print((odd_row*odd_row_num) + (even_row*even_row_num))
    else :
        print((odd_row+even_row) * (H // 2))

Buggy submission (verdict: Runtime Error):
if W % 2 == 0:
    print((H * W) // 2)
elif H == 1 or W == 1:
    print(1)
else :
    odd_row = (W // 2) + 1
    print('odd_row',odd_row)
    even_row = W // 2
    if H % 2 == 1:
        odd_row_num = (H // 2) + 1
        even_row_num = H // 2
        print((odd_row*odd_row_num) + (even_row*even_row_num))
    else :
        print((odd_row+even_row) * (H // 2))

Buggy submission (verdict: Runtime Error):
H, W = [int(i) for i in input().split()]

if W % 2 == 0:
    print((H * W) // 2)
else :
    odd_row = (W // 2) + 1 
    even_row = W // 2
    if H % 2 == 1:
        odd_row_num = (H // 2) + 1
        even_row_num = H // 2
        print((odd_row*odd_row_num) + (even_row*even_row_num))
    else :
        print(((odd_row+even_row) * (H // 2))
Problem p02761 (python)

Fixed submission:
N, M = [int(i) for i in input().split()]
conditions = [[int(i) for i in input().split()] for j in range(M)] 
num = -1
for i in range(10**N):
    flag = True
    for j in range(M):
        s = conditions[j][0]
        c = conditions[j][1]
        if len(str(i)) < s:
            flag = False
            break
        else :
            if int(str(i)[s-1]) == c:
                pass
            else:
                flag = False
                break
    if flag:
        if len(str(i)) == N:
            num = i
            break
        else :
            pass

print(num)

Buggy submission (verdict: Runtime Error):
N, M = [int(i) for i in input().split()]

guess_dict = {'100':[], '10':[], '1':[]}


flag = True
for i in range(M):
    s, c = [int(i) for i in input().split()]
    if s == 3:
        guess_dict['1'].append(c)
    elif s == 2:
        guess_dict['10'].append(c)
    elif s == 1:
        guess_dict['100'].append(c)
        
for k, v in guess_dict.items():
    if len(set(v)) > 1:
        flag = False
        
if N == 3:
    if len(guess_dict['100']) == 0:
        guess_dict['100'].append(1)
    if len(guess_dict['10']) == 0:
        guess_dict['10'].append(0)
    if len(guess_dict['1']) == 0:
        guess_dict['1'].append(0)
if N == 2:
    if len(guess_dict['100']) == 0 and len(guess_dict['10']) == 0:
        guess_dict['10'].append(0)
        guess_dict['10'].append(1)
    if len(guess_dict['1']) == 0:
        guess_dict['1'].append(0)
if N == 1:
    if len(guess_dict['100']) == 0 and len(guess_dict['10']) == 0:
        guess_dict['10'].append(0)
        guess_dict['10'].append(0)
    if len(guess_dict['1']) == 0:
        guess_dict['1'].append(0)

guess_num = 0
guess_num += guess_dict['100'][0] * 100
guess_num += guess_dict['10'][0] * 10
guess_num += guess_dict['1'][0]


if len(str(guess_num)) != N:
    flag = False

if flag:
    print(guess_num)
else :
    print('-1')
Problem p02780 (python)

Fixed submission:
import numpy as np

N, K = [int(i) for i in input().split()]
numbers = [int(i) for i in input().split()]

ary = np.array([(1 + n) / 2 for n in numbers])

cumsum = ary.cumsum()

max_exv = cumsum[K-1]
for i in range(N - K):
    if cumsum[i+K] - cumsum[i] > max_exv:
        max_exv = cumsum[i+K] - cumsum[i]
    
print(max_exv)

Buggy submission (verdict: Runtime Error):
import numpy as np
N, K = [int(i) for i in input().split()]
array = [int(i) for i in input().split()]

ary = np.array([(1 + n) / 2 for n in array])

cumsum = ary.cumsum()

exv.append(cumsum[K-1])
for i in range(N - K):
    exv.append([cumsum[i+K] - cumsum[i]])
    
print(max(exv)[0])

Buggy submission (verdict: Runtime Error):
N, K = [int(i) for i in input().split()]
array = [int(i) for i in input().split()]

ary = np.array([(1 + n) / 2 for n in array])

cumsum = ary.cumsum()

exv.append(cumsum[K-1])
for i in range(N - K):
    exv.append([cumsum[i+K] - cumsum[i]])
    
print(max(exv)[0])

Buggy submission (verdict: Runtime Error):
N, K = [int(i) for i in input().split()]
array = [int(i) for i in input().split()]

max_numbers = []
max_num = 0

for i in range(N-K+1):
    if sum(array[i:i+K]) > max_num:
        max_num = sum(array[i:i+K])
        max_numbers = array[i:i+K]

exv = 0
ev_dict = {}
for n in max_numbers:
    if n in ev_dict:
        evn += ev_dict[n]
    else :
        ev_dict.setdefault(n, 0)
        ev = (1+n) / 2
        exv += ev
        ev_dict[n] = ev
    
print(exv)

Buggy submission (verdict: Runtime Error):
def calcExValue(N):
    ev = []
    for i in range(1, N +1):
        ev.append(i * (1/N))
    return(sum(ev))

N, K = [int(i) for i in input().split()]
array = [int(i) for i in input().split()]

max_numbers = []
max_num = 0

for i in range(N-K+1):
    if sum(array[i:i+K]) > max_num:
        max_num = sum(array[i:i+K])
        max_numbers = array[i:i+K]

exv = 0
ev_dict = {}
for n in max_numbers:
    if n in ev_dict:
        evn += ev_dict[n]
    else :
        ev_dict.setdefault(n, 0)
        ev = calcExValue(n)
        exv += ev
        ev_dict[n] = ev
    
print(exv)
Problem p02917 (python)

Fixed submission:
N = int(input())

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

# A の初期化
A = [0 for i in range(N)]

for i in range(len(B)):
    if i == 0:
        A[i] = B[i]
    else:
        if A[i] >= B[i]:
            A[i] = B[i]
            
    A[i+1] = B[i]
    
print(sum(A))

Buggy submission (verdict: Runtime Error):
B = [int(i) for i in input().split()]

# A の初期化
A = [0 for i in range(N)]
for i, v in enumerate(B):
    if i == 0:
        A[i] = B[i]
    else:
        if A[i] >= B[i]:
            A[i] = B[i]
    A[i+1] = B[i]
    
print(sum(A))
Problem p02923 (python)

Fixed submission:
N = int(input())

blocks = list(map(int, input().split()))

max_cnt = 0
cnt = 0
i = 1
height = blocks[0]

while i <= N-1:
    if height >= blocks[i]:
        cnt += 1
    else :
        cnt = 0
    if cnt >= max_cnt:
        max_cnt = cnt
    height = blocks[i]
    i += 1

print(max_cnt)

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

blocks = list(map(int, input().split()))

counters = []

for i in range(N-1):
    counter = 0
    for j in range(i, N-1):
        if blocks[j] >= blocks[j+1]:
            counter += 1
        else :
            break
    counters.append(counter)
        
print(max(counters))
Problem p02924 (python)

Fixed submission:

N = int(input())

calc_N =  N-1

if calc_N % 2 == 1:
    O = calc_N // 2
    output = (1+calc_N) * O + O + 1
else :
    O = calc_N // 2
    output = (1+calc_N) * O
    
print(output)

Buggy submission (verdict: Runtime Error):
modsum = 0
for i in range(N-1):
    # print(i + 1)
    # print(divisor)
    modsum += (i + 1) % (i +2)
    
print(modsum)
Problem p02947 (python)

Fixed submission:
N = int(input())
cnt = dict()
output = 0

for i in range(N):
    string = ''.join(sorted(input()))
    cnt.setdefault(string, 0)
    output += cnt[string]
    cnt[string] += 1

print(output)

Buggy submission (verdict: Runtime Error):
import collections, math

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

cnt = 0

N = int(input())
string_counters = []

cnt = dict()
for i in range(N):
    string = collections.Counter(input())
    if string not in string_counters:
        string_counters.append(string)
        cnt.setdefault(i, 1)
    else :
        cnt[string_counters.index(string)] += 1

output = 0
for k, v in cnt.items():
    if v == 1:
        pass
    else :
        output += combinations_count(v, 2)

print(output)

Buggy submission (verdict: Runtime Error):
import collections, math

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

cnt = 0

N = int(input())
string_counters = []

cnt = dict()
for i in range(N):
    string = collections.Counter(input())
    if string not in string_counters:
        string_counters.append(string)
        cnt.setdefault(i, 1)
    else :
        cnt[string_counters.index(string)] += 1

output = 0
for k, v in cnt.items():
    output += combinations_count(v, 2)

print(output)

Buggy submission (verdict: Runtime Error):
import collections

cnt = 0

N = int(input())
string_counters = []

cnt = dict()
for i in range(N):
    string = collections.Counter(input())
    if string not in string_counters:
        string_counters.append(string)
        cnt[i] = 1
    else :
        cnt[string_counters.index(string)] += 1

output = 0
for k, v in cnt.items():
    output += v - 1
print(output)
Problem p03000 (python)

Fixed submission:
N, X = list(map(int, input().split()))
bounds = list(map(int, input().split()))

zahyos = [0]
for i, bound in enumerate(bounds):
    zahyo = zahyos[i] + bound
    zahyos.append(zahyo)
    
cnt = 0
for num in zahyos:
    if num <= X:
        cnt += 1
    
print(cnt)

Buggy submission (verdict: Runtime Error):
N, X = list(map(int, input().split()))
bounds = list(map(int, input().split()))

zahyos = [0]
for i, bound in enumerate(bounds):
    zahyo = zahyos[i] + bound
    zahyos.append(zahyo)
    
cnt = 0
zahyo = 0
index = 0
while zahyo <= X:
    cnt += 1
    index += 1
    zahyo = zahyos[index]
    
print(cnt)
Problem p03076 (python)

Fixed submission:
from decimal import *

dishes = []
for i in range(5):
    dishes.append(input())
    
idx = 0
min_ones_place = 9

for j in range(5):
    ones_place = int(dishes[j][-1])
    if ones_place != 0:
        if ones_place < min_ones_place:
            min_ones_place = ones_place
            idx = j
            
last_dish = int(dishes.pop(idx))

total_time = 0
for k in range(4):
    total_time += int(dishes[k])
    if total_time % 10 == 0:
        pass
    else :
        total_time = int(Decimal(str(total_time)).quantize(Decimal('1E1'), rounding=ROUND_UP))

total_time += last_dish
print(total_time)

Buggy submission (verdict: Runtime Error):
dishes = []
for i in range(5):
    dishes.append(input())
    
idx = 0
min_ones_place = 9

for j in range(5):
    ones_place = int(dishes[j][-1])
    if ones_place != 0:
        if ones_place < min_ones_place:
            min_ones_place = ones_place
            idx = j
            
last_dish = int(dishes.pop(idx))

total_time = 0
for k in range(4):
    total_time += int(dishes[k])
    if total_time % 10 == 0:
        pass
    else :
        total_time = int(Decimal(str(total_time)).quantize(Decimal('1E1'), rounding=ROUND_UP))

total_time += last_dish
print(total_time)
Problem p03086 (python)

Fixed submission:
S = input()

cnt = 0
results = []

for i in range(len(S)):
    if S[i] in ['A', 'C', 'G', 'T']:
        cnt += 1
    else :
        results.append(cnt)
        cnt = 0
    results.append(cnt)
    
print(max(results))

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

results = []

cnt = 0
results = []

for i in range(len(S)):
    if S[i] in ['A', 'C', 'G', 'T']:
        cnt += 1
    else :
        results.append(cnt)
        cnt = 0
        
print(max(results))
Problem p03262 (python)

Fixed submission:
import fractions
from functools import reduce

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

N, X = [int(i) for i in input().split()]
numbers = [int(i) for i in input().split()]

numbers.append(X)
numbers = sorted(numbers)

diff_numbers = []

for i in range(len(numbers)-1):
    diff_numbers.append(abs(numbers[i] - numbers[i+1]))

gcd_num = gcd_list(diff_numbers)

print(gcd_num)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

N, X = [int(i) for i in input().split()]
numbers = [int(i) for i in input().split()]

numbers.append(X)
numbers = sorted(numbers)

diff_numbers = []

for i in range(len(numbers)-1):
    diff_numbers.append(abs(numbers[i] - numbers[i+1]))

gcd = gcd_list(diff_numbers)

print(gcd)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

N, X = [int(i) for i in input().split()]
numbers = [int(i) for i in input().split()]

numbers.append(X)
numbers = sorted(numbers)

diff_numbers = []

for i in range(len(numbers)-1):
    diff_numbers.append(abs(numbers[i] - numbers[i+1]))

print(gcd_list(diff_numbers))
Problem p03282 (python)

Fixed submission:
S = input()
K = int(input())

output = ''

if len(S) <= K:
    for letter in S:
        if letter != '1':
            output = letter
            break
else :
    for i in range(K):
        if S[i] != '1':
            output = S[i]
            break

if output:
    print(output)
else :
    print('1')

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())

output = ''

if len(S) <= K:
    for letter in S:
        if letter != '1':
            output = l
            break
else :
    for i in range(K):
        if S[i] != '1':
            output = S[i]
            break
    
if output:
    print(output)
else :
    print('1')

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())

if len(S) >= K:
    for l in S:
        if l != '1':
            output = l
            break
else :
    for i in range(K):
        if S[i] != '1':
            output = S[i]
            break
            
print(output)

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())

if len(S) > K:
    for l in S:
        if l != '1':
            output = l
            break
else :
    for i in range(0, K):
        if S[i] != '1':
            output = S[i]
            break
            
print(output)

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())

if len(S) > K:
    for l in S:
        if l != '1':
            output = l
            break
else :
    for i in range(0, K+1):
        if S[i] != '1':
            output = S[i]
            break
            
print(output)
Problem p03417 (python)

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

n = 1 if n < 2 else n - 2
m = 1 if m < 2 else m - 2

print(n * m)

Buggy submission (verdict: Runtime Error):
N, M = [int(i) for i in input().split()]

def initTable(N,M):
    table = [['.'] * M for i in range(N)]
    return table

def flipCard(row, column, table):
    for r in range(3):
        for c in range(3):
            if row + (r-1) < 0 or column + (c-1) < 0:
                pass
            elif row + (r-1) >= N or column + (c-1) >= M:
                pass
            else:
                card = table[row + (r-1)][column + (c-1)]
                if card == '.':
                    card = '#'
                else :
                    card = '.'
                table[row + (r-1)][column + (c-1)] = card
    return table

table = initTable(N, M)

for row in range(N):
    for column in range(M):
        table = flipCard(row, column, table)
        
cnt = 0
for row in table:
    cnt += row.count('#')

print(cnt)
Problem p03761 (python)

Fixed submission:
from collections import Counter

N = int(input())

strings = [input() for i in range(N)]

string_set = list(map(set,strings))
count_set = list(map(Counter, strings))

common_letter = string_set[0]

for s in string_set:
    common_letter = common_letter & s

common_letter_nums = {}

for l in common_letter:
    common_letter_nums.setdefault(l, [])
    for c in count_set:
        common_letter_nums[l].append(c[l])

output_letter = ''
for k, v in common_letter_nums.items():
    output_letter += k * min(v)

print(''.join(sorted(output_letter)))

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

N = int(input())

strings = [input() for i i in range(N)]

string_set = list(map(set,strings))
count_set = list(map(Counter, strings))

common_letter = string_set[0]

for s in string_set:
    common_letter = common_letter & s

common_letter_nums = {}

for l in common_letter:
    common_letter_nums.setdefault(l, [])
    for c in count_set:
        common_letter_nums[l].append(c[l])

output_letter = ''
for k, v in common_letter_nums.items():
    output_letter += k * min(v)

print(''.join(sorted(output_letter)))
Problem p03796 (python)

Fixed submission:
def factorial_power(n):
    power = 1
    
    for i in range(1, n+1):
        power *= i
        power = power % divisor
    return power

divisor = (10 ** 9) + 7

N = int(input())

print(factorial_power(N))

Buggy submission (verdict: Runtime Error):
def factorial_power(n):
    if n == 0:
        return 1
    else :
        return n * factorial_power(n-1)
    
divisor = (10 ** 9) + 7

N = int(input())

print(factorial_power(N) % divisor)
Problem p02608 (python)

Fixed submission:
import sys
from itertools import permutations as pm
from math import factorial as fact
si = sys.stdin.readline


def main():
    ans = dict()
    n = int(si())
    for x in range(1, 100):
        for y in range(x, 100):
            for z in range(y, 100):
                value = ((x+y+z)**2+x**2+y**2+z**2)//2
                if value > 10000:
                    break
                if x == y and y == z:
                    cases = 1
                elif x != y and y != z and z != x:
                    cases = 6
                else:
                    cases = 3
                if value in ans:
                    ans[value] += cases
                else:
                    ans[value] = cases

    for i in range(1, n+1):
        if i in ans:
            print(ans[i])
        else:
            print(0)


if __name__ == '__main__':
    main()

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


def main():
    n = int(si())
    ans = [0 for _ in range(n+1)]
    for x in range(1, 100):
        for y in range(1, 100):
            for z in range(1, 100):
                v = ((x+y+z)**2+x**2+y**2+z**2)//2
                if v > 10000:
                    break
                ans[v] += 1

    for i in range(n):
        print(ans[i+1])


if __name__ == '__main__':
    main()
Problem p02684 (python)

Fixed submission:
import sys
si = sys.stdin.readline


def main():
    [n, k] = [int(e) for e in si().split()]
    trace = dict()
    for i in range(1, n+1):
        trace[i] = 0

    l = [int(e) for e in si().split()]
    i, cnt = 1, 0
    while k > 0:
        k -= 1
        cnt += 1
        i = l[i-1]
        if i == 1 or trace[i] != 0:
            cy = cnt-trace[i]
            k %= cy
            break
        trace[i] = cnt
    while k > 0:
        i = l[i-1]
        k -= 1
    print(i)


if __name__ == '__main__':
    main()

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


def main():
    [n, k] = [int(e) for e in si().split()]
    trace = dict()
    for i in range(1, n+1):
        trace[i] = 0

    l = [int(e) for e in si().split()]
    i, cnt = 1, 0
    while k > 0:
        k -= 1
        cnt += 1
        i = l[i-1]
        if i == 1 or trace[i] != 0:
            cy = cnt-trace[i]
            break
        trace[i] = cnt
    k %= cy
    while k > 0:
        i = l[i-1]
        k -= 1
    print(i)


if __name__ == '__main__':
    main()

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


def main():
    [n, k] = [int(e) for e in si().split()]
    trace = dict()
    for i in range(n):
        trace[i] = 0

    l = [int(e) for e in si().split()]
    i, cnt = 0, 0
    while True and k > 0:
        k -= 1
        cnt += 1
        i = l[i]-1
        if i == 0 or trace[i] != 0:
            cy = cnt-trace[i]
            break
        trace[i] = cnt
    k %= cy
    while k > 0:
        i = l[i]-1
        k -= 1
    print(i+1)


if __name__ == '__main__':
    main()
Problem p02817 (python)

Fixed submission:
import sys

def main():
    l=sys.stdin.readline().split()
    print(l[1]+l[0])

main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    l=sys.stdin.readline().split()
    print l[1]+l[0]

main()
Problem p02705 (python)

Fixed submission:
import math
r = int(input())
p = math.pi
print(2*r*p)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
for i in range(1,n):
    print(a.count(i))
print(0)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
for i in range(1,n):
    print(a.count(i))
print(0)
Problem p02743 (python)

Fixed submission:
a,b,c=map(int,input().split())
if c-a-b>0 and 4*a*b<(c-a-b)**2:
    print('Yes')
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import math
a,b,c = map(int,input().split())
if math.squrt(a)+math.squrt(b) < math.squrt(c):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
import math
a,b,c = map(int,input().split())
if a + b + 2*math.squrt(a*b) < c:
  print('Yes')
else:
  print('No')
Problem p02554 (python)

Fixed submission:
N = int(input())
mod = 10**9+7
S = 10**N-2*(9**N)+8**N
print(S%mod)

Buggy submission (verdict: Runtime Error):
N = int(input())
mod = 10**9+7
import math
NN = math.factorial(N+7)
U = (NN*(N+8)*(N+9))/362880
A = (NN*(N+8))/40320
C = NN/5040
S = int((U-2*A+C)%mod)
print(S)
Problem p02576 (python)

Fixed submission:
N, X, T = map(int, input().split())
import math
a = math.ceil(N/X)
b = a*T
print(b)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
Ch, Cw = map(int, input().split())
Dh, Dw = map(int, input().split())
S=[list(map(str, list(input()))) for i in range(H)]

ah = Ch
aw = Cw
count = 0

while (ah != Dh) or (aw != Dw):
    h = Dh - ah
    w = Dw - aw
    if h > 0:
        if S[ah+1][aw] == '.':
            ah = ah + 1
    if h < 0:
        if S[ah-1][aw] == '.':
            ah = ah - 1
    if w > 0:
        if S[ah][aw+1] == '.':
            aw = aw + 1
    if w < 0:
        if S[ah][aw-1] == '.':
            aw = aw - 1
print(count)