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:
#C
n = int(input())
mod = 10**9+7

ans = (10**n%mod-9**n%mod)*2%mod-(10**n%mod-8**n%mod)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans1 = 10 ** (n-2)
ans2 = n * (n-1)
mod = 10**9 + 7
final_answer = int(ans1 * ans2 % mod)

print(final_answer)

Submission status: Wrong Answer

Solution code:
N=869121

if N<2:
	print(0)

else:
	without=10**(N-2)
	considered=(without+2)*(without+1)
	considered=considered%(1000000007)
	print(considered)

Submission status: Wrong Answer

Solution code:
def powmod(a, n, p):
    if(n==0):
        return 1
    elif(n==1):
        return a%p
    elif(n%2==1):
        return ((a%p)*(powmod(a,n//2,p)**2%p))%p
    elif(n%2==0):
        return powmod(a,n//2,p)**2%p
N=int(input())
if(N==1):
  print(0)
else:
  print(powmod(10,N-2,10**9+7))

Submission status: Wrong Answer

Solution code:
import sys

sys.setrecursionlimit(2000)

N = int(input())

mod = 1000000007

def power(x, y):
    if   y == 0     : return 1
    elif y == 1     : return x % mod
    elif y % 2 == 0 : return power(x, y//2)**2 % mod
    else            : return power(x, y//2)**2 * x % mod

a = power(10, N)
b = power(9, N)
c = power(8, N)

print((a%mod)-(b%mod)-(b%mod)+(c%mod))

Submission status: Wrong Answer

Solution code:
N = int(input())

x = 10**9 + 7

a = 10**N % x
b = 2 * 9**N % x
c = 8**N % x

ans = a-b+c

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import comb
t = int(input())
mod = 10**9 + 7
ans = 0

for i in range(1, t):
    ans = (ans + comb(t,i)%mod)%mod
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

mod = 1000000007
a = 1
b = 1
w = 1
for i in range(n):
  a *= 9
  a %= mod
  b *= 8
  b %= mod
  w *= 10
  w %= mod

ans = w - (a * 2 - b)
if ans < 0:
  ans += mod
print(ans)

Submission status: Wrong Answer

Solution code:
from scipy.special import comb

N = int(input())
if N < 2:
  print(0)
elif N == 2:
  print(1)
else:
  ans = 10 ** (N - 2) % (10 ** 9 + 7)
  ans *= comb(N, 2, exact=True) * 2 % (10 ** 9 + 7)
  print(ans)

Submission status: Wrong Answer

Solution code:

N = int(input())

tmp = N*(N-1)#6
times = N-2#1

ans = (8**(times)*tmp)%(10**9+7)


if N==1:
    ans = 0
elif N==2:
    ans = 2

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

MOD = 10**9 + 7

if N==1:
    print(0)
elif N==2:
    print(2)
else:
    tmp = (N*(N-1))%MOD
    
    ans = pow(10, N-2, MOD)
    
    ans = (ans*tmp)%MOD
        
    print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())

if N<2:
	print(0)

else:
	without=10*(N-2)
	considered=(without+2)*(without+1)
	considered%=10**9+7
	print(considered)

Submission status: Wrong Answer

Solution code:
N = int(input())

ANS = N * (N - 1) / (10 ** 9 + 7)

print(ANS)

Submission status: Wrong Answer

Solution code:
N=int(input())

def genCombinationFunction(max_k,mod):
    modinv_table = [-1] * (max_k+1)
    modinv_table[1] = 1
    for i in range(2, max_k+1):
        modinv_table[i] = (-modinv_table[mod % i] * (mod // i)) % mod

    def binomial_coefficients(n, k):
        ans = 1
        for i in range(k):
            ans *= n-i
            ans *= modinv_table[i + 1]
            ans %= mod
        return ans
    return binomial_coefficients
  
ans=0
if N<2:
  print(0)
  exit(0)
ans+=1
mod=10**9+7

f=genCombinationFunction(10**6,mod)
for i in range(N-2):
  ans*=10
  ans%=mod
def fun(n):
  ret=0
  for i in range(n+1):
    ret+=i
  return ret
print(ans*2*f(N,2)%(10**9+7))

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)) % mod)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=1
mod=1000000007
ans*=n
ans%=mod
ans*=(n-1)
ans%=mod
for i in range(n-2):
    ans*=10
    ans%=mod
print(ans%mod)

Submission status: Wrong Answer

Solution code:
n = int(input(''))

mod = 1000000007

cnt_all= 10**n
cnt_90=8**n
cnt_9=9**n
cnt_0=9**n
cnt=cnt_all + cnt_90 - cnt_9 - cnt_0
#print("{} - {} - {} + {} = {}".format(cnt_all,cnt_9,cnt_0,cnt_90,cnt))
print(cnt)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
MOD=1000000007
x = int(input())
n1 = (10**x)%MOD
n2 = 2*9**x%MOD
n3 = 8**x%MOD
n = n1-n2+n3
print(int(n))

Submission status: Wrong Answer

Solution code:
n = int(input())

if n <= 1:
  ans = 0
else:
  ans = (n*(n - 1)*(10 ** (n - 2))) % 1000000007
  
print(ans)

Submission status: Wrong Answer

Solution code:

import math

n = int(input())

mod = 10**9 + 7
kaijou = math.factorial(n)
tmp = 10**(n-2)

if n == 1:
    print('0')
elif n == 2:
    print('2')
else:
    ans = kaijou * tmp % mod
    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n > 1:
    print((10**n) % (10**9 + 7) - (9**n * 2 - 8**n) % (10**9 + 7))
else:
    print("0")

Submission status: Wrong Answer

Solution code:
N=int(input())

if N<2:
	print(0)

else:
	without=10*(N-2)
	considered=(without+2)*(without+1)
	print(considered%(10**9+7))

Submission status: Wrong Answer

Solution code:
N = int(input())
s = N * (N-1)
p = 10 ** (N-2)
d = s * p
ans = d % (10 ** 9 + 7)
print(ans)

Submission status: Wrong Answer

Solution code:
import itertools
import sys
N = int(input())

if N == 1:
    print(0)
    sys.exit(0)
    
n = list(range(0, 10))
cnt = list(itertools.permutations(n, N))
ans = 0
for c in cnt:
    x = c.count(0)
    y = c.count(9)
    if x != 0 and y != 0:
        ans += 1
        
print(ans%((10**9)+7))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
MOD=1000000007
x = int(input())
n1 = (10**x)%MOD
n2 = 2*9**x%MOD
n3 = 8**x%MOD
print(n1, n2, n3)
n = n1-n2+n3
print(int(n))

Submission status: Wrong Answer

Solution code:
N=int(input())

x=(10**N)%(10**9+7)
y=(2*(9**N))%(10**9+7)
z=(8**N)%(10**9+7)

print(x-y+z)

Submission status: Wrong Answer

Solution code:
N=int(input())

if N<2:
	print(0)

else:
	without=10*(N-2)
	considered=(without+2)*(without+1)
	print(considered)

Submission status: Wrong Answer

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

MOD = 1000000007  # type: int


def solve(N: int):
    return print(N*10**(N-2)%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()

Submission status: Wrong Answer

Solution code:
def power_func(a,n,p):
    bi = str(format(n,"b"))#2進表現に
    res = 1
    for i in range(len(bi)):
        res = (res*res) %p
        if bi[i] == "1":
            res = (res*a) %p
    return res
p=10**9+7
n=int(input())
print(power_func(10,n,p)-power_func(9,n,p)-power_func(9,n,p)+power_func(8,n,p))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
print('{}'.format((2**N-2)%(10**9+7)))

Submission status: Wrong Answer

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

MOD = 1000000007  # type: int


def solve(N: int):
    return N*10**(N-2)%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()

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
def main():
    N = int(input())
    M = 10**9 + 7
    if N == 1:
        print(0)
        return
    ans = 0
    ans = 10**N - (9**N)*2 + 8**N - 2
    print(ans%M)    

if __name__ == '__main__':
    main()

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
    if n == 1:
        print(0)
    
    print((pow(10, n, mod) - 2*pow(9, n, mod) + pow(8, n, mod))%mod)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
# (0.9)確定以外のAnの場合の数 * [(0.9), (9,0)]の２通り * [(0,9),(9,0)]の場合の数
ans = (10 ** (N - 2) * 2 * (N - 1)) % (10 ** 9 + 7) 
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 13 21:20:10 2020

@author: naoki
"""

N = int(input())

if N>=2:
    print(abs(10**N%(10**9+7) - ((9**N *2)%(10**9+7) - (8**N)%(10**9+7))))
else: 
    print(0)

Submission status: Wrong Answer

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

max = (10**n)%mod
a = 8**n%mod
b = 9**n%mod
no09 = a
nine_in = (b - a)%mod
zero_in = (b - a)%mod

ans = abs(max - no09 - nine_in - zero_in)
print(ans)

Submission status: Wrong Answer

Solution code:
n = 869121
a = 10 ** n - 2 * 9 ** n + 8 ** n
print(a % (10 ** 9 + 7))

Submission status: Wrong Answer

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

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)
if ans < 0:
    ans += 10 ** 9 + 7
print(ans)

Submission status: Wrong Answer

Solution code:
def pow_r(x, n):
    if n == 0:  # exit case
        return 1
    if n % 2 == 0:  # standard case ① n is even
        return pow_r(x ** 2, n // 2)%(10**9+7)
    else:  # standard case ② n is odd
        return x * pow_r(x ** 2, (n - 1) // 2)%(10**9+7)
n=int(input())
print(pow_r(10,n)-pow_r(9,n)-pow_r(9,n)+pow_r(8,n))

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())
ans = (n*(n-1)*10**(n-2))%(10**9+7)

if n == 1:
  print(0)
elif n ==2:
  print(2)
else:
  print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
"""
int(input())
map(int, input().split())
list(map(int, input().split()))
input()
input().split()
"""


n = int(input())
mod = 1000000007
tmp = (10**n)%mod
diff = 2*(9**n)%mod
eight = (8**n)%mod

ans = tmp - diff + eight
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
if n == 1:
    print(0)
else:
    print(10**(n-2)*(math.factorial(n))%(10**9+7))

Submission status: Wrong Answer

Solution code:
n = int(input())
if n > 1:
    print((10**n) % (10**9 + 7) - (9**n * 2) % (10**9 + 7) + (8**n) % (10**9 + 7))
else:
    print("0")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input(''))-1

mod = 1000000007

cnt= (10**n - 8**n)%mod
#print("{} - {} = {}".format(10**n,8**n,cnt))
print(cnt)

Submission status: Wrong Answer

Solution code:
inf = pow(10,9)+ 7

n=int(input())
if n==1:
  print(0)
elif n==2:
  print(1)
else:
  f=pow(10,n,inf) - 2*pow(9,n,inf) + pow(8,n,inf)
  print(f%inf)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
x = (math.factorial(n)*10**(n-2))%(10**9+7)
print(x)

Submission status: Wrong Answer

Solution code:
N = int(input())


res = N*(N-1)*(10**(N-2))
ress = res % ((10**9)+7)
print(ress)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
if N == 1:
  A = 0
else:
  A = math.factorial(N) / math.factorial(N -2)
  a = A % ((10 ** 9) + 7)
print(int(A))

Submission status: Wrong Answer

Solution code:
x = int(input())
if x < 2:
  print(0)
  exit(0)
if x == 2:
  print(2)
ans = (2*((x-2)*10)) % 1000000007
print(ans)

Submission status: Wrong Answer

Solution code:
def power_func(a,n,p):
    bi = str(format(n,"b"))#2進表現に
    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())

a1 = power_func(10,N,10**9+7)
a2 = power_func(9,N,10**9+7)
a3 = power_func(8,N,10**9+7)
if a1 - 2 * a2 + a3 >= 0:
    print(a1 - 2 * a2 + a3)
else:
    print(a1 - 2 * a2 + a3 + 10**9 + 7)

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())
mod=10**9+7
if n<2:
    ans=0
else:
    ans=pow(10,n,mod)-pow(9,n,mod)-pow(9,n,mod)+pow(8,n,mod)
print(ans)

Submission status: Wrong Answer

Solution code:
def c_ubiquity(MOD=1000000007):
    N = int(input())
    ans = N * (N - 1)
    ans *= pow(10, N - 2, MOD)
    return ans % MOD

print(c_ubiquity())

Submission status: Wrong Answer

Solution code:
N = int(input())

mod = 10**9+7

if N == 1:
    print(0)
elif N == 2:
    print(1)
else:
    tmp = (2*(pow(10,N,mod)-pow(9,N,mod))-(pow(10,N,mod)-pow(8,N,mod)))
    print(tmp)

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    def input():
        return sys.stdin.readline()[:-1]
    N=int(input())
    mod=1000000007

    def aaa(a,b,p):
        if b==0:
            return 1
        elif b%2==0:
            d=aaa(a,b/2,p)
            return (d*d)%p
        else:
            return (a*aaa(a,b-1,p))%p
    print(aaa(10,N,mod)-2*aaa(9,N,mod)+aaa(8,N,mod))

   




if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    n = II()
    print(pow(10, n, mod) - pow(9, n, mod) * 2 + pow(8,n,mod))
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
arr_len = int(input())

mod = 10**9 + 7

cnt = (arr_len % mod) * ((arr_len - 1) % mod)
cnt %= mod

for i in range(arr_len - 2):
    cnt *= 10
    cnt %= mod

print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N==1:
    print(0)

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

Submission status: Wrong Answer

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

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())
a = 10**9 +7
b = pow(10,n,a) + pow(8,n,a) - 2 * pow(9,n,a)
if b >= 0:
    print(b)
else:
    print(b+a)

Submission status: Wrong Answer

Solution code:
N=int(input())
P=10**9+7
s_10=1
for i in range(N):
  s_10=(s_10*10)%P
s_9=1
for i in range(N):
  s_9=(s_9*9)%P
s_9=(s_9*2)%P
s_8=1
for i in range(N):
  s_8=(s_8*8)%P
print (s_10-s_9+s_8)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

result = N * (N-1)

print(result % 1000000007)

Submission status: Wrong Answer

Solution code:
N = int(input())

mod = 1000000007

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
mod=10**9+7
# x ** a をmodで割った余りを、O(log(a))時間で求める。
def power(x, a):
    if a == 0:
        return 1
    elif a == 1:
        return x
    elif a % 2 == 0:
        return power(x, a//2) **2 % mod
    else:
        return power(x, a//2) **2 * x % mod

# xの逆元を求める。フェルマーの小定理より、 x の逆元は x ^ (mod - 2) に等しい。計算時間はO(log(mod))程度。
# https://qiita.com/Yaruki00/items/fd1fc269ff7fe40d09a6
def modinv(x):
    return power(x, mod-2)

def binomial_coefficients(n, k):
    numera = 1  # 分子
    denomi = 1  # 分母

    for i in range(k):
        numera *= n-i
        numera %= mod
        denomi *= i+1
        denomi %= mod
    return numera * modinv(denomi) % mod

ans=0
for i in range(1,n):
    for j in range(1,n-i+1):
        ans=binomial_coefficients(n,i)*binomial_coefficients(n-i,j)*(8**(n-i-j))
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
def power_func(a,n,p):
    bi = str(format(n,"b"))#2進表現に
    res = 1
    for i in range(len(bi)):
        res = (res*res) %p
        if bi[i] == "1":
            res = (res*a) %p
    return res
if n == 1:
    print(0)
else:
    mod = 10**9+7
    print(power_func(10, n, mod)-(power_func(9, n, mod)*2-power_func(8, n, mod)))

Submission status: Wrong Answer

Solution code:
def power_func(a,n,p):
    bi = str(format(n,"b"))#2進表現に
    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())

a1 = power_func(10,N,10**9+7)
a2 = power_func(9,N,10**9+7)
a3 = power_func(8,N,10**9+7)
print(a1 - 2 * a2 + a3)
#10**N - 2 * 9 ** N + 8 **N

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def solve(*args: str) -> str:
    n = int(args[0])
    mod = 10**9+7

    return str(pow(10, n, mod)-2*pow(9, n, mod)+pow(8, n, mod))


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Wrong Answer

Solution code:
n = int(input())
if n==1:
  print(1)
elif n==2:
  print(2)
else:
  print(((10**n-2*9**n+8**n))%(10**9+7))

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
mod=10**9+7
if n>=2:
    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:
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



N = int(input())
mod = 10**9+7
if N==1:
    print(0)
else:
    temp =modpow(10,N-2,mod)
    print (temp*N*(N-1)%mod)

Submission status: Wrong Answer

Solution code:
x = input()
N = int(x)

if N == 1:
    print(0)
else:
    z = 10**N - 2*9**N + 8**N
    print(z)

Submission status: Wrong Answer

Solution code:
mod = 1000000007

N = int(input())

A = 1
B = 1
C = 1

for _ in range(1,N+1):
  A *= 10
  A %= mod
  B *= 9
  B %= mod
  C *= 8
  C %= mod

ans = A - (2*B - C)

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 1:
    print(0)
elif N == 2:
    print(2)
else:
    aaa = N - 2
    bbb = (10 ** aaa) * 2
    ccc = bbb % (10**9 + 7)
    print(ccc)

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def resolve():
    from itertools import permutations
    n = int(input())
    RES = 10 ** 9 + 1
    ans = 0
    ls = list(permutations(list(range(10)), n))

    for l in ls:
        if 0 in l and 9 in l:
            ans += 1
        ans = ans % RES
    print(ans)

resolve()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = 10**9+7
if n==1:
    print(0)
else:
    ans = 1
    b = 1
    c = 1
    for _ in range(n):
        b *= 9
        c *= 8
        b %= a
        c %= a
        ans *= 10
        ans %= a
    ans = ans-2*b+c
    if ans<=0:
        ans += a
    print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    if n == 1:
        print(0)
        return 0

    com = n*(n-1)
    print(com*(10**(n-2)) % (int(1e9)+7))
    
    
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**18
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()
    DD = ((1,0),(0,1),(-1,0),(0,-1))

    N = NI()

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


    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n == 1:
    print(0)
    
else:
    total = 1
    _0or9 = 1
    _0and9 = 1
    
    for i in range(n):
        total *= 10
        total %= 10**9 + 7
        
        _0or9 *= 9
        _0or9 %= 10**9 + 7
        
        _0and9 *= 8
        _0and9 %= 10**9 + 7
        
    print(total - 2*_0or9 + _0and9)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
if n==1:
    print(0)
else:
    m = math.factorial(n) // (math.factorial(n - 2) * math.factorial(2))
    if m == 1:
        print(2)
    else:
        print((m-2)*10 % 1000000007)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
from sys import stdin, setrecursionlimit
from collections import Counter, deque, defaultdict
from math import floor, ceil
from bisect import bisect_left
from itertools import combinations
setrecursionlimit(100000)

inf = int(1e10)
mod = int(1e9 + 7)


def solve(N):
    count_all = pow(10, N, mod) - 2 * pow(9, N, mod) + pow(8, N, mod)
    # print(count_all)
    return count_all

def main():
    from builtins import int, map
    N = int(input())

    ans = -1
    if N == 1:
        ans = 0
    elif N == 2:
        ans = 2
    else:
        ans = solve(N)
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

x = n*(n-1)*2*(10**(n-2))

print(x%(10**9 + 7))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
INF = 10**18
sys.setrecursionlimit(10**6)
import itertools as it
import collections as cl
from collections import deque
import math
from functools import reduce
from collections import defaultdict
D = 10 ** 9 + 7

def li():
    return [int(x) for x in input().split()]


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

N = int(input())

total = modpow(10, N, D)
A = total - modpow(9, N, D)
B = total - modpow(9, N, D)
C = total - modpow(8, N, D)

ans = A + B - C
print(ans)

Submission status: Wrong Answer

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

print((10 ** n) % mod - (9 ** n) % mod * 2 + 8 ** n % mod)

Submission status: Wrong Answer

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

dp=[[0,0,0,0] for _ in range(n)]

dp[0]=[0,1,1,0]

for i in range(1,n):
    dp[i][0]=dp[i-1][0]*8%mod
    dp[i][1]=dp[i-1][0]*1%mod+dp[i-1][1]*9
    dp[i][2]=dp[i-1][0]*1%mod+dp[i-1][2]*9
    dp[i][3]=dp[i-1][1]+dp[i-1][2]+dp[i-1][3]*10

#print(dp)

print(dp[-1][3])

Submission status: Wrong Answer

Solution code:
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

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

n = ii()

b = modpow(10,n)
s = modpow(8,n)
m = modpow(9,n)

ans = b - s - 2*(m-s)

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=(10**n+8**n-2*(9**n))//1000000007
print(a)

Submission status: Wrong Answer

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

MOD = 1000000007  # type: int

def solve(N: int):
    a = pow(10, N, MOD)
    b = pow(9, N, MOD)
    c = pow(8, N, MOD)
    return 2 * (a - b) - (a - c)

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
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
    print(solve(N))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
m=10**9+7
if n==1:
    print(0)
else:
    print(((2**(n-1)-2)*10+2)%m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

num = N*(N-1)*(10**(N-2)) % (10**9 +7)
print(num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n == 1:
    print(1)
elif n == 2:
    print(2)
else:
    m = 10**n -2*(9**n) + 8**n
    print(m%(10**9 + 7))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = 10**9+7
if n<2:
    print(0)
else:
    ans = 1
    b = 1
    c = 1
    for _ in range(n):
        b *= 9
        c *= 8
        b %= a
        c %= a
        ans *= 10
        ans %= a
    ans = (ans - 2*b +c)
    if ans<0 :
        ans += a
    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())

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

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)
A = A - (2 * B - C)
if A < 0:
  A = A + mod
print(A)

Submission status: Wrong Answer

Solution code:
N=int(input())%1000000007
print((N^2-N)*(2**(N-2)))

Submission status: Wrong Answer

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