Problem:


Score : 300 points

Problem Statement

How many integer sequences A_1,A_2,\ldots,A_N of length N satisfy all of the following conditions?

0 \leq A_i \leq 9

There exists some i such that A_i=0 holds.

There exists some i such that A_i=9 holds.

The answer can be very large, so output it modulo 10^9 + 7.

Constraints

1 \leq N \leq 10^6

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

Print the answer modulo 10^9 + 7.

Sample Input 1

2

Sample Output 1

2

Two sequences \{0,9\} and \{9,0\} satisfy all conditions.

Sample Input 2

1

Sample Output 2

0

Sample Input 3

869121

Sample Output 3

2511445



Sample input:
2


Sample output:
2

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union
# import time
# import math, cmath
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import _heapify_max, _heappop_max, _siftdown_max
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import Fraction               # Fraction(a, b) => a / b ∈ Q. note: Fraction(0.1) do not returns Fraciton(1, 10). Fraction('0.1') returns Fraction(1, 10)



def main():
    Num = Union[int, float]
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79e+308
    # inf = 2 ** 63 - 1             # (for fast JIT compile in PyPy) 9.22e+18
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input():  return sys.stdin.readline().rstrip()
    def ii():     return int(input())
    def isp():    return input().split()
    def mi():     return map(int, input().split())
    def mi_0():   return map(lambda x: int(x)-1, input().split())
    def lmi():    return list(map(int, input().split()))
    def lmi_0():  return list(map(lambda x: int(x)-1, input().split()))
    def li():     return list(input())
    def debug(x): print(x, file=sys.stderr)
    # def _heappush_max(h, item): h.append(item); _siftdown_max(h, 0, len(h)-1)
    
    
    n = ii()
    res = 2 * pow(9, n, mod) - pow(8, n, mod)    # no 0 or no 9
    print(pow(10, n, mod) - res)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
a=10**n%(10**9+7)
b=2*9**n%(10**9+7)
c=8**n%(10**9+7)
print(a-b+c)

Submission status: Wrong Answer

Solution code:
def main():
    MOD = 10 ** 9 + 7

    N = int(input())
    ans = pow(10, N, MOD) - pow(9, N, MOD) * 2 + pow(8, N, MOD)
    print(ans)

    # import sys
    # sys.setrecursionlimit = 10 ** 7
    # input = sys.stdin.readline
    # rstrip()
    # (int(x) - 1 for x in input().split())
    pass


if __name__ == '__main__':
    main()

# def binary_search(*, ok, ng, func):
#     while abs(ok - ng) > 1:
#         mid = (ok + ng) // 2
#         if func(mid):
#             ok = mid
#         else:
#             ng = mid
#     return ok

Submission status: Wrong Answer

Solution code:
def solve():
    N = int(input())
    MOD = 10**9+7
    U = pow(10,N,MOD)
    inc_zero = U - pow(9,N,MOD)
    inc_nine = inc_zero

    inc_both = U - pow(8,N,MOD)

    print(inc_zero+inc_nine-inc_both % MOD)

if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
def func(a, n):
    p = 10 ** 9 + 7
    bi = str(format(n, "b"))
    res = 1
    for i in range(len(bi)):
        res = (res*res) % p
        if bi[i] == "1":
            res = (res*a) % p
    return res


N = int(input())
n = func(10, N)
no_0 = func(9, N)
no_9 = func(9, N)
no_09 = func(8, N)
ans = (n - no_0 - no_9 + no_09)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
mod = (10 ** 9 )+ 7

def f(a,n):
	mod = (10 ** 9 )+ 7
	
	if n == 0:
		return 1
	t = f(a,n/2) % mod
	return ((t ** 2) * (a if n%2 else 1)) %mod

print f(10,n) - f(9,n) - f(9,n) + f(8,n)

Submission status: Wrong Answer

Solution code:
N = int(input())
out = (10**N % (10**9+7) - 2*9**N % (10**9+7) + 8**N % (10**9+7))
print(out)

Submission status: Wrong Answer

Solution code:
N=int(input())
if(N==1):
  print(0)
else:
  result = (-7)**(N-2) if(N%2==0)else 1000000007-7**(N-2)
  print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n == 1:
    print(0)
