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

Fixed submission:
from sys import stdin

S = input()
Q = int(input())

reverse_flg = False

former_list = []
latter_list = []

for q in range(Q):
    T = stdin.readline()[:-1]

    if T == '1':
        if reverse_flg:
            reverse_flg = False
        else:
            reverse_flg = True
    
    else:
        t, f, c = T.split()
        if (f == '1' and reverse_flg == False) or (f == '2' and reverse_flg == True):
            former_list.append(c)
        else:
            latter_list.append(c)


if reverse_flg:
    latter_list = ''.join(reversed(latter_list))
    former_list = ''.join(former_list)
    S = ''.join(list(reversed(S)))
    S = ''.join([latter_list, S, former_list])

else:
    former_list = ''.join(reversed(former_list))
    latter_list = ''.join(latter_list)
    S = ''.join([former_list, S, latter_list])

print(S)

Buggy submission (verdict: Runtime Error):
from sys import stdin

S = input()
Q = int(input())

T_list = []
for q in range(Q):
    T = stdin.readline()
    T_list.append(T)

for t in T_list:
    if t == '1':
        S = S[::-1]

    else:
        T, f, c = t.split()

        if f == '1':
            S = c + S
        else:
            S = S + c

print(S)
Problem p02760 (python)

Fixed submission:
# https://atcoder.jp/contests/abc157/tasks/abc157_b

A_list = [[] for _ in range(3)]

for i in range(3):
    A1, A2, A3 = map(int, input().split())
    A_list[i] += [A1, A2, A3]

N = int(input())

set1 = {A_list[0][0], A_list[0][1], A_list[0][2]}
set2 = {A_list[1][0], A_list[1][1], A_list[1][2]}
set3 = {A_list[2][0], A_list[2][1], A_list[2][2]}
set4 = {A_list[0][0], A_list[1][0], A_list[2][0]}
set5 = {A_list[0][1], A_list[1][1], A_list[2][1]}
set6 = {A_list[0][2], A_list[1][2], A_list[2][2]}
set7 = {A_list[0][0], A_list[1][1], A_list[2][2]}
set8 = {A_list[0][2], A_list[1][1], A_list[2][0]}


b_set = set()

for n in range(N):
    b = int(input())
    b_set.add(b)

if (set1 <= b_set or 
    set2 <= b_set or
    set3 <= b_set or
    set4 <= b_set or
    set5 <= b_set or
    set6 <= b_set or
    set7 <= b_set or
    set8 <= b_set):

    print('Yes')
else:
    print('No')

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

A_list = []

for i in range(3):
    a = list(map(int, input().split()))
    A_list.append(a)

N = int(input())
narray = np.zeros((3, 3), dtype=np.int)


for j in range(N):
    b = int(input())

    for n in range(3):
        for m in range(3): 
            if A_list[n][m] == b:
                narray[n, m] = 1


n_list = np.count_nonzero(narray == 1, axis = 0)
m_list = np.count_nonzero(narray == 1, axis = 1)

if 3 in n_list or 3 in m_list:
    print('Yes')
    exit()

if narray[0, 0] == 1 and narray[1, 1] == 1 and narray[2, 2] == 1:
    print('Yes')
    exit()

if narray[0, 2] == 1 and narray[1, 1] == 1 and narray[2, 0] == 1:
    print('Yes')
    exit()

print('No')
Problem p02761 (python)

Fixed submission:
N, M = map(int, input().split())
N_list = [0] * N
N_set_list = [False] * N

for i in range(M):
  s, c = map(int, input().split())
  s -= 1
  
  if s > N -1 or (s == 0 and c == 0 and N != 1):
    print(-1)
    exit()

  elif N_set_list[s] and (N_list[s] != c):
    print(-1)
    exit()

  else:
    N_list[s] = c
    N_set_list[s] = True

if N_list[0] == 0 and N != 1:
  N_list[0] = 1

print(''.join(map(str, N_list)))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
N_list = [0] * N
N_set_list = [False] * N

