Buggy python submission (verdict: Runtime Error):
  N = int(input())
  print((10**N -9**N -9**N +8**N)% (10**9+7))


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

Buggy python submission (verdict: Runtime Error):
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
N = int(input())

all = 0
for i in range(2, N//2+1):
    basyo = combinations_count(N, i)  # iとN-iの時、値が同じ

    zero_iti  = 2 ** (3 * N - 2 * i - 1)  # i=iの時
    zero_iti2 = 2 ** (N + 2 * i - 1)      # i=N-iの時

    all += basyo * (zero_iti + zero_iti2)

if S % 2 == 0:  # i = Nが無いので足す
    basyo = combinations_count(N, N)
    zero_iti = 2 ** (N - 1)
    all += basyo * zero_iti

if S % 2 == 1:  # i = N-1も無いので足す
    basyo = combinations_count(N, N)
    zero_iti = 2 ** (N - 1)
    all += basyo * zero_iti

    basyo = combinations_count(N, N - 1)
    zero_iti = 2 ** (N - 2)
    all += basyo * zero_iti

print(int(all % (10**9+7)))

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

Buggy python submission (verdict: Time Limit Exceeded):
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
N = int(input())

# all = 0
# for i in range(2, N+1):
#     basyo = combinations_count(N, i)
#     # basyo = permutations_count(N, i) / 2  # 9と0が入る場所。i箇所。
#     # zerokyuu = i*(i-1)*2(i-2)  # 入る場所に0と9を入れる。
#     zerokyuu = 2**i - 2  # 全部0と全部9を抜く。
#     iti_hachi = 8**(N-i)  # 残った部分に1-8が入る全通り
#     all += basyo * zerokyuu * iti_hachi

lis = [int(combinations_count(N, i) * (2**i - 2) * (8**(N-i))) for i in range(2, N+1)]
print(sum(lis) % (10**9+7))

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

Buggy python submission (verdict: Time Limit Exceeded):
import math
# def permutations_count(n, r):
#     return math.factorial(n) // math.factorial(n - r)

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
N = int(input())

sum = 0
for i in range(2, N+1):
    basyo = combinations_count(N, i)
    # basyo = permutations_count(N, i) / 2  # 9と0が入る場所。i箇所。
    # zerokyuu = i*(i-1)*2(i-2)  # 入る場所に0と9を入れる。
    zerokyuu = 2**i - 2  # 全部0と全部9を抜く。
    iti_hachi = 8**(N-i)  # 残った部分に1-8が入る全通り
    sum += basyo * zerokyuu * iti_hachi

print(int(sum % (10**9+7)))


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

Buggy python submission (verdict: Runtime Error):
import math
def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

N = int(input())

sum = 0
for i in range(2, N+1):
    basyo = permutations_count(N, i)/2  # 9と0が入る場所。i箇所。
    # zerokyuu = i*(i-1)*2(i-2)  # 入る場所に0と9を入れる。
    zerokyuu = 2**i - 2  # 全部0と全部9を抜く。
    iti_hachi = 8**(N-i)  # 残った部分に1-8が入る全通り
    sum += basyo * zerokyuu * iti_hachi

print(int(sum%(10**9+7)))

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

Buggy python submission (verdict: Runtime Error):
import math
def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

N = int(input())

sum = 0
for i in range(2, N+1):
    basyo = permutations_count(N, i)/2  # 9と0が入る場所。i箇所。
    # zerokyuu = i*(i-1)*2(i-2)  # 入れる場所に0と9を入れる。
    zerokyuu = 2**i - 2  # 全部0と全部9を抜く。
    iti_hachi = 8**(N-2)  # 残った部分に1-8が入る全通り
    sum += basyo * zerokyuu * iti_hachi

print(int(sum%(10**9+7)))


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