else:
    mod = pow(10, 9) + 7
    ans = (n*(n-1)*pow(10, n-2)) % mod
    print(ans)

Submission status: Wrong Answer

Solution code:
"""
    こんにちは。これはクシャルです
    
    Author : thekushalghosh (クシャル)
    Team   : CodeDiggers
 
    I prefer Python language over the C++ language :p :D
        
    Visit my website : thekushalghosh.github.io
"""
import sys,math,cmath,time
start_time = time.time()
##########################################################################
################# ---- THE ACTUAL CODE STARTS BELOW ---- #################
    
def solve():
    n = inp()
    print((pow(10,n,1000000007) - pow(9,n,1000000007) - pow(9,n,1000000007)) + pow(8,n,1000000007) % 1000000007)
    
################## ---- THE ACTUAL CODE ENDS ABOVE ---- ##################
##########################################################################
 
def main():
    global tt
    if not ONLINE_JUDGE:
        sys.stdin = open("input.txt","r")
        sys.stdout = open("output.txt","w")
    t = 1
    for tt in range(t):
        solve()
    if not ONLINE_JUDGE:
        print("Time Elapsed :",time.time() - start_time,"seconds")
        sys.stdout.close()
    
#---------------------- USER DEFINED INPUT FUNCTIONS ----------------------#
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    return(input().strip())
def invr():
    return(map(int,input().split()))
 
#------------------ USER DEFINED PROGRAMMING FUNCTIONS ------------------#
def counter(a):
    q = [0] * max(a)
    for i in range(len(a)):
        q[a[i] - 1] = q[a[i] - 1] + 1
    return(q)

def counter_elements(a):
    q = dict()
    for i in range(len(a)):
        if a[i] not in q:
            q[a[i]] = 0
        q[a[i]] = q[a[i]] + 1
    return(q)

def string_counter(a):
    q = [0] * 26
    for i in range(len(a)):
        q[ord(a[i]) - 97] = q[ord(a[i]) - 97],1
    return(q)
 