for i in range(M):
  s, c = map(int, input().split())
  s -= 1
  
  if s > N -1 or (s == 0 and c == 0):
    print(-1)
    exit()

  elif N_set_list[s] and (N_list[s] != c):
    print(-1)
    exit()

  else:
    N_list[s] = c
    N_set_list[s] = True

if N_list[0] == 0 and len(N_list) != 1
  N_list[0] = 1

print(''.join(map(str, N_list)))
Problem p02947 (python)

Fixed submission:
# https://atcoder.jp/contests/abc137/tasks/abc137_c

import math

N = int(input())

s_dic = {}
s_set = set()

for i in range(N):
    s = input()

    s = ''.join(sorted(s))

    if s in s_set:
        s_dic[s] += 1

    else:
        s_set.add(s)
        s_dic[s] = 1


result = 0

for val in s_dic.values():

    if val > 1:
        result += int((val * (val - 1)) / 2)

print(result)

Buggy submission (verdict: Runtime Error):
# https://atcoder.jp/contests/abc137/tasks/abc137_c

import math

N = int(input())

s_dic = {}
s_set = set()

for i in range(N):
    s = input()

    s = ''.join(sorted(s))

    if s in s_set:
        s_dic[s] += 1

    else:
        s_set.add(s)
        s_dic[s] = 1


result = 0

for val in s_dic.values():

    if val > 1:
        result += int(math.factorial(val) /2)

print(result)
Problem p02995 (python)

Fixed submission:
# https://atcoder.jp/contests/abc131/tasks/abc131_c

from fractions import gcd


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

C_ = B // C
D_ = B // D

C_a = (A-1) // C
D_a = (A-1) // D

# 最小公倍数
CD = (C * D) // gcd(C, D)    # C*D / (最大公約数)

