problem_id
stringclasses 100
values | submission_id
stringlengths 10
10
| status
stringclasses 2
values | code
stringlengths 6
806
|
|---|---|---|---|
p02554
|
s528719651
|
Accepted
|
n=int(input())
x=(10**n - (9**n + 9**n - 8**n))%(10**9 + 7)
print(x)
|
p02554
|
s229332783
|
Accepted
|
N = int(input())
mod = 10**9+7
a = pow(10, N) - pow(8, N)
b = 2*(pow(9, N) - pow(8, N))
ans = (a-b)%mod
print(ans)
|
p02554
|
s458923582
|
Accepted
|
n=int(input())
print((10**n-2*(9**n)+8**n)%(10**9+7))
|
p02554
|
s834567829
|
Accepted
|
import sys
def I(): return int(sys.stdin.readline().rstrip())
N = I()
mod = 10**9+7
print((pow(10,N,mod)-2*pow(9,N,mod)+pow(8,N,mod)) % mod)
|
p02554
|
s222357210
|
Accepted
|
n = int(input())
m = 10**9+7
a = 10 ** n
b = 9 ** n
c = 9 ** n
d = 8 ** n
ans = (a-(b+c-d)) % m
print(ans)
|
p02554
|
s085985094
|
Accepted
|
n = int(input())
print((10**n - 9**n*2 + 8**n) % (10 ** 9 + 7))
|
p02554
|
s004743675
|
Accepted
|
m=10**9+7
def power(a,b):
res=1
while(b>0):
if(b&1):
res=(res*a)%m
b//=2
a=(a*a)%m
return res
n=int(input())
s=(power(10,n)+power(8,n))%(10**9+7)
s=(s-(2*power(9,n)))%(10**9+7)
print((s))
|
p02554
|
s635456236
|
Accepted
|
N = int(input())
x = (10**N - 2 * 9**N + 8**N) % 1000000007
print(x)
|
p02554
|
s245853343
|
Accepted
|
n = int(input())
mod = 10**9+7
a = pow(10,n,mod)
b = pow(9,n,mod)
c = pow(9,n,mod)
d = pow(8,n,mod)
print((a-b-c+d)%mod)
|
p02554
|
s499844042
|
Accepted
|
def main():
s = int(input())
mod = 10**9+7
ans = (10**s - 2 * 9 ** s + 8 ** s) % mod
print(ans)
if __name__ == "__main__":
main()
|
p02554
|
s618154877
|
Accepted
|
mod = 1000000007
def ff(a, b):
ans = 1
while b:
if b & 1: ans = ans * a % mod
b >>= 1
a = a * a % mod
return ans
n=int(input())
print(((ff(10,n)-2*ff(9,n)+ff(8,n))%mod+mod)%mod)
|
p02554
|
s733832876
|
Accepted
|
N = int(input())
MOD = 1_000_000_007
ans = pow(10, N, MOD)
ans -= 2 * pow(9, N, MOD)
ans %= MOD
ans += pow(8, N, MOD)
ans %= MOD
print(ans)
|
p02554
|
s581009966
|
Accepted
|
n = int(input())
if n == 1:
print(0)
elif n == 2:
print(2)
else:
x = (10 ** 9) + 7
a = (10 ** n) % x
b = (9 ** n) % x
c = (8 ** n) % x
y = a - b * 2 + c
if y < 0:
y += x
y %= x
print(y)
|
p02554
|
s349127047
|
Accepted
|
n=int(input())
a=1
b=1
c=1
mod=10**9+7
for i in range(n):
a=a*8%mod
b=b*9%mod
c=c*10%mod
print((a-2*b+c+2*mod)%mod)
|
p02554
|
s298947114
|
Accepted
|
N=int(input())
mod=10**9+7
print((pow(10,N,mod)-pow(9,N,mod)-pow(9,N,mod)+pow(8,N,mod))%mod)
|
p02554
|
s949059692
|
Accepted
|
N = int(input())
ans = (10**N - 9**N - 9**N + 8**N) % (10**9 + 7)
print(ans)
|
p02554
|
s587594354
|
Accepted
|
N = int(input())
mod = 10**9 + 7
ans = 10**N - (9**N + 9**N - 8**N)
print(ans % mod)
|
p02554
|
s727885559
|
Accepted
|
MOD = 10**9+7
n = int(input())
print((pow(10, max(n, 0), MOD) - 2*pow(9, max(n, 0), MOD) + pow(8, max(n, 0), MOD)) % MOD)
|
p02554
|
s833427569
|
Accepted
|
n = int(input())
line = (10 ** n)- 2*(9 ** n) + (8 ** n)
print(line % (1000000000 +7))
|
p02554
|
s818191943
|
Accepted
|
N = int(input())
p_all = 10 ** N
p_no0 = 9 ** N
p_no9 = 9 ** N
p_no09 = 8 ** N
ans = (p_all - p_no0 - p_no9 + p_no09) % (10 ** 9 + 7)
print(ans)
|
p02554
|
s254381643
|
Accepted
|
m=10**9+7
n=int(input())
a=(8**n)%m
b=(9**n)%m
c=(10**n)%m
print((c-2*b+a)%m)
|
p02554
|
s928271932
|
Accepted
|
n = int(input())
ans = 10**n
tmp = (9**n)*2 - 8**n
ans -= tmp
print(int(ans%1000000007))
|
p02554
|
s150121223
|
Accepted
|
from scipy.special import comb
N=int(input())
if N==1:
print(0)
else:
print((10**N-2*(9**N)+8**N)%(10**9+7))
|
p02554
|
s022763458
|
Accepted
|
N = int(input())
MOD = 1_000_000_007
a, b, c, d = 8, 1, 1, 0
for i in range(N - 1):
a, b, c, d = 8 * a, a + 9 * b, a + 9 * c, b + c + 10 * d
a %= MOD
b %= MOD
c %= MOD
d %= MOD
print(d)
|
p02554
|
s504155177
|
Accepted
|
def solve():
N = int(input())
ans = (10**N - (2*9**N - 8**N)) % (10**9+7)
print(ans)
solve()
|
p02554
|
s371616029
|
Accepted
|
n = int(input())
a = (10**n) % (10**9+7)
b = (9**n) % (10**9+7)
c = (8**n) % (10**9+7)
print((a-2*b+c) % (10**9+7))
|
p02554
|
s916199771
|
Accepted
|
N = int(input())
mod = 10**9+7
no1 = 1
no19 = 1
ans = 1
for i in range(N):
no1*= 9
no1 %= mod
no19 *= 8
no19 %= mod
ans *= 10
ans %= mod
print((ans - no1*2 + no19)%mod)
|
p02554
|
s318767348
|
Accepted
|
N = int(input())
mod = 10**9+7
if N==1:
print(0)
elif N ==2:
print(2)
else:
ans2 = 0
ans1 = 2
ans0 = 8
for i in range(N-1):
ans2 = ans2*10 + ans1*1
ans1 = ans1*9 + ans0*2
ans0 = ans0*8
ans2 %= mod
ans1 %= mod
ans0 %= mod
print(ans2)
|
p02554
|
s297740817
|
Accepted
|
N = int(input())
mod = 10**9+7
ans = pow(10,N,mod)-2*pow(9,N,mod)+pow(8,N,mod)
print(ans % mod)
|
p02554
|
s212896224
|
Accepted
|
n = int(input())
print((10**n - 9**n - 9**n + 8**n)%(10**9+7))
|
p02554
|
s004990296
|
Accepted
|
def main():
n = int(input())
if n == 1: return 0
if n == 2: return 2
mod = 10**9 + 7
n_10 = pow(10, n, mod)
n_9 = pow(9, n, mod)
n_8 = pow(8, n , mod)
ans = (n_10 - 2*n_9 + n_8) % mod
return ans
ans = main()
print(ans)
|
p02554
|
s899130350
|
Accepted
|
N = int(input())
MOD = 10**9+7
t = (10**N)-(9**N)-(9**N)+(8**N)
print(t%MOD)
|
p02554
|
s102698958
|
Accepted
|
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%mod)
|
p02554
|
s359006667
|
Accepted
|
import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque
def r():
return int(input())
def rm():
return map(int,input().split())
def rl():
return list(map(int,input().split()))
n = r()
tens=1
nines=1
eights=1
mod = 10**9+7
for i in range(n):
tens=(tens*10)%mod
nines=(nines*9)%mod
eights=(eights*8)%mod
print((tens-2*nines+eights)%mod)
|
p02554
|
s888534347
|
Accepted
|
n=int(input())
if n==1:
print(0)
else:
print((10**n-2*9**n+8**n)%(10**9+7))
|
p02554
|
s963547065
|
Accepted
|
N = int(input())
MOD = 10 ** 9+7
print((10 ** N - (9 ** N ) * 2 + 8 ** N)%MOD)
|
p02554
|
s000280284
|
Accepted
|
n = int(input())
num1 = 10**n % (10**9 + 7)
num2 = (9**n * 2) % (10**9 + 7)
num3 = 8**n % (10**9 + 7)
print((num1 - num2 + num3) % (10**9 + 7))
|
p02554
|
s050099407
|
Accepted
|
N = int(input())
mod = 10**9 + 7
if N < 2:
print(0)
else:
#9がない
no9 = 1
no09 = 1
tot = 1
for i in range(N):
no9 *= 9
no9 %= mod
no09 *= 8
no09 %= mod
tot *= 10
tot %= mod
print((tot - 2 * no9 + no09) % mod)
|
p02554
|
s910676613
|
Accepted
|
n = int(input())
mod = 10**9+7
part1 = 10 **n
part2 = 8 ** n
part3 = 2 * (9 ** n) #-
part1 %= mod
part2 %= mod
part3 %= mod
print((part1 +part2 - part3)%mod)
|
p02554
|
s653710360
|
Accepted
|
n = int(input())
mod = 10**9+7
ans = pow(10, n, mod) - 2*pow(9, n, mod) + pow(8, n, mod)
print(ans%mod)
|
p02554
|
s628251519
|
Accepted
|
MOD = int(1e9 + 7)
n=int(input())
ans = 10 ** n % MOD
ans -= 2 * 9 ** n % MOD
ans += 8 ** n % MOD
ans %= MOD
print(ans)
|
p02554
|
s230981486
|
Accepted
|
n = int(input())
print((10 ** n - 2 * 9 ** n + 8 ** n)%(10**9+7))
|
p02554
|
s376936748
|
Accepted
|
#: Author - Soumya Saurav
import sys,io,os,time
from collections import defaultdict
from collections import Counter
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"
input = sys.stdin.readline
########################################
# #n = int(input())
n = int(input())
ans = (10**n) - 2*(9**n) + (8**n)
print(ans%(10**9+7))
'''
# Wrap solution for more recursion depth
#submit as python3
import collections,sys,threading
sys.setrecursionlimit(10**9)
threading.stack_size(10**8)
threading.Thread(target=solve).start()
'''
|
p02554
|
s550935853
|
Accepted
|
N=int(input())
if N==1:
print(0)
elif N==2:
print(2)
else:
print((10**N-2*(9**N)+8**N) % (10**9+7))
|
p02554
|
s738779097
|
Accepted
|
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(input())
MOD = 10 ** 9 + 7
ALL = pow(10, N, MOD)
ONE = pow(9, N, MOD)
TWO = pow(8, N, MOD)
ans = ALL - ONE - ONE + TWO
ans %= MOD
print(ans)
|
p02554
|
s102494768
|
Accepted
|
def main():
N=int(input())
m=int(1e9+7)
print((pow(10,N,m)-pow(9,N,m)-pow(9,N,m)+pow(8,N,m))%m)
if __name__=='__main__':
main()
|
p02554
|
s083166314
|
Accepted
|
n=int(input())
ans=10**n-2*9**n+8**n
print(ans%(10**9+7))
|
p02554
|
s111673283
|
Accepted
|
n = int(input())
mod = 10**9+7
ans = pow(10,n,mod) - (pow(9,n,mod) + pow(9,n,mod) - pow(8,n,mod))
ans %= mod
print(ans)
|
p02554
|
s714641401
|
Accepted
|
def powmod(a, n, p):
if(n==0):
return 2
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())
p=10**9+7
if(N==1):
print(0)
else:
print((powmod(10,N,p)-2*powmod(9,N,p)+powmod(8,N,p))%p)
|
p02554
|
s413582700
|
Accepted
|
#C
from math import factorial
N=int(input())
p=10**9+7
# fac=[1]
# for i in range(1,N+1):
# fac.append( (fac[-1]*i)%p)
if N==1:
ans=0
else:
total = pow(10,N,p)
#0がない
no_zero = pow(9,N,p)
no_nine = pow(9,N,p)
no_both = pow(8,N,p)
ans= total-(no_zero+no_nine)+no_both
ans %= p
#print(total,no_zero,no_both)
print(ans)
|
p02554
|
s196395092
|
Accepted
|
n=int(input())
a=pow(10,n)
b=pow(9,n)
c=pow(8,n)
print((a-b-b+c)%1000000007)
|
p02554
|
s974313344
|
Accepted
|
# import numpy as np
import sys, math, heapq
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial, gcd
from bisect import bisect_left, bisect_right
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep="\n")
N = int(input())
res = pow(10, N, MOD) - (2 * pow(9, N, MOD) - pow(8, N, MOD))
res %= MOD
print(res)
|
p02554
|
s861524492
|
Accepted
|
n=int(input())
P=10**9+7
ans=10**n-2*(9**n)+8**n
print(ans%P)
|
p02554
|
s671028782
|
Accepted
|
import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
mod = 10 ** 9 + 7; INF = float("inf")
def getlist():
return list(map(int, input().split()))
def inverse(N, mod):
return (pow(N, mod - 2, mod))
def main():
N = int(input())
ans = pow(10, N, mod) - pow(9, N, mod) * 2 + pow(8, N, mod)
print(ans % mod)
if __name__ == '__main__':
main()
|
p02554
|
s742942893
|
Accepted
|
N = int(input())
MOD = 10**9 + 7
def f(x, y): return pow(x, y, MOD)
print((f(10, N) - f(9, N) - f(9, N) + f(8, N) + MOD) % MOD)
|
p02554
|
s040193510
|
Accepted
|
n=int(input())
print((10**n-9**n-9**n+8**n)%(10**9+7))
|
p02554
|
s128253320
|
Accepted
|
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
mod = 10**9+7
n = int(readline())
a = 10 ** n % mod
b = 9 ** n % mod
c = 8 ** n % mod
ans = a - (c + (b - c) * 2)
print(ans % mod)
|
p02554
|
s318964554
|
Accepted
|
n=int(input())
r=10**n-(2*9**n-8**n)
m=10**9+7
#print(m)
print(r%m)
|
p02554
|
s494620103
|
Accepted
|
N=int(input())
M=10**9+7
a,b,c=1,1,1
for i in range(N):a,b,c=a*10%M,b*9%M,c*8%M
print((a-b*2+c)%M)
|
p02554
|
s958086982
|
Accepted
|
n = int(input())
mod = 10**9 +7
if n == 1:
print(0)
elif n == 2:
print(2)
else:
print(((10**n)-2*(9**n)+(8**n))%mod)
|
p02554
|
s213580010
|
Accepted
|
n=int(input())
print((10**n-((9**n)*2-8**n))%(10**9+7))
|
p02554
|
s666514339
|
Accepted
|
from sys import stdin
rs = lambda : stdin.readline().strip()
ri = lambda : int(rs())
ril = lambda : list(map(int, rs().split()))
MOD = 1_000_000_007
def pow(a, b):
ret = 1
while b > 0:
if (b & 1) == 1:
ret = ret * a % MOD
a = a * a % MOD
b >>= 1
return ret
def main():
N = ri()
ans = pow(10, N) - pow(9, N) - pow(9, N) + pow(8, N)
ans %= MOD
print(ans)
if __name__ == '__main__':
main()
|
p02554
|
s734572953
|
Accepted
|
n=int(input())
print((10**n+8**n-(9**n*2))%(10**9+7))
|
p02554
|
s564383902
|
Accepted
|
N = int(input())
MOD = 1000000007
a = (10 ** N) % MOD - 2 * ((9 ** N) % MOD) + ((8 ** N % MOD))
print(a % MOD)
|
p02554
|
s166234171
|
Accepted
|
n = int(input())
mod = 1000000007
print((pow(10, n, mod)- 2 * pow(9, n, mod) + pow(8, n, mod)) % mod)
|
p02554
|
s559728087
|
Accepted
|
n = int(input())
d = int(1e9 + 7)
print((10**n - 2 * 9**n + 8**n) % d)
|
p02554
|
s521076731
|
Accepted
|
n = int(input())
a = 10 ** n - 9 ** n * 2 + 8 ** n
print(a %(10 ** 9 + 7))
|
p02554
|
s146024875
|
Accepted
|
MOD=10**9+7
def modpow(a,n):
r=1
while n > 0:
if n%2==1:
r = r*a%MOD
a = a*a % MOD
n = n//2
return r
N=int(input())
a10N=modpow(10,N)
a9N=modpow(9,N)
a8N=modpow(8,N)
ans=a10N-(a8N+2*(a9N-a8N))
ans%=MOD
print(ans)
|
p02554
|
s228296931
|
Accepted
|
n = int(input())
m = 10**9+7
print((pow(10,n,m) - 2*pow(9,n,m) + pow(8,n,m))%m)
|
p02554
|
s389235351
|
Accepted
|
N = int(input())
md = 10 ** 9 + 7
s = 10 ** N
p = 9 ** N
d = 8 ** N
an = s - 2 * p + d
ans = an % md
print(ans)
|
p02554
|
s143481191
|
Accepted
|
n = int(input())
mod = 10**9 + 7
print((pow(10, n, mod) -2 *pow(9, n, mod) +pow(8, n, mod)) % mod )
|
p02554
|
s697223918
|
Accepted
|
def power(x, n, mod):
ans = 1
while n > 0:
if n % 2 == 1:
ans = ans * x % mod
n //= 2
x = x * x % mod
return ans
n = int(input())
mod = 10 ** 9 + 7
print((power(10, n, mod) - 2 * power(9, n, mod) + power(8, n, mod)) % mod)
|
p02554
|
s663973880
|
Accepted
|
#C
N=int(input())
mod=10**9+7
ans=pow(10,N,mod)-2*pow(9,N,mod)+pow(8,N,mod)
ans%=mod
print(ans)
|
p02554
|
s429031660
|
Accepted
|
mod = 10**9 + 7
N = int(input())
A = 10 ** N
B = 8 ** N
C = 10 ** N - 9 ** N
D = C * 2 - A + B
print(D % mod)
|
p02554
|
s751154622
|
Accepted
|
N=int(input())
a=1
b=1
c=1
for i in range(N):
a=(a*10)%(10**9+7)
for j in range(N):
b=(b*8)%(10**9+7)
for k in range(N):
c=(c*9)%(10**9+7)
ans=(a+b-2*c)%(10**9+7)
print(ans)
|
p02554
|
s178492483
|
Accepted
|
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))%mod
print(ans)
|
p02554
|
s256183765
|
Accepted
|
MOD = 1000000007
def powmod(x, y):
res = 1
for i in range(y):
res = res * x % MOD
return res
n = int(input())
ans = powmod(10, n) - powmod(9, n) - powmod(9, n) + powmod(8, n)
ans = ans % MOD
ans = (ans + MOD) % MOD
print(ans)
|
p02554
|
s338365818
|
Accepted
|
n=int(input(""))
a=1
b=2
c=1
while(n>10):
n-=10
a*=10**10
b*=9**10
c*=8**10
a%=(10**9+7)
b%=(10**9+7)
c%=(10**9+7)
for i in range(n):
a*=10
b*=9
c*=8
if(i%10==0):
a%=(10**9+7)
b%=(10**9+7)
c%=(10**9+7)
s=a+c-b
s%=(10**9+7)
print(s)
|
p02554
|
s828678777
|
Accepted
|
n = int(input())
mod = 10**9+7
def pow(x, n):
res = 1
while n > 0:
if n & 1 == 1:
res *= x
x *= x
n >>= 1
return res
print((pow(10, n)%mod -2*pow(9, n)%mod + pow(8, n)%mod)%mod)
|
p02554
|
s162396924
|
Accepted
|
N = int(input())
kyuN = 9**N
hachN= 8**N
jyuN=10**N
S = jyuN - (kyuN*2-hachN)
print(S%(1000000000+7))
|
p02554
|
s537508592
|
Accepted
|
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)) % MOD)
if __name__ == "__main__":
main()
|
p02554
|
s210194243
|
Accepted
|
n=int(input())
mod=10**9+7
ans=pow(10,n,mod)
ans-=pow(9,n,mod)*2
ans+=pow(8,n,mod)
ans%=mod
print(ans)
|
p02554
|
s471481215
|
Accepted
|
N=int(input())
print((10**N+8**N-2*(9**N))%(10**9+7))
|
p02554
|
s912488541
|
Accepted
|
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%mod)
|
p02554
|
s469704739
|
Accepted
|
mod = pow(10, 9) + 7
def powmod(x, y):
res = 1
for i in range(y):
res = res * x % mod
return res
n = int(input())
ans = powmod(10, n) - powmod(9, n) - powmod(9, n) + powmod(8, n)
ans %= mod
ans = (ans + mod) % mod
print(ans)
|
p02554
|
s355400915
|
Accepted
|
m = 10**9 + 7
def powmod(x,y):
a=1
for i in range(y):
a=(a*x)%m
return a
n=int(input())
s=powmod(10,n)-2*powmod(9,n)+powmod(8,n)
print((s+m)%m)
|
p02554
|
s012413749
|
Accepted
|
n = int(input())
a = ((10**n-(9**n+9**n-8**n)) % (10**9+7))
print(a)
|
p02554
|
s306442907
|
Accepted
|
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]
mod = 10**9+7
n = I()
if n == 1:
print(0)
else:
##(すべての順列)-(0をつかってないもの)-(9をつかってないもの)+(0も9もつかってないもの)
print((10**n-2*9**n+8**n)%mod)
|
p02554
|
s368393418
|
Accepted
|
prime = 10 ** 9 + 7
n = int(input())
ans = 10 ** n - (9 ** n) * 2 + 8 ** n
ans %= prime
print(ans)
|
p02554
|
s893958835
|
Accepted
|
N = int(input())
ans = (10**N-2*9**N+8**N)%(10**9+7)
print(ans)
|
p02554
|
s805063292
|
Accepted
|
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%MOD)
|
p02554
|
s122839234
|
Accepted
|
n = int(input())
mod = 10**9+7
ans = 10**n-9**n-9**n+8**n
ans %= mod
print(ans)
|
p02554
|
s676816191
|
Accepted
|
n = int(input())
print((10 ** n - 2 * 9 ** n + 8 ** n) % (1000000007))
|
p02554
|
s726611893
|
Accepted
|
N = int(input())
m = 10**9+7
ans = pow(10, N, m)
ans = (ans-2*pow(9, N, m)) % m
ans = (ans+pow(8, N, m)) % m
print(ans)
|
p02554
|
s163389490
|
Accepted
|
mod = 10**9 + 7
def main():
n = int(input())
ans_every = 1
ans_0 = 1
ans_0_9 = 1
for i in range(n):
ans_every *= 10
ans_every %= mod
ans_0 *= 9
ans_0 %= mod
ans_0_9 *= 8
ans_0_9 %= mod
print((ans_every-(ans_0*2 -ans_0_9))%mod)
if __name__ == "__main__":
main()
|
p02554
|
s403703036
|
Accepted
|
n = int(input())
mod = 10**9+7
if n<2:
print(0)
else:
print(((10**n-9**n)%mod-(9**n-8**n)%mod)%mod)
|
p02554
|
s393970707
|
Accepted
|
N=int(input())
p=10**9 +7
E=10**N
T=(8**N) + ((E-9**N)*2)
print((-(E-T))%p)
|
p02554
|
s827099302
|
Accepted
|
n = int(input())
if n == 1:
print(0)
exit()
mod = 10**9 + 7
print((pow(10, n, mod) - 2 * pow(9, n, mod) + pow(8, n, mod)) % mod)
|
p02554
|
s181851327
|
Accepted
|
n=int(input())
p=10**9+7
ans=pow(10,n,p)-2*pow(9,n,p)+pow(8,n,p)
print(ans%p)
|
p02554
|
s866196837
|
Accepted
|
mod = 10**9 + 7
n = int(input())
if n <= 1:
print(0)
else:
print((10**n-2*9**n + 8**n)%mod)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.