def factors(n):
    q = []
    for i in range(1,int(n ** 0.5) + 1):
        if n % i == 0: q.append(i); q.append(n // i)
    return(list(sorted(list(set(q)))))
 
def prime_factors(n):
    q = []
    while n % 2 == 0: q.append(2); n = n // 2
    for i in range(3,int(n ** 0.5) + 1,2):
        while n % i == 0: q.append(i); n = n // i
    if n > 2: q.append(n)
    return(list(sorted(q)))

def transpose(a):
    n,m = len(a),len(a[0])
    b = [[0] * n for i in range(m)]
    for i in range(m): 
        for j in range(n): 
            b[i][j] = a[j][i]
    return(b)

#-----------------------------------------------------------------------#
        
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
    input = sys.stdin.readline
main()

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = int(((10 ** (n - 2)) * ((n - 1) * n)) % ((10 ** 9)+ 7))
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
mod = 10**9 + 7
ans = 10**n % mod
ans -= (2 * 9**n) % mod
ans += (8**n) % mod

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
if N == 1:
    ans = 0
elif N>=2:
    ans = 2**N - 2
print(ans%(10**9+7))

Submission status: Wrong Answer

Solution code:
import sys
N= int(input())
if N==1:
    print(0)
    sys.exit()
if N>=2:
    a=10
    b=9
    c=8
    for i in range(N-1):
        a=a*10%(10**9+7)
        b=b*9%(10**9+7)
        c=c*8%(10**9+7)
print(int(a-2*b+c))

Submission status: Wrong Answer

Solution code:
n = int(input())
print(n*(n-1)*(10**(n-2))%1000000007)

Submission status: Wrong Answer

Solution code:
mod = 10**9+7
n = int(input())
ans = pow(10,n,mod)-2*pow(9,n,mod)+pow(8,n,mod)
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n<2:
  print(0)
else:
  mod=10**9+7
  init=(n*(n-1))%mod
  more=pow(10,n-2,mod)
  print((init*more*2)%mod)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
from collections import deque
from collections import Counter
import math
import itertools

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n = readInt()
if n==1:
	print(0)
	exit()
mod = 10**9+7
a = pow(10,n,mod)
b = pow(8,n,mod)
c = pow(9,n,mod)
print(a-2*c+b)

Submission status: Wrong Answer

Solution code:
N=int(input())
mod=10**9+7
l=[1]*3
for _ in range(N):
    l[0]=(l[0]*10)%mod
    l[1]=(l[1]*9)%mod
    l[2]=(l[2]*8)%mod
ans=l[0]+l[2]-2*l[1]
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = ((10 ** (n - 2)) * ((n - 1) * n)) % ((10 ** 9)+ 7)
print(ans)

Submission status: Wrong Answer

Solution code:
#C
N=int(input())
mod=10**9+7

ans=pow(10,N,mod)-2*pow(9,N,mod)+pow(8,N,mod)

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
from heapq import heappush, heappop, heapify
import math
from math import gcd
import itertools as it
from collections import deque 

input = sys.stdin.readline

def inp():
    return int(input())
def inpl():
    return list(map(int, input().split()))
def dbg(o):
    print(o, file=sys.stderr)

# ---------------------------------------

N = inp()
mod = 10**9 + 7

a = 1
b = 1
c = 1
for _ in range(N):
    a = (a * 10) % mod
    b = (b * 9) % mod
    c = (c * 8) % mod
print(a - 2 * b + c)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# C

import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
input = sys.stdin.readline

# 再起回数上限変更
# sys.setrecursionlimit(1000000)

mod = 10**9 + 7
n = int(input())

ans = pow(10,n,mod)
ans -= pow(9,n,mod)
ans -= pow(9,n,mod)
ans += pow(8,n,mod)

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
N= int(input())
if N==1:
    print(0)
    sys.exit()
if N>=2:
    a=10
    b=9
    c=8
    for i in range(N-1):
        a=a*10%(10**9+7)
        b=b*9%(10**9+7)
        c=c*8%(10**9+7)
print(a-2*b+c)

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    mod = 10 ** 9 + 7
    mod_1 = 1
    mod_2 = 1
    mod_3 = 1
    for _ in range(N):
        mod_1 = (mod_1 * 10) % mod
        mod_2 = (mod_2 * 9) % mod
        mod_3 = (mod_3 * 8) % mod
    print(mod_1 - 2 * mod_2 + mod_3)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a=int(input())
b=(a%(1000000007))*(a-1%(1000000007))
c=10**(a-2)
c=c%1000000007
d=(b*c)%1000000007
if a==1:
    print(0)
else:
    print(d)

Submission status: Wrong Answer

Solution code:
#coding:utf-8

N = int(input())

ron = 10 ** 9 + 7

a = (10 ** N) % ron

b = (9 ** N) % ron

c = (9 ** N) % ron 

bandc = (8 ** N) % ron

ans = a - b - c + bandc

print("{}".format(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0
if (N == 1):
    ans = 0
else:
    ans = 1
    for i in range(N-2):
        ans = ans * 10
        ans = ans % (10 ** 9 + 7)


ans = ans * N
ans = ans % (10 ** 9 + 7)
ans = ans * (N-1)
ans = ans % (10 ** 9 + 7)

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
val1 = 10
val2 = 9
val3 = 8
for i in range(n-1):
    val1 = (val1*10)%(10**9+7)
    val2 = (val2*9)%(10**9+7)
    val3 = (val3*8)%(10**9+7)
print(val1-2*val2+val3)

Submission status: Wrong Answer

Solution code:
n = int(input())
num = 10**9 + 7
print(10**n % num - (9**n%num)*2 + 8**n%num)

Submission status: Wrong Answer

Solution code:
n=int(input())
cnt=(10**n+8**n-2*(9**n))//(10**9+7)

Submission status: Wrong Answer

Solution code:
## for use in beginner level questions where speed is key
## and also for single test case code
## mastercopy for x,y,z

import sys
import heapq, functools, collections
import random
from collections import Counter, defaultdict

# read line as a string
# strr = input()

# read line as an integer
k = int(input())

# read one line and parse each word as a string
# lst = input().split()

# read one line and parse each word as an integer
# arr = list(map(int,input().split()))

if k == 1:
    print(0)
    sys.exit()

# if k == 2:
#     print(2)
#     sys.exit()

res = 0
MOD = 10**9 + 7

have_all = pow(10,k,MOD)
dont_have_0 = pow(9,k,MOD)
dont_have_9 = pow(9,k,MOD)
dont_have_09 = pow(8,k,MOD)

print(have_all - dont_have_0 - dont_have_9 + dont_have_09)

Submission status: Wrong Answer

Solution code:
MOD = 10**9 + 7
N = int(input())
print(pow(10, N, MOD) + pow(8, N, MOD) - 2*pow(9, N, MOD))

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = (n * (n-1) * 10**(n-2))%(10**9+7)
print(ans)

Submission status: Wrong Answer

Solution code:
mod = 10**9+7
n = int(input())
pow(10,n,mod)-2*pow(9,n,mod)+pow(8,n,mod)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n == 1:
    print(0)
    exit()
mod = pow(10, 9) + 7
print((pow(10, n, mod) - ((pow(9, n, mod) * 2) % mod  - pow(8, n, mod)) % mod))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
#a, b, c, d = map(int,input().split())
n=int(input())
ans=1
MOD=10**9+7
a=1
b=1
c=1
for i in range(n):
    a*=10
    a%=MOD
    c*=8
    c%=MOD
for i in range(n):
    b*=9
    b%=MOD
print(a-b*2+c)

Submission status: Wrong Answer

Solution code:
n = int(input())
mod = 10**9+7
def pow(x, n):
    res = 1
    while n > 0:
        if n & 1 == 1:
            res *= x
        x *= x
        n >>= 1
    return res
print((pow(10, n)%mod -2*pow(9, n)%mod + pow(8, n)%mod))

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = (10**N % (10**9+7)) - (2 * 9**N % (10**9+7)) + (8**N % (10**9+7))
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
mod = 10** + 7
if N == 1:
  print(0)
else:
  ans = N*10**(N-2)
  print(ans%mod)

Submission status: Wrong Answer

Solution code:
n=int(input())
p=1
q=1
r=1
for i in range(n):
    p=p*10
    q=q*9
    r=r*8

    if p>=10**9+7:
        p=p%(10**9+7)
    if q>=10**9+7:
        q=q%(10**9+7)
    if r>=10**9+7:
        r=r%(10**9+7)
an = p-2*q+r 
if an >=10**9+7:
    print(an%(10**9+7))
else:
    print(an)

Submission status: Wrong Answer

Solution code:
n = int(input())

def modpow(a, n, mod):
  res = 1
  while n > 0:
    if n & 1:
      res = res * a % mod
    a = a * a % mod
    n >>= 1
  return res

mod = 1000000007
ans = modpow(10, n, mod) - (modpow(9, n, mod) + modpow(9, n, mod) - modpow(8, n, mod))
print(ans)

Submission status: Wrong Answer

Solution code:
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools


#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]
#CW = [list(map(int, list(input()))) for _ in range(H)]


N = int(input())
mod = 10**9+7
ans = 0
ten = 1
nine = 1
eight = 1

for i in range(N):
  ten = (10*ten)%mod
  nine = (9*nine)%mod
  eight = (8*eight)%mod

neight = 2*nine - eight

if(neight<0):
  neight += mod

ans = ten - neight

if(ans<0):
  ans += mod

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
print(pow(10,N,1000000007)-pow(9,N,1000000007)-pow(9,N,1000000007)+pow(8,N,1000000007))

Submission status: Wrong Answer

Solution code:
N = int(input())
mod = 10**9+7
a = pow(10,N,mod)
b = pow(8,N,mod)
c = pow(9,N,mod)
ans = a-2*c+b
if ans<0:
    ans += mod
else:
    ans %= mod
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
mod = 10 ** 9 + 7

factorials = [1]
for i in range(1, n + 1):
    factorials.append((factorials[-1]) * i % mod)

print(pow(10, n, mod) - pow(9, n, mod) - pow(9, n, mod) + pow(8, n, mod))

Submission status: Wrong Answer

Solution code:
n=int(input())
if n==1:
    print(0)
else:
    num=0
    k=2
    l=8**(n-1)
    for i in range(2,n+1):
        k*=2
        l//=8
        num+=(k-2)*l
        num%=(10**9+7)
    print(num%(10**9+7))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import math


def main():
    n = int(input())
    mod = 10**9 + 7
    if n == 1:
        ans = 0
    else:
        ans = (math.factorial(n) * (10 ** (n - 2))) % mod
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 1:
    print(0)
else:
    a = 10**N % (10**9+7)
    b = 2*9**N % (10**9+7)
    c = 8**N % (10**9+7)
    print(a-b+c)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n == 1:
    print(0)
    exit()
mod = pow(10, 9) + 7
print(pow(10, n, mod) - (pow(9, n, mod) * 2  - pow(8, n, mod)))

Submission status: Wrong Answer

Solution code:
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
MOD=10**9+7
#======================================================#
def main():
    n = II()
    sumv10 = 1
    for _ in range(n):
        sumv10 *= 10
        sumv10 %= MOD
    sumv9 = 1
    for _ in range(n):
        sumv9 *= 9
        sumv9 %= MOD
    sumv9 *= 2
    sumv8 = 1
    for _ in range(n):
        sumv8 *= 8
        sumv8 %= MOD
    print(sumv10 - sumv9 + sumv8)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
p=10**9+7
def pow(x, n):
    res = 1
    while n > 0:
        if n & 1 == 1:
            res *= x
        x *= x
        res = res%p
        n >>= 1
    return res

n=int(input())
print(pow(10,n)-2*pow(9,n)+pow(8,n))

Submission status: Wrong Answer

Solution code:
N = int(input())
INF = 10**9+7
t = 1
e = 1
n = 1
for i in range(N):
  t = (t*10)%INF
  e = (e*8)%INF
  n = (n*9)%INF
print(t-2*n+e)

Submission status: Wrong Answer

Solution code:
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
# def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n=I()
  if n==1:
    return 0
  ans=10
  a=9
  b=9
  c=8
  for _ in range(n-1):
    ans*=10
    ans%=mod
    a*=9
    a%=mod
    b*=9
    b%=mod
    c*=8
    c%=mod

  return ans-(a+b-c)

# main()
print(main())

Submission status: Wrong Answer

Solution code:
N = int(input())

s = 1
z = 1
n = 1
zn = 1
e = 10 ** 9 + 7

for i in range(N):
    s = s * 10 % e
    z = z * 9 % e
    n = n * 9 % e
    zn = zn * 8 % e

result = s - z - n + zn

if result < 0:
    result += e

print(result)

Submission status: Wrong Answer

Solution code:
def pf(a,n,p):
    bi = str(format(n,"b"))
    res = 1
    for i in range(len(bi)):
        res = (res*res) %p
        if bi[i] == "1":
            res = (res*a) %p
    return res

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

ans=pf(10,N,mod)-pf(9,N,mod)*2+pf(8,N,mod)

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
mod0 = 10**9+7
if N==1:
    print(0)
else:
    ans = N*(N-1)
    for _ in range(N-2):
        ans = (ans*10)%mod0
    print(ans)

Submission status: Wrong Answer

Solution code:
MOD = 10**9 + 7
n = int(input())

def pow(x, n):
    res = 1
    while n > 0:
        if n & 1:
            res = res * x % MOD
        
        x = x**2 % MOD
        n >>= 1
    return res

print(pow(10,n) - pow(9,n)*2 + pow(8,n))

Submission status: Wrong Answer

Solution code:
# region header
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
import copy
# @lru_cache(maxsize=None)
# sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7
# endregion
# region input function


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])


# endregion


n = inp()
ans = pow(10, n, mod) - 2 * pow(9, n, mod) + pow(8, n, mod)
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
if n<2:
  print(0)
else:
  mod=10**9+7
  init=(n*(n-1))%mod
  more=pow(10,n-2,mod)
  print((init*more)%mod)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python

n = int(input())
mod = 10**9+7

tot = 10**n

inc0 = (tot - 9**n)%mod
inc9 = (tot - 9**n)%mod
inc0or9 = (tot - 8**n)%mod

ans = inc0+inc9-inc0or9
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = (((n - 1) ** 8 % 1000000007) * (2 * n - 1)) % 1000000007
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
mod = 10**9 + 7

a = ((10**(N))%mod - 2*(9**(N))%mod + (8**N)%mod)
print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())

