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:
N = int(input())

mod = 10**9 +7

def powmod(x,y):
    res = 1
    for i in range(0,y,1):
        res = (res*x) % mod
    return res


ans = powmod(10,N) - powmod(9,N) - powmod(9,N) + powmod(8,N)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

mod = 10 ** 9 + 7


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


ten = modpow(10, n, mod)
nine = modpow(9, n, mod)
eight = modpow(8, n, mod)

ans = ten - ((nine*2) - eight)


print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
powof10 = 1
powof9 = 1
powof8 = 1
MOD = 10**9+7
for _ in range(n):
    powof10 *= 10
    powof10 %= MOD
    powof9 *= 9
    powof9 %= MOD
    powof8 *= 8
    powof8 %= MOD
print(powof10-2*powof9+powof8)

Submission status: Wrong Answer

Solution code:
N =input()
N = int(N)
M = 10 ** 9 +7
x =  2 * 9 ** N % M
y = 8 ** N % M
z = 10 ** N % M - x + y
print(z)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N =input()
N = int(N)
x = 9 ** N
y = 8 ** N
z = 10 ** N - 2 * x + y
print(z)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

MOD = 10 ** 9 + 7
full = 1
out = 1
extra = 1

for i in range(N):
    full *= 10
    out *= 9
    extra *= 8
    full %= MOD
    out %= MOD
    extra %= MOD

print(full-out-out+extra)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
p = N*(N-1) #0,9の並べ方総数
a = p*(10**(N-2))
b = 10**9 + 7
ans = a % b
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
p = N*(N-1) #0,9の並べ方総数
ans = (p*10**(N-2)) % (10**9+7)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
p = N*(N-1) #0,9の並べ方総数
print(p*10**(N-2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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())
m=10**9+7
print((10**n)%m-(9**n)%m-(9**n)%m+(8**n)%m)

Submission status: Wrong Answer

Solution code:
N = int(input())

_or = 9**N
_and = 8**N
wa = (9**N) * 2 - 8**N
ans = 10**N - wa
print(ans)

Submission status: Wrong Answer

Solution code:
def bekijou(a,x):
  MOD = 1000000007
  ret = 1
  for _ in range(x):
    ret *= a
    ret %= MOD
  return ret
    
n=int(input())
sum = bekijou(9,n)
MOD = 1000000007
ret = (2 * sum) % MOD
ret += MOD - bekijou(8,n)
ret = bekijou(10,n) + MOD - ret
print(ret)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    mod = 10 ** 9 + 7 #素数
    
    def modpow(x, n, mod):
        res = 1
        while n:
            if n % 2:
                res *= x % mod
                res %= mod
            x *= x % mod
            n >>= 1
        return res

    # 全パターン:10 ** n
    all_p = modpow(10, n, mod)
    # 0を含まないパタンーン:9 ** n
    not_0 = modpow(9, n, mod)
    # 9を含まないパターン:9 ** n
    not_9 = modpow(9, n, mod)
    # 0と９を含まないパターン:8 ** n
    not_0_9 = modpow(8, n, mod)
    # 条件のパターン
    ans = all_p - not_0 - not_9 + not_0_9
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    mod = 10 ** 9 + 7 #素数
    
    def modpow(x, n, mod):
        res = 1
        while n:
            if n % 2:
                res *= x % mod
            x *= x % mod
            n >>= 1
        return res % mod

    # 全パターン:10 ** n
    all_p = modpow(10, n, mod)
    # 0を含まないパタンーン:9 ** n
    not_0 = modpow(9, n, mod)
    # 9を含まないパターン:9 ** n
    not_9 = modpow(9, n, mod)
    # 0と９を含まないパターン:8 ** n
    not_0_9 = modpow(8, n, mod)
    # 条件のパターン
    ans = all_p - not_0 - not_9 + not_0_9
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env pypy3
# N,M = map(int,sys.stdin.readline().split())
# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param
# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
# s = sys.stdin.readline().rstrip()
# N = int(sys.stdin.readline())
# INF = float("inf")
import math,sys
P = 1000000007
# 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(sys.stdin.readline())
print(pow(10,N,P)-pow(9,N,P)-pow(9,N,P)+pow(8,N,P))

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())
print((pow(10,N,int(10e9)+7) - 2*pow(9,N,10**9+7) +pow(8, N, 1_000_000_007)) % (pow(10,9) +7))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
m = 10**9+7