CD_ = (B // CD)
CD_a = ((A-1) // CD)

ans = B - (A-1) - (C_ - C_a) - (D_ - D_a) + (CD_ - CD_a)

print(int(ans))

Buggy submission (verdict: Runtime Error):
# https://atcoder.jp/contests/abc131/tasks/abc131_c


import math


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

C_ = (B // C) - ((A - 1) // C)

D_ = (B // D) - ((A - 1) // D)

# 最大公約数
CD = math.gcd(C, D)

# 最小公倍数
CD = (C * D) / CD

CD_ = (B // CD) - ((A - 1) // CD)

total_num = B - (A - 1)

ans = total_num - C_ - D_ + CD_

print(int(ans))
Problem p03285 (python)

Fixed submission:

N = int(input())

cake_price = 4
donut_price = 7

max_cake = N // cake_price
max_donut = N // donut_price

isJustN = False
if max_cake * cake_price == N or max_donut * donut_price == N:
    isJustN = True
else:
    for c in range(1, max_cake + 1):
        for d in range(1, max_donut + 1):
            total_price = cake_price * c + donut_price * d
            if total_price == N:
                isJustN = True
                break

Result = ''
if isJustN == True:
    Result = 'Yes'
else:
    Result = 'No'
print(Result)

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

cake_price = 4
donut_price = 7

max_cake = N // cake_price
max_donut = N // donut_price

isJustN = False
if max_cake * cake_price == N or max_donut * donut_price == N:
    isJustN = True
else:
    for c in range(1, max_cake + 1):
        for d in range(1, max_donut + 1):
            total_price = cake_price * c + donut_price * d
            if total_price == N:
                isJustN = True
                break

Result = ''
Result = 'Yes' if isJustN == True else Result = 'No'
print(Result)
Problem p03308 (python)

Fixed submission:
N = input()
A_list = input().split()

A_list_int = list(map(int, A_list))

max = max(A_list_int)
min = min(A_list_int)

print(max - min)

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


A_list = []
for i in range(0, len(A), 1):
    A_list.append(int(A[i: i + 1]))


A_list_int = list(map(int, A_list))

max = max(A_list_int)
min = min(A_list_int)

print(max - min)

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

A_list = [A[i: i + 1] for i in range(0, len(A), 1)]

A_list_int = list(map(int, A_list))

max = max(A_list_int)
min = min(A_list_int)

print(max - min)

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

A_list = [A[i: i + 1] for i in range(0, len(A), 1)]

A_list_int = list(map(int, A_list))

max = max(A_list_int)
min = min(A_list_int)

print(max - min)
Problem p03471 (python)

Fixed submission:
# https://atcoder.jp/contests/abc085/tasks/abc085_c

# N枚、Y円
N, Y = map(int, input().split())

for i in range(N + 1):
    for j in range(N + 1):
        
        z = N - (i + j)

        if z < 0:
            continue

        total = i*1000 + j*5000 + z*10000
        
        if total == Y:
            print(z, j, i)
            exit()

print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
    # https://atcoder.jp/contests/abc085/tasks/abc085_c

    # N枚、Y円
    N, Y = map(int, input().split())

    for i in range(N):
        for j in range(N):
            
            z = N - (i + j)

            if z < 0:
                continue

            if i*1000 + j*5000 + z*10000 == Y:
                print(i, j, z)
                exit()

    print(-1, -1, -1)






    # ダメな例
    # def dfs(total, c_1000, c_5000, c_10000, count_bill):

    #     if count_bill == N and total == Y:
    #         print(c_1000, c_5000, c_10000)
    #         exit()

    #     elif count_bill == N:
    #         return


    #     dfs(total + 1000, c_1000+1, c_5000, c_10000, count_bill+1)

    #     dfs(total + 5000, c_1000, c_5000+1, c_10000, count_bill+1)

    #     dfs(total + 10000, c_1000, c_5000, c_10000+1, count_bill+1)

    # dfs(0, 0, 0, 0, 0)
    # print(-1, -1, -1)
Problem p03493 (python)

Fixed submission:
input = input()
total = 0
for element in input:
    total += int(element)

print(total)

Buggy submission (verdict: Runtime Error):
# https://atcoder.jp/contests/abc081/tasks/abc081_b

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


# リスト内の要素に奇数が含まれているかどうかを判断する
# 戻り値：Boolean
def judge_hasOdd(A):
    hasOdd = False
    for a in A:
        if a % 2 == 0:
            continue
        else:
            hasOdd = True
            break
    return hasOdd


# リスト内の全要素を２で割る
# リスト内に奇数が現れるまで上記操作を繰り返す
count = 0
while True:
    if judge_hasOdd(A) == False:
        A = list(map(lambda x: x/2, A))
        count += 1
    else:
        break

print(count)
Problem p03494 (python)

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


def judge_hasOdd(A):
    hasOdd = False
    for a in A:
        if a % 2 == 0:
            continue
        else:
            hasOdd = True
            break
    return hasOdd


count = 0
while True:
    if judge_hasOdd(A) == False:
        A = list(map(lambda x: x/2, A))
        count += 1
    else:
        break

print(count)

Buggy submission (verdict: Runtime Error):
# https://atcoder.jp/contests/abc081/tasks/abc081_b

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


# リスト内の要素に奇数が含まれているかどうかを判断する
# 戻り値：Boolean
def judge_hasOdd(A):
    hasOdd = False
    for a in A:
        if a % 2 == 0:
            continue
        else:
            hasOdd = True
            break
    return hasOdd


# リスト内の全要素を２で割る
# リスト内に奇数が現れるまで上記操作を繰り返す
count = 0
while True:
    if judge_hasOdd(A) == False:
        A = list(map(lambda x: x/2, A))
        count += 1
            break
    else:
        break

print(count)
Problem p03162 (python)

Fixed submission:
N = int(input())

abc = [list(map(lambda x: int(x), input().split())) for _ in range(N)]

happy = [[0] * 3 for _ in range(N)]
for i in range(3):
	happy[0][i] = abc[0][i]

for i in range(1, N):
	for j in range(3):
		for k in range(3):
			if j != k and happy[i][j] < happy[i - 1][k]:
				happy[i][j] = happy[i - 1][k]
		happy[i][j] += abc[i][j]

print(max(happy[N - 1][0], happy[N - 1][1], happy[N - 1][2]))

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

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

w = [0] * N
v = [0] * N
for i in range(N):
    w[i], v[i] = map(int, input().split())

def func(N, W):
    dp = [0] * (W+1)
    for i in range(N):
        for j in range(W, w[i]-1, -1):
            a = dp[j-w[i]] + v[i]
            if dp[j] < a:
                dp[j] = a
    return dp[W]

print(func(N, W))
Problem p03166 (python)

Fixed submission:
import sys
sys.setrecursionlimit(100001)

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

dp = [0] * N
g = [[] for _ in range(N)]

for _ in range(M):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    g[x].append(y)

def dfs(node):
    if dp[node] > 0:
        return dp[node]
    mx = 0
    for i in g[node]:
        a = dfs(i) + 1
        if mx < a:
            mx = a
    dp[node] = mx
    return mx

ans = 0
for i in range(N):
    if dp[i] == 0:
        ans = max(ans, dfs(i))

print(ans)

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

dp = [0] * N
parent = [[] for _ in range(N)]

def func(node):
    for i in parent[node]:
        if dp[i] <= dp[node]:
            dp[i] = dp[node] + 1
            func(i)


for _ in range(M):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    parent[y].append(x)
    if dp[x] <= dp[y]:
        dp[x] = dp[y] + 1
        func(x)

print(max(dp))
Problem p03175 (python)

Fixed submission:
import sys
sys.setrecursionlimit(200000)

N = int(input())
MOD = 10 ** 9 + 7

to = [[] for _ in range(N)]
for _ in range(N-1):
    x, y = map(int, input().split())
    to[x-1].append(y-1)
    to[y-1].append(x-1)

def dfs(n,p):
    w = 1
    b = 1
    for i in to[n]:
        if i != p:
            rw, rb = dfs(i, n)
            w *= (rw + rb)
            w %= MOD
            b *= rw
            b %= MOD
    return (w,b)

ans = dfs(0, -1)
print((ans[0] + ans[1]) % MOD)

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

root = {i for i in range(N)}

to = [[] for _ in range(N)]
for _ in range(N-1):
    x, y = map(int, input().split())
    to[x-1].append(y-1)
    to[y-1].append(x-1)

visited = [False] * N
def dfs(n):
    visited[n] = True
    w = 1
    b = 1
    for i in to[n]:
        if visited[i] == False:
            rw, rb = dfs(i)
            w *= rw + rb
            b *= rw
    return [w,b]

ans = dfs(0)
print(ans[0] + ans[1])
Problem p03545 (python)

Fixed submission:
array = [int(i) for i in list(input())]
flag = False
fugou = ['+', '-']

for i in fugou:
	if i == '+':
		tmp = array[0] + array[1]
	else:
		tmp = array[0] - array[1]
	for j in fugou:
		if j == '+':
			tmp2 = tmp + array[2]
		else:
			tmp2 = tmp - array[2]
		for k in fugou:
			if k == '+':
				if tmp2 + array[3] == 7:
					print(str(array[0])
							+ i + str(array[1])
							+ j + str(array[2])
							+ k + str(array[3])
							+ '=7')
					flag = True
					break
			else:
				if tmp2 - array[3] == 7:
					print(str(array[0])
							+ i + str(array[1])
							+ j + str(array[2])
							+ k + str(array[3])
							+ '=7')
					flag = True
					break
		if flag: break
	if flag: break

Buggy submission (verdict: Runtime Error):
array = [int(i) for i in list(input())]
flag = False
fugou = ['+', '-']

for i in fugou:
	if i == '+':
		tmp = array[0] + array[1]
	else:
		tmp = array[0] - array[1]
	for j in fugou:
		if j == '+':
			tmp2 = tmp + array[2]
		else:
			tmp2 = tmp - array[2]
		for k in fugou:
			if k == '+':
				if tmp2 + array[3] == 7:
					print(str(array[0])
							+ i + str(array[1])
							+ j + str(array[2])
							+ k + str(array[3]))
							+ '=7')
					flag = True
					break
			else:
				if tmp2 - array[3] == 7:
					print(str(array[0])
							+ i + str(array[1])
							+ j + str(array[2])
							+ k + str(array[3])
							+ '=7')
					flag = True
					break
		if flag: break
	if flag: break
Problem p03746 (python)

Fixed submission:
import sys
sys.setrecursionlimit(100005)

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

E = [[] for _ in range(N)]
for _ in range(M):
    A, B = map(int, input().split())
    A -= 1
    B -= 1
    E[A].append(B)
    E[B].append(A)

visited = [False for _ in range(N)]
ans = []

def dfs(p, one):
    if visited[p]:
        return False
    visited[p] = True
    if not one:
        ans.append(p+1)
    for i in E[p]:
        if dfs(i, one):
            break
    if one:
        ans.append(p+1)
    return True

dfs(0, True)
for i in E[0]:
    if dfs(i, False):
        break
print(len(ans))
for i in ans:
    print(i)

Buggy submission (verdict: Runtime Error):
from collections import deque
N, M = map(int, input().split())

E = [[] for _ in range(N)]
for _ in range(M):
    A, B = map(int, input().split())
    A -= 1
    B -= 1
    E[A].append(B)
    E[B].append(A)

visited = [False for _ in range(N)]
ans = deque()

def dfs(p, one):
    if visited[p]:
        return False
    visited[p] = True
    for i in E[p]:
        if dfs(i, one):
            break
    if one:
        ans.appendleft(p+1)
    else:
        ans.append(p+1)
    return True

dfs(0, True)
for i in E[0]:
    if dfs(i, False):
        break

print(len(ans))
for i in ans:
    print(i)
Problem p02741 (python)

Fixed submission:
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(a[k-1])

Buggy submission (verdict: Runtime Error):
k = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(k[input()-1])
Problem p02765 (python)

Fixed submission:
n,r=map(int,input().split())

if n>=10:
  print(r)
else:
  print(r+1000-100*n)

Buggy submission (verdict: Runtime Error):
n,r=map(int,input().split())

if n=>10:
  print(r)
else:
  print(r+1000-100*n)

Buggy submission (verdict: Runtime Error):
n,r=map(int,input().split())

if n=>10:
  print(r)
else:
  print(r+10000-100*n)
Problem p02783 (python)

Fixed submission:
h,a = map(int,input().split())
n = -((-h)//a)
print(n)

Buggy submission (verdict: Runtime Error):
h,a = map(int,input().split())
b = h/a
if b%1 = 0:
    print(b)
elif b%1 < 0:
    print(1)
else:
    print(b//1)

Buggy submission (verdict: Runtime Error):
h,a=map(int,input().split(" "))

if h%a==0:
  print(h/a)
else:
  primt((h//a)+1)

Buggy submission (verdict: Runtime Error):
h,a=map(int,input().split(" "))

if h%a==0:
  print(h/a)
else:
  primt(h//a+1)
Problem p03393 (python)

Fixed submission:
S=list(input())
m=list('abcdefghijklmnopqrstuvwxyz')[::-1]

if len(S)<26:
    for i in m[::-1]:
        if i not in S:
            S.append(i)
            break
    print(''.join(S))
else:
    x=S[-1]
    for i in range(25)[::-1]:
        if x>S[i]:
            y=m.index(S[i])
            S=S[:i]
            for j in range(y)[::-1]:
                if m[j] not in S:
                    S.append(m[j])
                    break
            break
        else:
            x=S[i]
        
        if i==0:
            print(-1)
            exit()
    print(''.join(S))

Buggy submission (verdict: Runtime Error):
S=input()
alpha='abcdefghijklmnopqrstuvwxyz'
ans=''
P=[]
for i in range(26):
    P.append([alpha[i],1])


cnt=0
if len(S)==26:
    l=[]
    poe=S[::-1]
    for i in range(25):
        if poe[i]<poe[i+1]:
            cnt+=1
            l.append(poe[i])
        else:
            ans=poe[:i+1:-1]+min(l)
            break
    if cnt==25:
        ans='-1'
else:
    for i in range(len(S)):
        for j in range(26):
            if S[i]==P[j][0]:
                P[j][1]=0
        for i in range(26):
            if P[i][1]==1:
                ans=S+P[i][0]
                break

print(ans)
Problem p03524 (python)

Fixed submission:
S=input()
k=S.count('a')
l=S.count('b')
m=S.count('c')

if abs(k-l)<=1 and abs(l-m)<=1 and abs(m-k)<=1:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
S=input()
let=['a','b','c']
k=S.count('a')
l=S.count('b')
m=S.count('c')

if abs(k-l)<=1 and abs(l-m)<=1 and abs(m-k)<=1:
    print('YES')
else:
    pritn('NO')
Problem p03681 (python)

Fixed submission:
from math import factorial
N,M=map(int,input().split())
ans=0
if abs(N-M)>1:
    ans=0
else:
    if N==M:
        a=N
        b=M
        ans=factorial(a)*factorial(b)*2
    else:
        a=max(N,M)
        b=min(N,M)
        ans=factorial(a)*factorial(b)
print(ans%(10**9+7))

Buggy submission (verdict: Runtime Error):
from math import factorial
N,M=map(int,input().split())
ans=0
if abs(N-M)>1:
    ans=0
else:
    if N==M:
        a=N
        b=M
        ans=factorial(a)*factorial(b)*2
    else:
        a=max(N,M)
        b=min(N,M)
        ans=factorial(a)*facotrial(b)
print(ans%(10**9+7))
Problem p03721 (python)

Fixed submission:
N,K=map(int,input().split())
cnt=0
P=[]
for i in range(N):
    a,b=map(int,input().split())
    P.append((a,b))

P=sorted(P)
for i in range(N):
    cnt+=P[i][1]
    if cnt>=K:
        print(P[i][0])
        break

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
cnt=0
P=[]
for i in range(N):
    a,b=map(int,input().split())
    P.append((a,b))

P=sorted(P)
for i in range(N):
    cnt+=P[1]
    if cnt>=K:
        print(P[0])
Problem p03779 (python)

Fixed submission:
X=int(input())
i=0
while X>0:
    X-=i+1
    i+=1
print(i)

Buggy submission (verdict: Runtime Error):
X=int(input())
for i in range(X):
    if X<=(i+1)*i//2:
        ans=i
        break
print(ans)

Buggy submission (verdict: Runtime Error):
X=int(input())
dp=[0]*(X+1)
for i in range(1,10**5):
    if (i-1)*i//2<X<=i*(i+1)//2:
        print(i)
        break
Problem p03852 (python)

Fixed submission:
c=input()
if "a" in c or "i" in c or "u" in c or "e" in c or "o" in c:
  print("vowel")
else:
  print("consonant")

Buggy submission (verdict: Runtime Error):
c=input()
if c in"aiueo"
  print("vowel")
else:
  print("consonant")
Problem p02554 (python)

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

MOD = 1000000007  # type: int


def solve(N: int):
    return print((10**N - 2*9**N + 8**N)%MOD)

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys

MOD = 1000000007  # type: int


def solve(N: int):
    return print((10**N - 2*9**N + 8**N))

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()
~                                                                                                                                        
~
Problem p02576 (python)

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


def solve(N: int, X: int, T: int):
    i = 1
    A = 0
    while(True):
        A = N - X*i

        if A <= 0:
            break

        i+=1

    return print(i*T)


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    T = int(next(tokens))  # type: int
    solve(N, X, T)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys


def solve(N: int, X: int, T: int):
    i = 0
    A = 0
    while:
        if A < 0:
            break
        A = N - X*i
        i+=1

    return print(i*T)


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    T = int(next(tokens))  # type: int
    solve(N, X, T)

if __name__ == '__main__':
    main()
~