def pow(x, n):
    ans = 1
    n_tmp = n
    while n:
        if n % 2:
            ans *= x
            ans %= mod
        x *= x
        n >>= 1
    return ans


mod = 10**9+7 #出力の制限

a = pow(8, n) # 0,9を含まない
b = pow(9, n) # 0 or 9 のどちらかを含む
c = pow(10, n) # 全て
ans = c-2*b+a
if ans < 0:
    ans += mod
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
print(pow(10,n,10**9+7)-2*pow(9,n,10**9+7)+pow(8,n,10**9+7))

Submission status: Wrong Answer

Solution code:
n=int(input())
print((n*(n-1)*10**(n-2))%1000000007)

Submission status: Wrong Answer

Solution code:
n = int(input())
mod = 10**9 + 7

ans = pow(10,n,mod) - pow(9,n,mod)*2 + pow(8,n,mod)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
mod = 10**9+7
a = pow(10, n, mod)
b = pow(9, n, mod)
c = pow(8,n,mod)
ans = a-2*b+c
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

def main():
    n = int(input())
    if n == 1:
        ans = 0
    else:
        mod = pow(10, 9)+7
        ans = pow(10, n, mod) + pow(8, n, mod) - 2*pow(9, n, mod)
    print(ans)


    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
ans_max = 1
for i in range(n):
    ans_max = ans_max * 10 % 1000000007