def power(x, y, p) : 
    res = 1     # Initialize result 

    x = x % p  
      
    if (x == 0) : 
        return 0
  
    while (y > 0) : 
          
        if ((y & 1) == 1) : 
            res = (res * x) % p 
 
        y = y >> 1      # y = y/2 
        x = (x * x) % p 
          
    return res 

n = int(input())
if n == 1:
    print(0)
elif n==2:
    print(2)
else:
    print(power(10, n, m)-power(9, n, m)-power(9, n, m)+power(8, n, m))

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:
N = int(input())


def ruizyou(x, n, S=1):
    
    S = 1
    for _ in range(n):
        S = (S*x)%(1e9+7)
    
    return S
    
a = int( ruizyou(10, N) + ruizyou(8, N) - ruizyou(9, N)*2 )

print(a%(1e9+7))

Submission status: Wrong Answer

Solution code:
N = int(input())


def ruizyou(x, n, S=1):
    
    S = 1
    for _ in range(n):
        S = (S*x)%(1e9+7)
    
    return S
    
a = int( ruizyou(10, N) + ruizyou(8, N) - ruizyou(9, N)*2 )

print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())

mod = pow(10,9)+7

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
if n == 2:
    print(2)
else:
    if n < 2:
        print(0)
    else:
        print(2*pow(9, n - 2))

Submission status: Wrong Answer

Solution code:
n = int(input())
if n == 2:
    print(2)
else:
    if n < 2:
        print(0)
    else:
        dp = [0, 1, 1, 2]
        for i in range(3, n + 1):
            dp.append(dp[i]*i)

        print(dp[n+1]%(pow(10, 9) + 7))

Submission status: Wrong Answer

Solution code:
n = int(input())

mod = 1000000007
set_non_exist_0 = pow(9, n, mod)
set_non_exist_9 = pow(9, n, mod)
set_non_exist_both = pow(8, n, mod)
print(pow(10, n, mod) - (set_non_exist_0 + set_non_exist_0 - set_non_exist_both) % 1000000007)

Submission status: Wrong Answer

Solution code:
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:
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:
MOD = int(1e9 + 7)
n=int(input())
ans = pow(10, n, MOD)
ans -= 2 * pow(9, n, MOD)
ans += pow(8, n, MOD)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
MOD = 10^9 + 7

N = int(input())

ans = pow(10, N, MOD)
ans -= 2 * pow(9, N, MOD)
ans += pow(8, N, MOD)
ans %= MOD # 最後にMODを取り忘れないように気をつけましょう

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:
    print((10**n%mod)-(9**n%mod)-(9**n%mod)+(8**n%mod))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
mod=10**9+7
def pw(k,t):
    return pow(k,t,mod)

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from collections import deque
from functools import lru_cache
import bisect
import re
import queue
import copy
import decimal


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


def solve():
    N = Scanner.int()
    MOD = 1000000007
    ans = pow(10, N, MOD)
    ans -= pow(9, N, MOD)

    ans -= pow(9, N, MOD)
    ans += pow(8, N, MOD)
    if ans < 0:
        ans += MOD
    print(ans)


def main():
    # sys.setrecursionlimit(1000000)
    # sys.stdin = open("sample.txt")
    solve()
    # T = Scanner.int()
    # for _ in range(T):


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
n=int(input())
MOD = 1000000007
print(10**n%MOD-9**n%MOD*2+8**n%MOD)

Submission status: Wrong Answer

Solution code:
n = int(input())

mod = int(1e9+7)

ans = n**10 - n**9 * 2 - n**8
ans %= mod

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(250000)

from scipy.special import comb
# a = comb(n, r)

def main():
    # a,b,c,d = map(int, input().split())
    n = int(input())

    # temp = (10 ** 9 + 7)
    # sum = 0
    # if n >= 2:
    #     for i in range(2, n+1):
    #         a = int(comb(i, 2)) * 2
    #         a = (a * 8**(i-2)) % temp
    #         sum = sum + a
    # else:
    #     print(0)

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

main()

Submission status: Wrong Answer

Solution code:
p=1000000007
fact=[0]*1000001
fact[0]=0
fact[1]=1
for i in range(2,1000001):
        fact[i]=(i*fact[i-1])%1000000007
