problem_id stringclasses 100
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 6 806 |
|---|---|---|---|
p02554 | s351656634 | Accepted |
n = int(input())
mod = 10**9 + 7
if n==1:
print(0)
else:
#0が入ってるいる個数
a = pow(10,n,mod) - pow(9,n,mod)
#9が入っている個数
b = pow(10,n,mod) - pow(9,n,mod)
#0か9が入っている
c = pow(10,n,mod) - pow(8,n,mod)
ans = (a + b - c)%mod
print(ans) |
p02554 | s471416667 | Accepted | N = int(input())
MOD = 10**9 + 7
if N<=1:
print(0)
else:
all_num = pow(10, N)
ans = all_num - 2 * pow(9, N) + pow(8, N)
print(ans%MOD) |
p02554 | s085307354 | Accepted | N = int(input())
ans = 10**N - 2*(9**N) + 8**N
ans = ans % (10**9+7)
print (ans) |
p02554 | s010849278 | Accepted | n=int(input())
ans=(10**n-2*(9**n)+8**n)%(10**9+7)
print(ans) |
p02554 | s364761014 | Accepted | import math
n=int(input())
m=((10**n)-(2*(9**n))+(8**n))%1000000007
print(m)
|
p02554 | s919816993 | Accepted | N=int(input())
x=pow(10,N)-2*pow(9,N)+pow(8,N)
y=x%(pow(10,9)+7)
print(y) |
p02554 | s235665989 | Accepted | n = int(input())
print((10**n - (2 * (9**n)) + 8**n) % (10**9 + 7)) |
p02554 | s022587562 | Accepted | # C - Ubiquity
def main():
N = int(input())
MOD = 10 ** 9 + 7
res = (10 ** N - 2 * (9 ** N) + 8 ** N) % MOD # inclusion–exclusion principle
print(res)
if __name__ == "__main__":
main()
|
p02554 | s547102589 | Accepted | N = int(input())
print((10**N - 2*9**N + 8**N) % (10**9 + 7)) |
p02554 | s173620985 | Accepted | import math as mt
import sys, string
from collections import Counter, defaultdict
input = sys.stdin.readline
# input functions
I = lambda : int(input())
M = lambda : map(int, input().split())
ARR = lambda: list(map(int, input().split()))
MOD = int(1e9 + 7)
n = I()
if n < 2:
print(0)
else:
ans = (10 ** n) # all comb
ans %= MOD
ans -= 2 * (9 ** n) # without 9 or 0
ans %= MOD
ans += 8 ** n # without 9 and 0
ans %= MOD
print(ans)
|
p02554 | s226658735 | Accepted |
mod = 10**9+7
N = int(input())
if N <= 1:
print(0)
else:
res = (10**N - 8**N - 2 * (9**N - 8**N)) % mod
print(int(res)) |
p02554 | s735481685 | Accepted | n = int(input())
mod = 10**9 + 7
a = 10**n % mod
b = (9**n % mod) *2
c = 8**n % mod
print((a-b+c)%mod)
|
p02554 | s991826267 | Accepted | N = int(input())
mod = 10**9+7
answer_10 = 1
answer_9 = 1
answer_8 = 1
for _ in range(N):
answer_10 = (answer_10*10)%mod
answer_9 = (answer_9*9)%mod
answer_8 = (answer_8*8)%mod
answer = (answer_10 - 2*answer_9 + answer_8)%mod
print(answer) |
p02554 | s516293909 | 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 | s910058082 | Accepted | mod =10**9+7
n=int(input())
answer=10**n-2*9**n+8**n
print(answer%mod) |
p02554 | s748677640 | Accepted | N=int(input())
mod=10**9+7
ans=pow(10,N,mod)-pow(9,N,mod)*2+pow(8,N,mod)
print(ans%mod) |
p02554 | s094636050 | Accepted | n=int(input())
if n>2:
N=10**n
i=9**n
j=8**n
k=N-2*i+j
print(k%(10**9+7))
elif n ==2:
print(2)
else:
print(0)
|
p02554 | s546667706 | Accepted | n=int(input())
mod=10**9+7
print((pow(10,n,mod)-2*pow(9,n,mod)+pow(8,n,mod))%mod) |
p02554 | s333154566 | Accepted | # -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
a = 10**N%(10**9+7)
b = (2*9**N)%(10**9+7)
c = 8**N%(10**9+7)
ans = (a-b+c)%(10**9+7)
# 出力
print("{}".format(ans))
|
p02554 | s298002127 | Accepted | 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)%mod)
print(ans) |
p02554 | s860822901 | Accepted | MOD = 10**9 + 7
N = int(input())
if N == 1:
print(0)
else:
ans = pow(10, N, MOD) - 2* pow(9, N, MOD) + pow(8, N, MOD)
print(ans % MOD)
|
p02554 | s773448935 | Accepted | n = int(input())
ans = (10 ** n - (9 ** n + 9 ** n - 8 ** n)) % (10 ** 9 + 7)
print(ans) |
p02554 | s192299715 | Accepted | N = int(input())
mod = 10**9+7
res = pow(10,N,mod) - 2*pow(9,N,mod) + pow(8,N,mod)
print(res%mod)
|
p02554 | s559644159 | Accepted | N=int(input())
print((10**N-9**N-9**N+8**N)%(10**9+7)) |
p02554 | s461979779 | Accepted | MOD = 10**9 + 7
N = int(input())
ans = pow(10,N,MOD) - 2*pow(9,N,MOD) + pow(8,N,MOD)
print((ans + MOD) % MOD) |
p02554 | s046206953 | Accepted | n=int(input())
p=10**9+7
print((10**n-2*9**n+8**n)%p) |
p02554 | s652390239 | Accepted | N=int(input())
mod=10**9+7
print((pow(10,N,mod)-2*pow(9,N,mod)+pow(8,N,mod))%mod) |
p02554 | s797684261 | Accepted | n = int(input())
print(((10**n) - (9**n) - (9**n) + (8**n))%((10**9)+7))
|
p02554 | s025249129 | Accepted | n = int(input())
mod = 10**9 + 7
if n == 1:
print(0)
exit()
All = 10**n % mod
other = (9**n % mod) + (9**n % mod) - (8**n % mod)
print((All - other) % mod) |
p02554 | s983894874 | Accepted | mod = 10**9+7
N = int(input())
print((pow(10,N,mod)+pow(8,N,mod)-2*pow(9,N,mod))%mod) |
p02554 | s752382354 | Accepted | import math
n = int(input())
ans = 0
MOD = 10**9 + 7
if (n == 2):
ans = 2
elif (n < 2):
ans = 0
else:
ans = ((10 ** n) - (2 * 9**n) + 8**n) % MOD
print(ans)
|
p02554 | s750763633 | Accepted | # coding: utf-8
#a, b, c, d = map(int,input().split())
n=int(input())
ans=1
MOD=10**9+7
a=1
b=1
c=1
for i in range(n):
a*=10
a%=MOD
c*=8
c%=MOD
for i in range(n):
b*=9
b%=MOD
print((a-b*2+c)%MOD) |
p02554 | s976646155 | Accepted | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 13 21:12:17 2020
@author: liang
"""
key = 10**9 + 7
N = int(input())
ans = 10**N -2*9**N + 8**N
ans %= key
print(ans) |
p02554 | s536251905 | Accepted | N=int(input())
print((10**N-2*9**N+8**N)%(10**9+7)) |
p02554 | s948605276 | Accepted | n = int(input())
if n == 1:
print(0)
elif n == 2:
print(2)
else:
ans = (10 ** n) - (9 ** n) - (9 ** n) + (8 ** n)
print(ans % 1000000007) |
p02554 | s592275667 | Accepted | n = int(input())
l = 10 ** n - ((9 ** n )* 2 - 8 ** n)
print(l % (10 ** 9 + 7))
|
p02554 | s430423238 | Accepted | s = int(input())
n = 10 ** s - 9 ** s - 9 ** s + 8 ** s
print(n % (10 ** 9 + 7))
|
p02554 | s471947262 | Accepted | 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))%mod) |
p02554 | s116098586 | Accepted | N = int(input())
a=(10**N)%(10**9+7)
b=(9**N)%(10**9+7)
c=(8**N)%(10**9+7)
print((a+c-2*b)%(10**9+7))
|
p02554 | s120235582 | Accepted | n = int(input())
m = 10 ** 9 + 7
print((pow(10, n, m) + pow(8, n, m) - 2 * pow(9, n, m)) % m) |
p02554 | s881550966 | Accepted | N = int(input())
out = 2 * (10**N - 9**N) - (10**N - 8**N)
out %= (10**9 + 7)
print(out) |
p02554 | s147658492 | Accepted | n = int(input())
ans =(10**n + 8**n -2*(9**n)) % (10**9+7)
print(ans) |
p02554 | s068655482 | Accepted | n = int(input())
MOD = int(1e9 + 7)
a, b, c = 1, 1, 1
for i in range(n):
a *= 10;
b *= 9;
c *= 8;
a %= MOD;
b %= MOD;
c %= MOD;
print((a - 2 * b + c) % MOD); |
p02554 | s885106613 | Accepted | from sys import stdin
INF = 10**9 + 7
n = int(stdin.readline().rstrip())
ten = 1
nine = 1
eight = 1
for x in range(n):
ten = (ten * 10) % INF
nine = (nine * 9) % INF
eight = (eight * 8) % INF
ans = (((ten + eight) % INF) - ((2 * nine) % INF)) % INF
if ans < 0:
ans += INF
print(ans) |
p02554 | s913226651 | Accepted | mod = 10**9+7
N = int(input())
ans = (pow(10,N,mod) - 2*pow(9, N, mod) + pow(8, N, mod))%mod
if ans < 0:
ans += mod
print(ans)
|
p02554 | s834977600 | Accepted | n = int(input())
ans = 10**n - (9**n + 9**n - 8**n)
ans %= 10**9+7
print(ans) |
p02554 | s461782208 | Accepted | n = int(input())
mod = 10**9+7
if n==1:
print(0)
else:
print(((10**n)-(9**n)-(9**n)+(8**n))%mod) |
p02554 | s115709470 | Accepted | 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) % (10**9 + 7)) |
p02554 | s861552714 | Accepted | n=int(input())
mod=10**9+7
ans=1
for i in range(n):
ans*=10
ans%=mod
tmp=1
for i in range(n):
tmp*=9
tmp%=mod
ans-=2*tmp
ans%=mod
tmp=1
for i in range(n):
tmp*=8
tmp%=mod
ans+=tmp
ans%=mod
print(ans) |
p02554 | s521115210 | Accepted | n = int(input())
mod = 1000000007
ans = 10**n - 2*(9**n) + 8**n
print(ans % mod) |
p02554 | s801919684 | 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 | s056593785 | Accepted | n = int(input())
mod = 10 ** 9 + 7
print((pow(10, n, mod) - pow(9, n, mod) * 2 + pow(8, n, mod)) % mod)
|
p02554 | s612884408 | Accepted | N = int(input())
if N == 1:
print(0)
else:
print((10**N-2*9**N+8**N) % (10**9+7)) |
p02554 | s998227166 | Accepted | import sys
def input(): return sys.stdin.readline().strip()
mod = 10**9+7
def main():
N = int(input())
if N == 1:
print(0)
return
ans = pow(10, N, mod) - pow(9, N, mod) * 2 + pow(8, N, mod)
print(ans % mod)
if __name__ == "__main__":
main()
|
p02554 | s602984792 | Accepted | N = int(input())
mod = 10**9 + 7
ans = pow(10,N,mod)
ans -= pow(9,N,mod)
ans -= pow(9,N,mod)
ans += pow(8,N,mod)
ans %= mod
print(ans) |
p02554 | s586093546 | Accepted | '''
Created on 2020/09/13
@author: okazakieiichiro
'''
d = 10 ** 9 + 7
n = int(input())
ret = None
if n < 2:
ret = 0
elif n == 2:
ret = 2
else:
ret = 10 ** n + 8 ** n - 2 * 9 ** n
ret %= d
print(ret) |
p02554 | s323928934 | 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 | s328603632 | Accepted | N = int(input())
if N <= 1:
print(0)
else:
ans = 10**N - 2*9**N + 8**N
print(ans%(10**9 + 7))
|
p02554 | s124742458 | Accepted | m = 1000000007
N = int(input())
print((pow(10, N, m) - pow(9, N, m) * 2 + pow(8, N, m)) % m)
|
p02554 | s102819551 | Accepted | N = int(input())
ans = 10**N -9**N *2 + 8**N
ans %= (10**9+7)
print(ans) |
p02554 | s542415612 | Accepted | n=int(input())
v=10**n-(2*9**n)+(8**n)
print(v%1000000007) |
p02554 | s181197960 | Accepted | MOD = 10**9+7
N = int(input())
if N < 2:
print(0)
else:
ans = pow(10, N, MOD)
ans = ans - pow(9, N, MOD)*2+pow(8, N, MOD)
print(ans % MOD)
|
p02554 | s939830956 | Accepted | N = int(input())
ans = (10**N - 2*(9**N) + 8**N) % (10**9+7)
print(ans) |
p02554 | s262831773 | Accepted | ## coding: UTF-8
N = int(input())
mod = 10**9 + 7
#print(-3%mod)
ten = 1
nine = 1
eight = 1
if(N == 1):
print(0)
else:
for i in range(N):
ten *= 10
ten %= mod
nine *= 9
nine %= mod
eight *= 8
eight %= mod
ret = ten + eight - 2* nine
print(ret % mod)
|
p02554 | s915453276 | Accepted | n=int(input())
o=10**n + 8**n - 2*9**n
print(o%(10**9 +7)) |
p02554 | s343463473 | Accepted | n = int(input())
MOD = 1000000007
print((pow(10, n) - pow(9, n)*2 + pow(8, n))%MOD) |
p02554 | s454346453 | Accepted | mod=10**9+7
n=int(input())
if n==1:print(0);exit()
ans=pow(10,n,mod)
anss=pow(9,n,mod)
ansss=pow(8,n,mod)
print((ans-anss*2+ansss)%mod) |
p02554 | s836813261 | Accepted | n=int(input())
x=8**n-2*9**n+10**n
print(x%(10**9+7)) |
p02554 | s340339553 | Accepted | MOD = 10 ** 9 + 7
N = int(input())
Sall = pow(10, N, MOD)
S0 = S9 = pow(9, N, MOD)
S09 = pow(8, N, MOD)
ans = (Sall - (S0 + S9 - S09)) % MOD
print(ans) |
p02554 | s362629099 | Accepted | n = int(input())
#a(1) : 0
#a(2) : 2
#a(3) : ( 3*10 - 2 ) * 2 - 2 = 54
#a(4) :
#10**n - 8**n - 2*( 9**n - 8**n ) = 10**n - 2* (9**n) + 8**n
p = 10**n - 2* (9**n) + 8**n
p = p%(10**9 + 7)
print(p) |
p02554 | s540866039 | Accepted | n = int(input())
c = 10**9 +7
print((10**n - 9**n - 9**n + 8**n) % c) |
p02554 | s297359951 | Accepted | N=int(input())
num=10**N-2*9**N+8**N
num=num%(10**9+7)
print(num) |
p02554 | s388375153 | Accepted | import sys
sys.setrecursionlimit(1000000)
import bisect
import math
import collections
import heapq
M = 10 ** 9 + 7
def solve(N):
if N == 1:
return 0
if N == 2:
return 2
else:
ans = pow(10, N, M)
ans -= pow(9, N, M) * 2
ans += pow(8, N, M)
return ans
if __name__ == "__main__":
N = int(input())
print(solve(N) % M)
|
p02554 | s030572752 | Accepted | import itertools
n = int(input())
if n == 1 :
ans = 0
elif n == 2 :
ans = 2
else :
ans = 10**n - (9**n)*2 + 8**n
print(int(ans%((10**9)+7)))
|
p02554 | s981541687 | Accepted | n = int(input())
print((10 ** n - 2 * 9 ** n + 8 ** n) % (10 ** 9 + 7)) |
p02554 | s938482912 | Accepted | N = int(input())
mod = 10**9+7
def powmod(x, y):
a = 1
for _ in range(y):
a *= x
a %= mod
return a
# (0も9もある) = (全体) - (0がある/9がない) - (9がある/0がない) - (0も9もない)
ans = powmod(10, N) - powmod(9, N) - powmod(9, N) + powmod(8, N)
ans %= mod
print(ans) |
p02554 | s330883082 | Accepted | N = int(input())
MOD = 10**9 + 7
if N == 1:
print(0)
exit()
else:
ans = pow(10, N, MOD) - 2 * pow(9, N, MOD) + pow(8, N, MOD)
ans %= MOD
print(ans)
|
p02554 | s557702464 | Accepted | import sys
def input():
return sys.stdin.readline()[:-1]
def main():
n = int(input())
ans = (10 ** n - 2 * (9 ** n) + 8 ** n) % (10 ** 9 + 7)
print(ans)
if __name__ == "__main__":
main() |
p02554 | s039183969 | Accepted | def modexp(a,b,mod):
if b==0:
return 1
elif b%2==0:
x=modexp(a%mod,b//2,mod)%mod
return (x*x)%mod
else:
return ((a%mod)*(modexp(a%mod,b-1,mod)%mod))
mod=10**9+7
n=int(input())
a=modexp(10,n,mod)
b=modexp(9,n,mod)
c=modexp(8,n,mod)
ans=((a+c)%mod)-((2*b)%mod)
print(ans%mod) |
p02554 | s891421450 | Accepted | N = int(input())
MOD = 10 ** 9 + 7
ans = 10 ** N
ans -= (9 ** N) * 2 - 8 ** N
print(ans % MOD) |
p02554 | s481085112 | Accepted | N=int(input())
m=10**9+7
print((pow(10,N,m)-2*pow(9,N,m)+pow(8,N,m))%m) |
p02554 | s438638529 | Accepted | n = int(input())
mod = 10**9 + 7
ans = pow(10, n, mod) - 2 * pow(9, n, mod) + pow(8, n, mod)
if ans < 0:
while ans < 0:
ans += mod
else:
ans %= mod
print(ans) |
p02554 | s287450527 | Accepted | MOD = 10**9 + 7
N = int(input())
print((pow(10, N, MOD) - (pow(9, N, MOD) + pow(9, N, MOD) - pow(8, N, MOD)) % MOD) % MOD)
|
p02554 | s365200397 | Accepted | n = int(input())
mod = 10**9 + 7
ans = 10**n - (9**n + 9**n - 8**n)
ans %= mod
print(ans)
|
p02554 | s082596346 | Accepted | flow = 1000000007
n = int(input())
x = (10 ** n) % flow
y = (9 ** n) % flow
y = (y * 2) % flow
z = (8 ** n) % flow
print((x - y + z) % flow) |
p02554 | s978431984 | Accepted | n = int(input())
mod = 10**9 + 7
a = 1
for i in range(n):
a *= 10
a %= mod
b = 1
for i in range(n):
b *= 9
b %= mod
b *= 2
b %= mod
c = 1
for i in range(n):
c *= 8
c %= mod
print((a - b + c) % mod)
|
p02554 | s944599994 | Accepted | N=int(input())
print((10**N-2*9**N+8**N)%(10**9+7))
|
p02554 | s805355879 | Accepted | N = int(input())
sousuu = 10 ** N
not9 = 9 ** N
not0 = 9 ** N
not09 = 8 ** N
print((sousuu - not9 - not0 + not09) % (10 ** 9 + 7)) |
p02554 | s927678940 | Accepted | N=int(input())
if N==1:
print(0)
exit(0)
MOD=10**9+7
a=1
b=1
c=1
for i in range(N):
a=(a*10)%MOD
b=(b*9)%MOD
c=(c*8)%MOD
b*=2%MOD
if a+b-c>=0:
print((a-b+c)%MOD)
else:
print((a-b+c+MOD)%MOD) |
p02554 | s306304817 | Accepted | N = int(input())
d = 10**9+7
if N ==1:
print(0)
else:
print((10**N - 2*9**N + 8**N) % d) |
p02554 | s078061374 | Accepted | n = int(input())
mod = 10**9+7
print((pow(10,n,mod)-pow(9,n,mod)*2+pow(8,n,mod))%mod) |
p02554 | s349813441 | Accepted | import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007
def main():
N = int(readline())
ans = (pow(10, N, MOD) - pow(9, N, MOD) * 2 % MOD + pow(8, N, MOD)) % MOD
print(ans)
return
if __name__ == '__main__':
main()
|
p02554 | s744317056 | Accepted | N = int(input())
M = 10**9+7
print((pow(10, N, M)-pow(9, N, M)*2+pow(8, N, M))%M)
|
p02554 | s708616745 | Accepted | n = int(input())
mod = 10**9+7
# ans = n*(n-1)
ans = pow(10,n,mod)-pow(8,n,mod)-2*(pow(10,n,mod) - pow(9,n,mod))
ans = -ans%mod
print(ans) |
p02554 | s594499870 | Accepted | n = int(input())
mod = 10 ** 9 + 7
if n == 1:
print(0)
elif n == 2:
print(2)
else:
a = 10 ** n % mod
b = 9 ** n % mod
c = 8 ** n % mod
ans = a - 2 * b + c
ans %= mod
print(ans) |
p02554 | s756810595 | Accepted | MOD = 10**9 + 7
def main():
N = int(input())
if N == 1:
print(0)
return
ans = pow(10, N, MOD) - (pow(9, N, MOD) + pow(9, N, MOD) - pow(8, N, MOD))
ans %= MOD
print(ans)
if __name__ == '__main__':
main()
|
p02554 | s305829657 | Accepted | N = int(input())
mod = 1000000007
if N == 1:
print(0)
else:
a = 10 ** N % mod
b = 9 ** N % mod
c = 8 ** N % mod
print((a - 2 * b + c) % mod)
|
p02554 | s696175974 | Accepted | N = int(input())
ans = 0
if N == 1:
ans = 0
elif N == 2:
ans = 2
else:
ans = (10**N + (8**N) -2*(9**N)) % (10**9 + 7)
print (ans)
|
p02554 | s547702478 | Accepted | mod =10**9 + 7
N=int(input())
a=10**N
b=9**N
c=8**N
print((a-(2*b)+c)%mod) |
p02554 | s569779718 | Accepted | n = int(input())
r = 10**9 + 7
ten = 1
for i in range(n):
ten *= 10
ten %= r
nine = 1
for i in range(n):
nine *= 9
nine %= r
eight = 1
for i in range(n):
eight *= 8
eight %= r
print((ten - 2 * nine + eight) % r) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.