ans_mid = 1
for i in range(n):
    ans_mid = ans_mid * 9 % 1000000007
ans_mid = ans_mid * 2 % 1000000007

ans_min = 1
for i in range(n):
    ans_min = ans_min * 8 % 1000000007
print(ans_max - (ans_mid - ans_min))

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time, copy

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()
if n == 1:
    print(0)
else:
    print(pow(10, n, mod)-(2 * pow(9, n, mod) - pow(8, n, mod)))

Submission status: Wrong Answer

Solution code:
n = int(input())
mod = 10**9 + 7
print(pow(10,n,mod) - 2*pow(9,n,mod) + pow(8,n,mod))

Submission status: Wrong Answer

Solution code:
n=int(input())
k=10**9+7
ans=(10**n)%k-(8**n)%k
print(ans%k)

Submission status: Wrong Answer

Solution code:
n = int(input())

def pow(x, n):
    ans = 1
    n_tmp = n
    while n:
        if n % 2:
            ans *= x
            ans %= mod
        x *= x
        n >>= 1
    return ans


mod = 10**9+7 #出力の制限

a = pow(8, n) # 0,9を含まない
b = pow(9, n) # 0 or 9 のどちらかを含む
c = pow(10, n) # 全て
print(c-2*b+a)

Submission status: Wrong Answer

