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())
#a, b, c, d = list(map(int, input().split()))
# Ch, Cw = list(map(int, input().split()))
# Dh, Dw = list(map(int, input().split()))
# data = [list(map(int, input().split())) for i in range(4)]
# k = int(input())
# a = list(map(int, input().split("/")))
# r = list(map(int, input().split()))
# ab_sorted = sorted(ab, key=lambda x: x[0])
# data = [list(map(int, input().split())) for i in range(n)]
# month = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]


def permutations(n, r):
    return math.factorial(n) // math.factorial(n - r)


def calc_eight(n):
    ans = 1
    mod = 10**9 + 7
    for i in range(n):
        ans *= 8
        ans %= mod
    return ans


def calc_ten(n):
    ans = 1
    mod = 10**9 + 7
    for i in range(n):
        ans *= 10
        ans %= mod
    return ans


def calc_nine(n):
    ans = 1
    mod = 10**9 + 7
    for i in range(n):
        ans *= 9
        ans %= mod
    return ans


if n == 1:
    print(0)
elif n == 2:
    print(2)
else:
    mod = 10**9 + 7
    _all = calc_ten(n)
    _all %= mod
    other = calc_eight(n)
    other %= mod
    nine = calc_nine(n)

    ans = _all-other
    ans %= mod
    # print(_all)
    # print(other)
    # print(nine)
    # print(nine*2-other)
    # print(ans)
    print(_all-(nine*2-other))

Submission status: Wrong Answer

Solution code:
import sys
from scipy.special import comb


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')
MOD = 10**9 + 7

n = I()
if n <= 2:
    ans = (comb(n, 2, exact=True) % MOD) * 2
    print(ans)
    exit()

ans = comb(n, 2, exact=True) % MOD
ans *= 2
ans %= MOD
for _ in range(n-2):
    ans *= 8
    ans %= MOD

ans += 2 ** n
ans %= MOD
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
*a , = open(0)
n = int(a[0])

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

Submission status: Wrong Answer

Solution code:
N = int(input())

x = (2**N-2)%(10**9+7)

print(x)

Submission status: Wrong Answer

Solution code:
a = int(input())
mod = 10**9 +7
if a > 1:
  num =2**a-2
  cum = num % mod
  print(cum)
  exit()
print(0)

Submission status: Wrong Answer

Solution code:
def fact(n):
  ans = 1
  for i in range(1, n+1):
    ans *= i
  return ans

def comb(a, b):
  if a < b:
    a, b = b, a
  return fact(a)/(fact(a-b)*fact(b))

x = int(input())

a = comb(x, 2)
b = 10*(x-2)
print(a*b)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
for i in range(0, int('9'*n)+ 1):
    if len(str(i)) == n:
        if '9' in str(i) and '0' in str(i):
            ans += 1
    else:
        if '9' in str(i):
            ans += 1
    print(i)

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

Submission status: Wrong Answer

Solution code:
N=int(input())
if N<2: 
  print(0)
  exit()
elif N==2: 
  print(1)
  exit()

# N>2
a=10**9+7

def f(n):
  r=1
  for i in range(n):
    r*=(i+1)
  return r

def c(n,r):
  return (f(n)%a)/(f(r)*f(n-r))

print( int((f(N)*c(N,(N-2)))%a) )

Submission status: Wrong Answer

Solution code:
n=int(input())
P=1000000007
print((pow(10,n,P)-pow(8,n,P)) % P)

Submission status: Wrong Answer

Solution code:
p=1000000007
def ncr(n, r, p): 
	num = den = 1
	for i in range(r): 
		num = (num * (n - i)) % p 
		den = (den * (i + 1)) % p 
	return (num * pow(den, 
			p - 2, p)) % p 
def factor(k,p):
  fact=1
  for i in range(1,k+1): 
    fact = fact * i
  #print (fact)
  return (fact)%p

n=int(input())
sum=0
for i in range(2,n+1):
  m=ncr(n, i, p)
  #print(m)
  f=factor(i,p)
  #print(f)
  sum=sum+(m*f)
  #print (sum)
print (sum)

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)-2*pow(9,N,P)+pow(8,N,P))

Submission status: Wrong Answer

Solution code:
def fact(n):
    val = 1
    for i in range(2, n + 1):
        val += i
    return val
n = int(input())
if n ==1:
  print(0)
elif n == 2:
  print(2)
else:
  print((fact(n-1)*9**(n-2))%(10**9+7))

Submission status: Wrong Answer