def power(x, y, p) : 
    res = 1     
    x = x % p  
      
    if (x == 0) : 
        return 0
  
    while (y > 0) : 
      
        if ((y & 1) == 1) : 
            res = (res * x) % p 
  
        y = y >> 1      
        x = (x * x) % p 
          
    return res 
n=int(input())
print(((power(10,n-2,p)%p)*((fact[n])%p))%p)

Submission status: Wrong Answer

Solution code:
N = int(input())

MOD = 1000000007

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import os
from sys import stdin, stdout

MOD = int(1e9) + 7


def power(a, b):
    if b == 0:
        return 1

    ret = 1
    base = a
    while b > 0:
        if b % 2:
            ret *= base
            ret %= MOD
        b //= 2
        base *= base
        base %= MOD
    return ret


def solve(tc):
    n = int(stdin.readline().strip())

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


tcs = 1
tc = 1
while tc <= tcs:
    solve(tc)
    tc += 1

Submission status: Wrong Answer

Solution code:
M = 10**9 + 7


def main():
    n = int(input())
    a = 1
    b = 1
    c = 1
    for i in range(n):
        a *= 10
        a %= M
        b *= 9
        b %= M
        c *= 8
        c %= M
    print(a - b - b + c)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

def test(N):
    MOD = 10**9+7
    U = (pow(10, N, MOD) - 1)%MOD
    notA = (pow(9, N, MOD) - 1)% MOD
    notB = (pow(9, N, MOD) - 1)% MOD
    A = (U - notA) % MOD
    B = (U - notB) % MOD
    AnorB = (pow(8, N, MOD) - 1)%MOD
    AorB = (U - AnorB) % MOD
    AandB = (A+B-AorB) %MOD
    print(f"{U=}, {AorB=}, {A=}, {B=}, {AnorB=}")
    return AandB


def solve(N):
    MOD = 10**9+7
    dp = [[0, 0, 0, 0] for i in range(N+1)]
    dp[0] = [1, 0, 0, 0]
    A = 0
    B = 1
    C = 2
    D = 3
    for i in range(1, N+1):
        dp[i][A] = (dp[i-1][A]*8) % MOD
        dp[i][B] = (dp[i-1][A]   + dp[i-1][B]*9) % MOD
        dp[i][C] = (dp[i-1][A]   + dp[i-1][C]*9) % MOD
        dp[i][D] = (dp[i-1][B]   + dp[i-1][C]    + dp[i-1][D]*10) % MOD
        #print(i, dp[i], sum(dp[i]))
    return dp[N][D]

N = int(input())
print(test(N))
#print(solve(N))

Submission status: Wrong Answer

Solution code:
n = int(input())
tmp = n
res=1
ans=0
mod = 10**9+7
for i in range(1,n):
    res*=tmp
    tmp-=1
    ans+=res
    ans%=mod
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

MOD = 10**9+7
# ans = (10**n-9**n) + (10**n-9**n) - (10**n-8**n)
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())
MOD = 10**9+7
ans = pow(10, n, MOD) - pow(9, n, MOD) + pow(10, n, MOD) - pow(9, n, MOD) - (pow(10, n, MOD) - pow(8, n, MOD))
print(ans)

Submission status: Wrong Answer

Solution code:
def func(a):
    if (a==1):
        return 0
    else:
        return func(a-1)+a
N=int(input())
MOD=10**9+7
if N==1:
    z=0
else:
    z = 10**N - (9**N *2) + 8**N
print(z)

Submission status: Wrong Answer

Solution code:
import random

N = int(input())
A = []
B = 0
if N == 1:
    x = [0, 9]
    print(x[random.randint(0,1)])
elif N >= 2:
    while 0 not in A or 9 not in A:
        A = []
        for i in range(0,N):
            A.append(random.randint(0,9))
        print(A)
    for j in range(0,N):
        B += A[j]*10**j
    x = B % (10**9 + 7)
    print(x)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/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()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

mod = 10**9+7

def pwmod(x, y):
    res = 1
    for i in range(y):
        res = res * x % mod
    return res

print(pwmod(10, N) - pwmod(9, N) - pwmod(9, N) + pwmod(8, N))

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(9,n) + f(9,n) - f(8,n)) %mod

Submission status: Wrong Answer

Solution code:
n = int(input())

mod = 1000000007
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(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(9,n) + f(9,n) + f(8,n)) %mod