Solution code:
N = int(input())
MOD = 10**9 + 7
if N<=1:
  print(0)
  
else:
  all_num = pow(10, N, MOD)
  ans = all_num - 2 * pow(9, N, MOD) + pow(8, N, MOD)
  print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
p = 10 ** 9 + 7

def pow(a):
  ans  = 1
  for i in range(n):
    ans = (ans * a) % p
  return ans
x = pow(10) - pow(9) * 2 + pow(8)

print(x)

Submission status: Wrong Answer

Solution code:
mod=10**9+7
def Ch(n,r):
  res=1
  for i in range (n,n-r,-1):
    res*=(i%mod)
    res%=mod
  return res

n=int(input())
ans=0
for zero in range(1,9):
  for nine in range(1,10-zero):
    ans+=((Ch(n,zero)*Ch(n-zero,nine))%mod)*(8**(n-zero-nine)%mod)
    ans%=mod
print(ans)

Submission status: Wrong Answer

Solution code:
mod = 10**9+7
N = int(input())
if N == 1:
    print(0)
    exit()
plus = 1
minus = 1
cap = 1
for _ in range(N):
    plus *= 10
    minus *= 9
    cap *= 8
    plus %= mod
    minus %= mod
    cap %= mod
print(plus-2*minus+cap)