Solution code:
n = int(input())
inf = 1000000000 + 7
a=1; d=4
num = int(2*n*(n-1)) % inf
if n==2: ans=2
elif n==1: ans=0
elif n>2:
    for i in range(n-2):
        a = int(int(8*a) % inf)
        d = int(int(2*d) % inf)
    a = int(a%inf)*int(num%inf)
    ans = int(int(a%inf) + int(d%inf))%inf
print(int(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:
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())
x = power_func(10, n, (10**9 + 7))
y = power_func(8, n, (10**9 + 7))
z = power_func(9, n, (10**9 + 7))
print(x + y - 2 * z)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import factorial
def pc(n, r):
    return factorial(n) // factorial(n - r)

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

Submission status: Wrong Answer

Solution code:
n = int(input())
def count_row(n):
    a = n * (n-1) * 10 ** (n-2)
    a %= 10 ** 9 + 7
    return a
print(count_row(n))

Submission status: Wrong Answer

Solution code:
# -*- using:utf-8 -*-

def factorial_cor(n):
  fact = 1
  for integer in range(1, n + 1):
    fact *= integer
  return fact

if __name__ == "__main__":
  MOD = 1000000007
  N = int(input())
  if N == 1:
    print(0)
  elif N == 2:
    print(2)  
  else:
    C = factorial_cor(N)
    ten = 10 ** (N - 2) * C
    ans = C % MOD
    print(int(ans))

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

def permutations_count(n, r):
    return math.factorial(n) //( math.factorial(n - r) * math.factorial(r))

ans = 0
if N == 1:
    ans = 0
elif N == 2:
    ans = 2
else:
    for r in range(1,N,1):
        ans += permutations_count(N, r) % (10**9 + 7)
        
print(ans)

Submission status: Wrong Answer

Solution code:
import math
NN = int(input())

def power_func(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


a = power_func(10, NN , 10 ** 9 + 7)
b = power_func(9 , NN , 10 ** 9 + 7)
c = power_func(8 , NN , 10 ** 9 + 7)
print(a - b - b + c)

Submission status: Wrong Answer

Solution code:
N = int(input())

d = 1000000007
result = (10 ** N) % d
result -= (9 ** N) % d
result = result % d
result *= 2
result = result % d
result -= (10 ** N) % d
result += (8 ** N) % d

result = result if result > 0 else d + result
print(result)

Submission status: Wrong Answer

Solution code:
N = int(input())

cnt = 0
a = 10**9+7


if N <= 1:
  cnt = 0
else:
  for x in range(10**N):
    x = str(x).zfill(N)
    x = list(x)
    num_0 = x.count('0')
    num_9 = x.count('9')
    if num_0 >= 1 and num_9 >= 1:
      print(x)
      cnt += 1
print(cnt%a)

Submission status: Wrong Answer

Solution code:
from math import factorial

N = int(input())

def combination_count(n,r):
    return factorial(n) // (factorial(n-r) * factorial(r))

def mod_calc(x):
    if x == 1:
        return 0
    elif x == 2:
        return 2
    else:
        return int((combination_count(x,2)*(x-2)*10*2) % (10e9 + 7))

print(mod_calc(N))

Submission status: Wrong Answer

Solution code:
n=int(input())
y=(2**n)-2
x=y*9**(y-2)%(10**9+7)
if x<10**10:print(x)
else:print('ERROR')

Submission status: Wrong Answer

Solution code:
mod = 10**9 + 7

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

N = int(input())
ans = modpow(10,N)-2*modpow(9,N)+modpow(8,N)

print(ans)

Submission status: Wrong Answer

Solution code:
# 整数の入力
N = int(input())
 
print( (10**(N-2) * N * (N-1) - (N * (N-1))) % (10**9 + 7))

Submission status: Wrong Answer

Solution code:
N=int(input())

if N<2:
	print(0)
elif N==2:
	print(2)
else:
	without=10**(N-2)
	each=N*(N-1)
	final=without*each

	considered=final%(1000000007)

	print(int(considered))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
inp = int(input())
comb = inp*(inp-1)
bekiz = comb
Answer = 1
if inp <= 1:
    print(0)
elif inp == 2:
    print(2)
else:
    for i in range(inp-2):
        bekiz = bekiz*10%1000000007
    
    Answer = bekiz

    print(Answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
MOD = 1000000007
def modpow(a, n, mod) :
    ret = 1
    while n > 0:
        if n % 2 == 1:
            ret = ret * a % mod        
        a = a * a % mod
        n = n // 2
    return ret

N = int(input())
print(modpow(2,10,1000))
if N < 2:
  print(0)
elif N == 3:
  print(2)
else:
  ret1 = modpow(10,N,MOD) 
  ret2 = modpow(8,N,MOD)
  ret3 = modpow(9,N,MOD)
  ret = (ret1 - ret3 - ret3 + ret2) % MOD
  print(ret)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
y=pow(10,n)-100*(pow(9,n-1))
y=y%(pow(10,9)+7)
print(y)

Submission status: Wrong Answer

Solution code:
y=(2**3)-2
x=y*9**(y-2)%(10**9+7)
if x<10**10:print(x)
else:print('ERROR')

Submission status: Wrong Answer

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

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

#ans = N*(N-1)*(10**(N-2))
#print(ans)
#
#ans2 = ans % s
#print(ans2)

ans3 = N*(N-1)*power_func(10,N-2,s)
print(ans3 % s)

#ans = 10**N - (N*(10**(N-1))*2)+N*(N-1)*(10**(N-2))
#print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

MOD = 10 ** 9 + 7

print( ((n * (n - 1)) * (10 ** (n - 2)) if n > 1 else 0 ) % MOD )

Submission status: Wrong Answer

Solution code:
import math
N = int(input())

answer = 0
rest = 10 ** 9 + 7

def combinations_count(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

if N == 1:
  answer = 0
else:
  answer = (combinations_count(N, 2) * 2) * math.factorial(N-2)
print(answer % rest)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0

for i in range(n):
    if i == 0:
        ans = 1
    else:
        ans *= 2

Submission status: Wrong Answer

Solution code:
n=int(input())
m=(10**9)+7
a=(n*(n-1))
b=pow(10,n-2)
print((a*b)%m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

d_num = (10 ** 9) + 7

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

if N == 1:
    print(0)
elif N == 2:
    print(2)
else:
    x = N - 2
    y = 9 + x
    ans = cmb(y, x)
    
    ans = ans % d_num
    print(ans)

Submission status: Wrong Answer

Solution code:
import math


def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)


N = int(input())

if N < 2:
    print(0)
    exit()

ans = (permutations_count(N, 2) * (10 ** (N-2)) -
       permutations_count(N, 2)) % (10**9 + 7)

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
mod=(1e+9)+7
x=1
if n>=2:
  ans=1
else:
  ans=0
for i in range(n):
  x*=10
  ans*=8
  ans%=mod
  x%=mod
nin=1

for i in range(n):
  nin*=9
  nin%=mod
x+=ans
x%=mod
x-=(nin*2)%mod
if x<0:
  x+=mod
print(int(x%mod))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

n = int(input())

#print ((n*(n-1)*10**(n-2)) % (1E9+7))

div=1000000007
mod1=n % div
mod2=(n-1) % div

loop=(n-2)//10
amari=(n-2)%10
mod3=1
for i in range(0,loop):
  mod3=(mod3*(10000000000 % div) ) % div
mod3=mod3*(10**amari % div)

print((((mod1*mod2) % div)*mod3)%div)

Submission status: Wrong Answer

Solution code:
from operator import mul
from functools import reduce      

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

def main():

    N = int(input())

    if N == 1:
        print(0)
        return

    ans = cmb(N, 2) * 2 * (10 ** (N-2))
    ans = ans % (10 ** 9 + 7)
    #print(10 ** 9 + 7)
    #print(cmb(N, 2) * 2)
    print(ans)
    return

main()

Submission status: Wrong Answer

Solution code:
# -*- using:utf-8 -*-

def factorial_cor(n):
  fact = 1
  for integer in range(1, n + 1):
    fact *= integer
  return fact

if __name__ == "__main__":
  MOD = 1000000007
  N = int(input())
  if N == 1:
    print(0)
  elif N == 2:
    print(2)  
  else:
    C = factorial_cor(N)
    ans = 10 ** (N - 2) * C % MOD
    
    print(int(ans))

Submission status: Wrong Answer

Solution code:
import numpy as np

n = int(input())

#print ((n*(n-1)*10**(n-2)) % (1E9+7))

div=1000000007
mod1=n % div
mod2=(n-1) % div

loop=(n-2)//10
amari=(n-2)%10
mod3=1
for i in range(0,loop):
  mod3=(mod3*(10000000000 % div) ) % div
mod3=mod3*(10**amari % div)

print (loop, amari)
print((((mod1*mod2) % div)*mod3)%div)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n == 1 or n == 2:
  print(n * (n-1))
else:
  print((10 * n * (n - 1) - (4 * n)) % (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 = 1
diff = 1
eight = 1

for i in range(n):
    tmp *= 10
    tmp %= mod
    diff *= 9
    diff %= mod
    eight *= 8
    eight %= mod

ans = tmp - 2*diff + eight
print(ans)

# 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:

N = int(input())

if N < 2:
    print(0)
    exit()
N = N - 2

result = 2 * (10 ** N)
result = result % ((10 ** 9)+ 7)

print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

mod = (10**9)+7

if n == 1:
    print(0)
elif n==2:
    print(2)
else:
    t = n-2
    gyou = (8**t)
    xsisu = (10**t)
    nankotasuka = t*2
    itigyo = (gyou + xsisu*nankotasuka)%mod
    tmp = n-1
    ans = (tmp*itigyo)%mod
    ans = (ans*n)%mod
    print(ans)

Submission status: Wrong Answer

Solution code:
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplt(n): return [tuple(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

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

Submission status: Wrong Answer

Solution code:
N = int(input())

output1 = (10 ** N) % 1000000007
output2 = (2 * (9 ** N)) % 1000000007
output3 = (8 ** N) % 1000000007
output = output1 - output2 + output3
ouput = output % 1000000007
        
print(output)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

print(result)

Submission status: Wrong Answer

Solution code:
N = int(input())

m = 10**9 + 7
a = 10**N
b = 2*9**N
c = 8**N

a %= m
b %= m
c %= m

ans = a+b-c
ans %= m
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def fact(n):
    val = 1
    for i in range(2, n + 1):
        val += i
    return val
n = int(input())
if n ==1:
  print(0)
elif n == 2:
  print(2)
else:
  print(fact(n-1)**(n-2)%(10**9+7))

Submission status: Wrong Answer

Solution code:
MOD = 10**9+7

n = int(input())
print((2*pow(10, max(0, n-2), MOD) + (n*(n-1)-2)*pow(8, max(0, n-2), MOD)) % MOD)

Submission status: Wrong Answer

Solution code:
n=int(input())

import math

if n==1:
    print('0')
    
else:
    s=math.factorial(n)%1000000007
    m=((8**(n-2)))%1000000007
    print((s*m)%1000000007)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# coding:utf-8

def main():
    stdIn = int(input())
    stdOut = solve(stdIn)
    print(stdOut)


"""
方針
パターン数としては
(0を少なくとも一つ含む場合 + 9を少なくとも一つ含む場合 - 0,9どちらか一つを含む場合)
= (10^n - 9^n) * 2 - (10^n - 8^n)
10^n + 8^n - 2 * 9^n
正しn<=10^6なので単純に計算するとオーバーフローする
逐次計算して10^9+7を超えたら減らす方針にする

"""

mod = 1000000007


def solve(n):
    # s = 10 ** n + 8 ** n - 9 ** n * 2
    n10 = modpow(10, n, mod)
    n8 = modpow(8, n, mod)
    n9 = modpow(9, n, mod)
    s = n10 + n8 - n9 * 2
    if s < 0:
        s += mod
    return s

# a^n mod を計算する


def modpow(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 __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

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

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:
# 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)
ans%=mod
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
if(N==1):
  print(0)
  sys.exit()
elif(N==2):
  print(2)
  sys.exit()
else:
  ans = N*(N-1)*10**(N-2)%(10**9+7)
  print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())
MOD = 1000000000 + 7
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
print(power_func(10, N, MOD) - 2 * power_func(9, N, MOD) + power_func(8, N, MOD))

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    a = int(input())
    mod = 10**9+7
    if a==1:
        print(0)
    else:
        ans = 1
        for i in range(a):
            ans = ans*2%mod

        print(ans-2)

Submission status: Wrong Answer

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

ans = N * (N-1) * (10**(N-2))
if ans <= 0:
    ans = 0
if N == 2:
    ans = 2

print(ans % mod )

Submission status: Wrong Answer

Solution code:
def pow_k(x, n,mod = 10**9+7):
    x %= mod
    if n == 0:
        return 1

    K = 1
    while n > 1:
        if n % 2 != 0:
            K *= x
            K %= mod
        x *= x
        x %= mod
        n //= 2

    return K * x % mod
def solve(n,mod = 10**9+7):
    total = pow_k(10,n)
    not_include_0 = pow_k(9,n)
    not_include_9 = not_include_0
    not_include_0_and_9 = pow_k(8,n)
    return total-(not_include_0 + not_include_9 - not_include_0_and_9)%mod

def main():
    n = int(input())
    print(solve(n))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
print(lambda x=input():x%(10**9+7) )

Submission status: Wrong Answer

Solution code:
from scipy.special import comb

N = int(input())

mod = 10 ** 9 + 7
r = 8

list_ans = []
for n0 in range(1, N):
    for n9 in range(1, N - n0 + 1):
        n_nokori = N - n0 - n9
        comb_0 = comb(N, n0, exact=True)
        comb_9 = comb(N - 1, n9, exact=True)
        
        tmp = 1
        for i in range(n_nokori):
            tmp = (tmp * r) % mod
        
        ans = ((comb_0 % mod) * (comb_9 % mod) * tmp) % mod
        list_ans.append(ans)
        
ans2 = 0
for ans in list_ans:
    ans2 = (ans2 + ans) % mod

print(ans2)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = 10**9 + 7
tmp1 = 10**N %a
tmp2 = 2*9**N  %a
tmp3 = 8**N  %a

answer = tmp1-tmp2+tmp3 %a

print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
if n > 1:
  	print(10**(n-2)*(math.factorial(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)
	considered=considered%(1000000007)
	print(considered)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

print(abs(2*pow(9, N, 1000000007)-pow(8, N, 1000000007)-pow(10, N, 1000000007)))

Submission status: Wrong Answer

Solution code:
import sys

#a^n mod p を求める
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

input = sys.stdin.readline

n = int(input())
p = 1000000007
n_10 = power_func(10,n,p)
n_9 = power_func(9,n,p) * 2 % p

n_8 = power_func(8,n,p)

print(n_10 - n_9 + n_8)

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(modpow(10,N,P)-2*modpow(9,N,P)+modpow(8,N,P))

Submission status: Wrong Answer

Solution code:
def main():
    INF = int(1e9+7)
    N = int(input())
    ans_total = 1
    ans1 = 1
    ans2 = 1
    if N <= 1:
        print(0)
        return 
    
    for i in range(N):
        ans_total = ans_total * 10
        ans1 = ans1 * 9
        ans2 = ans2 * 8

        ans_total = ans_total % INF
        ans1 = ans1 % INF
        ans2 = ans2 % INF

    print(ans_total - ((2*ans1 - ans2)%INF)%INF)
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def div(n,T):
    tmp = 10 ** 9 + 7
    _ = 1
    for t in range(T):
        _ *= n
        _ %= tmp
    return _
    
N = int(input())
a = div(10,N)
b = div(9,N)
c = div(8,N)

print(a + c - 2 * b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

print(N*(N-1)%1000000007)

Submission status: Wrong Answer

Solution code:
from math import comb
if __name__=="__main__":
  n=int(input())
  if n==1:
    print(0)
    exit
  else:
    x=comb(n,2)*2
    x=x%(10**9+7)
    print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 1:
    print(0)
elif N == 2:
    print(1)
else:
    a = 10 ** 2
    b = 2 * 9 ** 2
    c = 8 ** 2
    mod = 10 ** 9 + 7
    ans = 0
    for i in range(N-2):
        a = a * 10 % mod
        b = b * 9 % mod
        c = c * 8 % mod
        ans = a - b + c
        ans %= 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=considered%(1000000007)
	print(considered)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
b = 0
a = 1

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

for i in range(n-1):
    b += a
    a += 1
print((b*20) % (10**9 + 7))

Submission status: Wrong Answer

Solution code:
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

mod = 1000000007
N = I()
if N == 2:
    print(2)
elif N == 1:
    print(0)
else:
    comb = ((N *(N-1)))
    
    ans = comb * 10 ** (N - 2) % mod
    
    print(int(ans))

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) % mod
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = 10**9 + 7
tmp1 = 10**N %a
tmp2 = 2*9**N %a
tmp3 = 8**N %a

answer = tmp1-tmp2+tmp3

print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
c=10**9+7
def pow_c(x,n,c):
    if n == 0:
        return 1
    K = 1
    while n > 1:
        if n % 2 != 0:
            K= (K%c)*(x%c)%c
        x = ((x%c)**2)%c
        n //= 2
    return (K%c) * (x%c) %c

k10=pow_c(10,n,c)
k9=pow_c(9,n,c)
k8=pow_c(8,n,c)
ans=(k10-2*k9+k8)%c

Submission status: Wrong Answer

Solution code:
mod = (int)(1e9+7)
n = (int)(input())

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

Submission status: Wrong Answer

Solution code:
import math

N=int(input())

if(N==1):
    print(0)
else:
    a=10**(N-2)
    b=math.factorial(N)*2 // (math.factorial(2) * math.factorial(N-2))
    c=b*a
    if(c>10**9+7):
        c1=c%10**9+7
        print(c1)
    else:
        print(c)

Submission status: Wrong Answer

Solution code:
from scipy.special import comb

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import comb
if __name__=="__main__":
  n=int(input())
  if n==1:
    print(0)
    exit
  else:
    print(comb(n,2)*2)

Submission status: Wrong Answer

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

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

from math import comb
ans = (10**(N) - 9**N) % divisor

print(ans)