Submission status: Wrong Answer

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

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())

print(10**N - 9**N - 9**N + 8**N)

Submission status: Wrong Answer

Solution code:
n = int(input())

mod = 10 ** 9 + 7

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

Submission status: Wrong Answer

Solution code:
n = int(input())

mod = 10 ** 9 + 7

if n == 1:
    print(0)
else:
    print((10 ** n) - (2 * (9 ** n)) + (8 ** n) % mod)

Submission status: Wrong Answer

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

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:
import sys

input=sys.stdin.buffer.readline


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()


def II(): return int(input())


def MI(): return map(int,input().split())


def MF(): return map(float,input().split())


def LI(): return list(map(int,input().split()))


def LF(): return list(map(float,input().split()))


def TI(): return tuple(map(int,input().split()))


# rstrip().decode('utf-8')


def main():
	n=II()
	a=pow(10,n,10**9+7)
	b=pow(9,n,10**9+7)
	c=pow(8,n,10**9+7)
	print((a-2*b+c)%10**9+7)
	

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

mod = 10 ** 9 + 7

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

Submission status: Wrong Answer

Solution code:
n=int(input())
mod=1000000007
ten=1
nine=1
eight=1
for _ in range(n):
    nine *= 9
    ten *= 10
    eight *= 8
    nine %= mod
    eight%=mod
print(ten+eight-nine-nine)

Submission status: Wrong Answer

Solution code:

def resolve():
    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)


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

input=sys.stdin.buffer.readline


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()


def II(): return int(input())


def MI(): return map(int,input().split())


def MF(): return map(float,input().split())


def LI(): return list(map(int,input().split()))


def LF(): return list(map(float,input().split()))


def TI(): return tuple(map(int,input().split()))


# rstrip().decode('utf-8')


def main():
	n=II()
	a=pow(10,n,10**9+7)
	b=pow(9,n,10**9+7)
	c=pow(8,n,10**9+7)
	print(a-2*b+c)
	

if __name__=="__main__":
	main()

Submission status: Wrong Answer

Solution code:

import math

mod=10**9+7

N=int(input())

if(N==1):
    print(0)
else:
    a=10**N-9**N*2+8**N
    if(a>mod):
        b=a//mod
        print(b)
    else:
        print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())

mod = 10 ** 9 + 7

re = (10 ** n) - (2 * (9 ** n)) + (8 ** n)

if n == 1:
    print(0)
else:
    print(re)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())
p = 10 ** 9 + 7
a = 1
b = 1
c = 1
for i in range(n):
    a = (a * 10) % p
    b = (b * 9) % p
    c = (c * 8) % p
y = a - 2 * b + c
print(y)

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

mod=pow(10,9)+7

def pow_method(r,N):
    ans=1
    for i in range(N):
        ans=ans*r%mod
    return ans

calc=pow_method(9,N)+pow_method(9,N)-pow_method(8,N)
ans=pow_method(10,N)-calc

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
INF = 10 ** 9 + 7
if N < 2:
    print(0)
    exit()
print(pow(10, N, INF) - 2 * pow(9, N, INF) + pow(8, N, INF))

Submission status: Wrong Answer

Solution code:
n = int(input())

mod = 10 ** 9 + 7

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
MOD = 1000000007
a,b,c,d=pow(9,n,MOD),pow(9,n,MOD),pow(8,n,MOD),pow(10,n,MOD)
print(d-a-b+c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import random

N = int(input())
A = []
B = 0
while 0  not in A and 9 not in A:
    for i in range(0,N):
        A.append(random.randint(0,9))
for j in range(0,N):
    B += A[j]*10**j
x = B % 10**9 + 7
print(x)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n ==1:
    print(0)
    exit()
    
print(10**n+8**n-9**n-9**n)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
print(10**N - 2 * 9**N + 8**N)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n ==0:
    print(0)
    exit()
    
print(10**n+8**n-9**n-9**n)

Submission status: Wrong Answer

Solution code:
mod=1000000007
n=int(input())
print(0 if n==1 else 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())
mod = 10**9+7
print(pow(10, N, mod) - (pow(9, N, mod) * 2 - pow(8, N, mod)))

Submission status: Wrong Answer

Solution code:
n = int(input())


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


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

Submission status: Wrong Answer

Solution code:


n = int(input())

mod = 10**9 + 7
ans = 0
ans += 10**n % mod
ans -= 2*9**n % mod
ans += 8**n % mod

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())