Submission status: Wrong Answer

Solution code:
MOD = int(1e9+7)

N = int(input())
answer = pow(10, N, MOD)
answer -= pow(9, N, MOD) * 2
answer += pow(8, N, MOD)
print(answer)

Submission status: Wrong Answer

Solution code:
import sys

MOD = 10 ** 9 + 7


def main():
    input = sys.stdin.buffer.readline
    n = int(input())
    print(pow(10, n, MOD) - (pow(9, n, MOD) * 2 - pow(8, n, MOD)) % MOD)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
mod = 10 ** 9 + 7
n = int(input())
print(pow(10, n, mod) - pow(9, n, mod) * 2 + pow(8, n, mod))

Submission status: Wrong Answer

Solution code:
mod = 10 ** 9 + 7
n = int(input())
all = pow(10, n, mod)
each = pow(9, n, mod)
non = pow(8, n, mod)
print(all - 2 * each + non)

Submission status: Wrong Answer

Solution code:
n = int(input())
mod = (10 ** 9 + 7)
s = 10 ** n % mod
t = 9 ** n % mod
u = 8 ** n % mod
print(s - t * 2 + u)

Submission status: Wrong Answer

Solution code:
n = int(input())

MOD = 10**9 + 7

allp = pow(10,n,MOD)
not09 = 2*pow(9,n,MOD)
closs = pow(8,n,MOD)

print(allp - not09 + closs)

Submission status: Wrong Answer

Solution code:
mod=10**9+7
def Ch(n,r):
  res=1
  for i in range (n,n-r,-1):
    res*=(i%mod)
    res%=mod
  return res

n=int(input())
ans=0
for zero in range(1,9):
  for nine in range(1,10-zero):
    ans+=((Ch(n,zero)*Ch(n-zero,nine))%mod)*(8**(n-zero-nine)%mod)
    ans%=mod

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys

MOD = 1000000007  # type: int


def solve(N: int):
    t = pow(10,N,MOD)- pow(8,N,MOD)
    m = pow(10,N,MOD)- pow(9,N,MOD)
    print(2*m-t)
    return


# 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()

Submission status: Wrong Answer

Solution code:
import sys

MOD = 10 ** 9 + 7


def main():
    input = sys.stdin.buffer.readline
    n = int(input())
    print(pow(10, n, MOD) - (pow(9, n, MOD) * 2 - pow(8, n, MOD)))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
mod = 10**9 + 7
print(pow(10, n, mod) - pow(9, n, mod) - pow(9, n, mod)  + pow(8, n, mod))

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
ans += 8**(n-2) % (10**9 + 7)
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
mod=10**9+7
if n==1:
  print(0)
else:
  ans=pow(10,n,mod)-(2*pow(9,n,mod)-pow(8,n,mod))
  print(ans)

Submission status: Wrong Answer

Solution code:
#create date: 2020-09-13 21:03

import sys
stdin = sys.stdin

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

def pow(a, n, p):
    bi = str(format(n, "b"))
    res = 1
    for i in range(len(bi)):
        res = (res * res) % p
        if bi[i] == "1":
            res = (res * a) % p
    return res

def main():
    n = ni()
    mod = 10**9 + 7
    # pow(base, exp[, mod])
    print(pow(10, n, mod) - 2*pow(9, n, mod) + pow(8, n, mod))

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N=int(input())
mod = 10**9+7

print(pow(10,N,mod)-2*pow(9,N,mod)+pow(8,N,mod))

Submission status: Wrong Answer

Solution code:
# AtCoder用のライブラリ
# 参照
# https://qiita.com/drken/items/3b4fdf0a78e7a138cd9a


# a ** n mod m
def mod_pow(a, n, m=10 ** 9 + 7):
    res = 1
    while n > 0:
        if n & 1 == 1:
            res = res * a % m
        a = a * a % m
        n >>= 1
    return res


N = int(input())

ALL = mod_pow(10, N)
side = mod_pow(9, N)
none = mod_pow(8, N)

print(ALL - side * 2 + none)

Submission status: Wrong Answer

Solution code:
n=int(input())
M=10**9+7
print((pow(10,n,M)-pow(8,n,M))%M)