def modpow(a, n):
    mod = 10 ** 9 + 7
    res = 1
    while n > 0:
        if n & 1:
            res = res * a % mod
        a = a * a % mod
        n >>= 1
    if res == 1:
        return mod - 1
    elif res == 0:
        return mod - 2
    else:
        return res - 2


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

Submission status: Wrong Answer

Solution code:
mod=1000000007
n=int(input())

def pow_by_iter(a, x, p):
    acc = a
    for i in range(1, x):
        acc = (acc * a) % p
    return acc

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

Submission status: Wrong Answer

Solution code:
from sys import stdin

readline = stdin.buffer.readline
read = stdin.buffer.read
def i_input(): return int(input().rstrip())
def i_map(): return map(int, input().rstrip().split())
def i_list(): return list(i_map())

MOD = 10 ** 9 + 7
def main():
    N = i_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

e = pow(8, N, mod)
f = pow(9, N, mod)
g = pow(10, N, mod)

# 全体 - (0を含まない + 9を含まない) + 0と9どちらも含まない 
ans = g - 2 * f + e
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
M=10**9+7
ans=1
m=1
for i in range(N):ans=(ans*10)%M
for i in range(N):m=(m*9)%M
ans-=(m*2)%M
m=1
for i in range(N):m=(m*8)%M
print(ans+m)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import math
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())

mod = 10 ** 9 + 7
nn = (10 ** N) % mod
nm = 2 * (9 ** N) % mod - (8 ** N) % mod

print(nn - nm)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def mypow(x,k,p):
    out = 1
    while(k > 0):
        if(k%2 == 1):
            out = out * x % p
        k = k // 2
        x *= x
    return out

p = 10 ** 9 + 7
n = int(input())
res = mypow(10,n,p) - mypow(9,n,p)*2 + mypow(8,n,p)
print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())

print(((10**n)%1000000007)-((9**n)%1000000007)-((9**n)%1000000007)+((8**n)%1000000007))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

res = pow(10, n-2)*n*(n-1)

print(res%1000000007)

Submission status: Wrong Answer

Solution code:
import sys

def input():
    return sys.stdin.readline().strip()

def main():
    def nCr(n,r):
        mod = 10 ** 9 + 7
        a = b = 1
        for i in range(r):
            a = (a * (n - i)) % mod
            b = (b * (r - i)) % mod
        return (a * pow(b,mod-2,mod))%mod

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

def powmod(x, y):
    res = 1
    for p in range(y):
        res = res*x%MOD
    return res

ans = powmod(10,N)-powmod(9,N)-powmod(9,N)+powmod(8,N)
print(int(ans))

Submission status: Wrong Answer

Solution code:
n = int(input())
j = q = h = 1
rem = 10**9+7
for i in range(n):
    j *= 10
    j %= rem
    q *= 9
    q %= rem
    h *= 8
    h %= rem
print(j-q*2+h)

Submission status: Wrong Answer

Solution code:
#C - Ubiquity
import math
N = int(input())
a = 10**9+7

ans = (10**N)-(9**N - 8**N)

# def combinations_count(n, r):
#     return math.factorial(n)%a // (math.factorial(n - r)%a * math.factorial(r))%a
#
# ans =(10**(N-2))%a*(combinations_count(N, 2)*2)%a-combinations_count(N, 2)%a
print(ans%a)

Submission status: Wrong Answer

Solution code:
n=int(input()) 
ans = 0

if n==1:
    print(0)
else:
    ans = 10**n-9**n-9**n+8**n
    ans %= 10**9+7

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:
N = int(input())
W = 0
V = 2

for i in range(1, N):
  W, V = 10 * W + V, 7 * V + 2 * 10 ** i
print(W % (10 ** 9 + 7))

Submission status: Wrong Answer

Solution code:
#C - Ubiquity
import math
N = int(input())
a = 10**9+7

ans = (10**N)-9**N - 8**N

# def combinations_count(n, r):
#     return math.factorial(n)%a // (math.factorial(n - r)%a * math.factorial(r))%a
#
# ans =(10**(N-2))%a*(combinations_count(N, 2)*2)%a-combinations_count(N, 2)%a
print(ans%a)