ZhenlongDai/ACPR huggingface dataset:
Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):


import sys
import math
import time

import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools











N = int(input())
mod = 10**9+7
ans = 0
ten = 1
nine = 1
eight = 1

for i in range(N):
  ten = (10*ten)%mod
  nine = (9*nine)%mod
  eight = (8*eight)%mod

neight = 2*nine - eight

if(neight<0):
  neight += mod

ans = ten - neight

if(ans<0):
  ans += mod

print(ans)




Failing test case input:
9961

Expected output:
540079694


Actual output:
-459920313


Fixed submission (verdict: Accepted):


import sys
import math
import time

import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools











N = int(input())
mod = 10**9+7
ans = 0
ten = 1
nine = 1
eight = 1

for i in range(N):
  ten = (10*ten)%mod
  nine = (9*nine)%mod
  eight = (8*eight)%mod

neight = 2*nine - eight

if(neight<0):
  neight += mod

ans = ten - neight

if(ans<0):
  ans += mod

print(ans%mod)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
34393

Expected output:
727143384


Actual output:
-272856623


Fixed submission (verdict: Accepted):
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)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
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 

N = int(input())

answer = 0
rest = 10 ** 9 + 7
  
if N == 1:
  answer = 0
else:
  answer = cmb(N, 2) * 2 * (10 ** (N - 2))
print(answer % rest)


Failing test case input:
67881

Expected output:
465817182


Actual output:
312608703


Fixed submission (verdict: Accepted):
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 

N = int(input())

answer = 0
rest = 10 ** 9 + 7
if N == 1:
  answer = 0
else:
  answer = (10 ** N) - (9 ** N) - (9 ** N) + (8 ** N)
print(answer % rest)
Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
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

if n>2:
  print(((n%mod)*((n-1)%mod)*((pow_by_iter(10,n-2,mod))%mod))%mod)
else:
  print(n*(n-1))

Failing test case input:
4234

Expected output:
645343714


Actual output:
407462240


Fixed submission (verdict: 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)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

def pow(x, n):
    ans = 1
    n_tmp = n
    while n:
        if n % 2:
            ans *= x
            ans %= mod
        x *= x
        n >>= 1
    return ans


mod = 10**9+7 

a = pow(8, n) 
b = pow(9, n) 
c = pow(10, n) 
print(c-2*b+a)


Failing test case input:
8318

Expected output:
781897777


Actual output:
-218102230


Fixed submission (verdict: Accepted):
n = int(input())

def pow(x, n):
    ans = 1
    n_tmp = n
    while n:
        if n % 2:
            ans *= x
            ans %= mod
        x *= x
        n >>= 1
    return ans

mod = 10**9+7 

a = pow(8, n) 
b = pow(9, n) - pow(8, n) 
c = pow(10, n) 
ans = c-2*b-a
if ans < 0:
    ans += mod
print(ans%mod)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
229883

Expected output:
188898156


Actual output:
1188898163


Fixed submission (verdict: Accepted):
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%mod)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())

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

print(x-y+z)

Failing test case input:
9378

Expected output:
349134206


Actual output:
-650865801


Fixed submission (verdict: Accepted):
N=int(input())

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

print((x-y+z)%(10**9+7))

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
mod = 10 ** 9 + 7

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


ans = g - 2 * f + e
print(ans)

Failing test case input:
15421

Expected output:
778744163


Actual output:
-1221255851


Fixed submission (verdict: Accepted):
N = int(input())
mod = 10 ** 9 + 7

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


ans = (g - 2 * f + e) % mod
print(ans)
Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):

import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter

from functools import lru_cache
import copy


input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7




def inp():
    
    return int(input())


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


def str_inp():
    
    return list(input()[:-1])





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


Failing test case input:
2763

Expected output:
154890789


Actual output:
1154890796


Fixed submission (verdict: Accepted):

import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter

from functools import lru_cache
import copy


input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7




def inp():
    
    return int(input())


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


def str_inp():
    
    return list(input()[:-1])





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

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

import sys
import math
from functools import reduce
from bisect import bisect_left

def readString():
    return sys.stdin.readline()

def readInteger():
    return int(readString())

def readStringSet(n):
    return sys.stdin.readline().split(" ")[:n]

def readIntegerSet(n):
    return list(map(int, readStringSet(n)))

def readIntegerMatrix(n, m):
    return reduce(lambda acc, _: acc + [readIntegerSet(m)], range(0, n), [])

M = 1000000007

def _pow(n, m):
    ret = 1
    for _ in range(m):
        ret = (ret * n) % M
    return ret

def main(N):
    return (_pow(10, N) - 2 * _pow(9, N) + _pow(8, N))

if __name__ == "__main__":
    _N = readInteger()

    print(main(_N))

Failing test case input:
555348

Expected output:
556355172


Actual output:
-443644835


Fixed submission (verdict: Accepted):

import sys
import math
from functools import reduce
from bisect import bisect_left

def readString():
    return sys.stdin.readline()

def readInteger():
    return int(readString())

def readStringSet(n):
    return sys.stdin.readline().split(" ")[:n]

def readIntegerSet(n):
    return list(map(int, readStringSet(n)))

def readIntegerMatrix(n, m):
    return reduce(lambda acc, _: acc + [readIntegerSet(m)], range(0, n), [])

M = 1000000007

def _pow(n, m):
    ret = 1
    for _ in range(m):
        ret = (ret * n) % M
    return ret

def main(N):
    return (_pow(10, N) - 2 * _pow(9, N) + _pow(8, N)) % M

if __name__ == "__main__":
    _N = readInteger()

    print(main(_N))

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
m = 10**9 +7
result = pow(10,N,m) - 2*pow(9,N,m) + pow(8,N,m)
print(result)

Failing test case input:
32828

Expected output:
735815477


Actual output:
-1264184537


Fixed submission (verdict: Accepted):
N = int(input())
m = 10**9 +7
result = pow(10,N,m) - 2*pow(9,N,m) + pow(8,N,m)
result = result %m
print(result)
Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
def solve():
    N = int(input())
    MOD = 10**9+7
    U = pow(10,N,MOD)
    inc_zero = U - pow(9,N,MOD)
    inc_nine = inc_zero

    inc_both = U - pow(8,N,MOD)

    print(inc_zero+inc_nine-inc_both % MOD)

if __name__ == '__main__':
    solve()


Failing test case input:
131677

Expected output:
810813404


Actual output:
-189186603


Fixed submission (verdict: Accepted):
def solve():
    N = int(input())
    MOD = 10**9+7
    U = pow(10,N,MOD)
    inc_zero = U - pow(9,N,MOD)
    inc_nine = inc_zero

    inc_both = U - pow(8,N,MOD)

    print((inc_zero+inc_nine-inc_both) % MOD)

if __name__ == '__main__':
    solve()

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
from sys import stdin,stdout
import math
import random
import heapq
from collections import Counter
from functools import lru_cache

try:
    m=(10**9+7)
    for _ in range(1):
        n=int(input())
        if n==1:
            print(0)
        elif n==2:
            print(2)
        else:
            print(pow(10,n,m)-(2*pow(9,n,m))+pow(8,n,m))
            
            


    
except EOFError as e:
    print(e)


Failing test case input:
15421

Expected output:
778744163


Actual output:
-1221255851


Fixed submission (verdict: Accepted):
import sys
from sys import stdin,stdout
import math
import random
import heapq
from collections import Counter
from functools import lru_cache

try:
    m=(10**9+7)
    for _ in range(1):
        n=int(input())
        if n==1:
            print(0)
        elif n==2:
            print(2)
        else:
            print((((pow(10,n,m)-(2*pow(9,n,m)))%m)+pow(8,n,m))%m)
            
            


    
except EOFError as e:
    print(e)

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
M = 10**9+7
v1 = pow(9, n, M)
v2 = pow(8, n, M)
ans = pow(10, n, M) - v1*2 + v2
print(ans)

Failing test case input:
34393

Expected output:
727143384


Actual output:
-1272856630


Fixed submission (verdict: Accepted):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
M = 10**9+7
v1 = pow(9, n, M)
v2 = pow(8, n, M)
ans = pow(10, n, M) - v1*2 + v2
print(ans%M)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())

print(-2*pow(9, N, 10**9+7)+pow(8, N, 10**9+7)+pow(10, N, 10**9+7))


Failing test case input:
7601

Expected output:
472383749


Actual output:
-527616258


Fixed submission (verdict: Accepted):
N = int(input())

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

ans %= 10**9+7

print(ans)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
print((10**N-2*9*N+8**N)%(10**9+7))

Failing test case input:
2615

Expected output:
918586851


Actual output:
958881293


Fixed submission (verdict: Accepted):
N=int(input())
print((10**N-2*9**N+8**N)%(10**9+7))
Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)


Failing test case input:
17848

Expected output:
506395298


Actual output:
-493604709


Fixed submission (verdict: Accepted):
MOD = int(1e9 + 7)
n=int(input())
ans = pow(10, n, MOD)
ans -= 2 * pow(9, n, MOD)
ans += pow(8, n, MOD)
ans %= MOD
print(ans)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
mod = 10**9+7

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

Failing test case input:
708630

Expected output:
669444534


Actual output:
-330555473


Fixed submission (verdict: 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)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
MOD = 10**9 + 7

def mod_pow(x, mod):
    xx = [1, x]
    def _pow(y, x=x):
        nonlocal xx
        if y == 0:
            return 1
        while len(xx) <= math.log(y, 2)+1:
            v = xx[-1] * xx[-1]
            v %= mod
            xx.append(v)
        i = 1
        result = 1
        while y > 0:
            if y % 2 == 1:
                result *= xx[i]
                result %= mod
            y = y >> 1
            i += 1
        return result
    return _pow

pow10 = mod_pow(10, MOD)
pow9 = mod_pow(9, MOD)
pow8 = mod_pow(8, MOD)

def f(n):
    ans = pow10(n) - (2 * pow9(n) - pow8(n))
    return ans


def main():
    N = int(input())
    ans = f(N)
    print(ans)

if __name__ == '__main__':
    main()


Failing test case input:
10667

Expected output:
70415393


Actual output:
1070415400


Fixed submission (verdict: Accepted):
import math
MOD = 10**9 + 7

def mod_pow(x, mod):
    xx = [1, x]
    def _pow(y, x=x):
        nonlocal xx
        if y == 0:
            return 1
        while len(xx) <= math.log(y, 2)+1:
            v = xx[-1] * xx[-1]
            v %= mod
            xx.append(v)
        i = 1
        result = 1
        while y > 0:
            if y % 2 == 1:
                result *= xx[i]
                result %= mod
            y = y >> 1
            i += 1
        return result
    return _pow

pow10 = mod_pow(10, MOD)
pow9 = mod_pow(9, MOD)
pow8 = mod_pow(8, MOD)

def f(n):
    ans = pow10(n) - (2 * pow9(n) - pow8(n))
    ans %= MOD
    return ans


def main():
    N = int(input())
    ans = f(N)
    print(ans)

if __name__ == '__main__':
    main()

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):



N = int(input())

p = 10**9 + 7

ret = pow(10, N, p)
ret -= pow(9, N, p)
ret -= pow(9, N, p)
ret += pow(8, N, p)

print(ret)

Failing test case input:
18262

Expected output:
566588237


Actual output:
-433411770


Fixed submission (verdict: Accepted):



N = int(input())

p = 10**9 + 7

ret = pow(10, N)
ret -= pow(9, N) 
ret -= pow(9, N)
ret += pow(8, N)

ret %= p

print(ret)
Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
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)

Failing test case input:
17848

Expected output:
506395298


Actual output:
-493604709


Fixed submission (verdict: Accepted):
def div(n,T):
    tmp = 10 ** 9 + 7
    _ = 1
    for t in range( T- 1):
        _ *= n
        _ %= tmp
    return _ * n
    
N = int(input())
a = div(10,N)
b = div(9,N)
c = div(8,N)
print((a + c - b * 2) % (10 ** 9 + 7))

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):

import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter

from functools import lru_cache
import copy


input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7




def inp():
    
    return int(input())


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


def str_inp():
    
    return list(input()[:-1])





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


Failing test case input:
1294

Expected output:
440007546


Actual output:
-559992461


Fixed submission (verdict: Accepted):

import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter

from functools import lru_cache
import copy


input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7




def inp():
    
    return int(input())


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


def str_inp():
    
    return list(input()[:-1])





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

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

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

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

Failing test case input:
2221

Expected output:
792966352


Actual output:
51


Fixed submission (verdict: Accepted):
n = int(input())

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

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

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
if n > 1:
    print((10**n) % (10**9 + 7) - (9**n * 2) % (10**9 + 7) + (8**n) % (10**9 + 7))
else:
    print("0")

Failing test case input:
2763

Expected output:
154890789


Actual output:
1154890796


Fixed submission (verdict: Accepted):
n = int(input())
if n > 1:
    print(((10**n) - (9**n * 2 - 8**n))%(10**9+7))
else:
    print("0")

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
k=10**9+7
ans=(10**n)%k-(8**n)%k
print(ans%k)

Failing test case input:
112403

Expected output:
286663221


Actual output:
337674433


Fixed submission (verdict: Accepted):
n=int(input())
k=10**9+7
ans=(10**n)%k+(8**n)%k-2*((9**n)%k)
print(ans%k)
Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
mod=10**9 + 7
n=int(input())
print(pow(10,n,mod)-pow(8,n,mod))

Failing test case input:
226564

Expected output:
498733826


Actual output:
-634734166


Fixed submission (verdict: Accepted):
mod=10**9 + 7
n=int(input())
print((pow(10,n,mod)+pow(8,n,mod)-2*pow(9,n,mod))%mod)

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())

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

Failing test case input:
18759

Expected output:
254508367


Actual output:
1254508374


Fixed submission (verdict: 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)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
mod = 10**9+7

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


Failing test case input:
8318

Expected output:
781897777


Actual output:
-218102230


Fixed submission (verdict: Accepted):
N=int(input())
mod = 10**9+7

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

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):

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

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

Failing test case input:
6812

Expected output:
797002527


Actual output:
221699044


Fixed submission (verdict: 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)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
mod = 10**9 + 7

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

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

Failing test case input:
38647

Expected output:
55814822


Actual output:
1055814829


Fixed submission (verdict: Accepted):
n = int(input())
mod = 10**9 + 7

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

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

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n=int(input())
print(pow(10,n,10**9+7)-2*pow(9,n,10**9+7)+pow(8,n,10**9+7))

Failing test case input:
1294

Expected output:
440007546


Actual output:
-559992461


Fixed submission (verdict: Accepted):
n=int(input())
x=pow(10,n,10**9+7)-2*pow(9,n,10**9+7)+pow(8,n,10**9+7)
print(x%(10**9+7))

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
MOD = 10**9 + 7
ans = pow(10,n,MOD) - 2*pow(9,n,MOD) - pow(8,n,MOD)
print(ans%MOD)

Failing test case input:
2282

Expected output:
450657193


Actual output:
919362346


Fixed submission (verdict: 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)
Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
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

if n>2:
  print(((n%mod)*((n-1)%mod)*(10**(n-2)))%mod)
else:
  print(n*(n-1))

Failing test case input:
2627

Expected output:
951498737


Actual output:
872953111


Fixed submission (verdict: 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)

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())
p = 10**9+7
print(pow(10, n, p) - 2*pow(9, n, p) + pow(8, n, p))

Failing test case input:
2133

Expected output:
650618801


Actual output:
-349381206


Fixed submission (verdict: Accepted):
n = int(input())
p = 10**9+7
print((pow(10, n, p) - 2*pow(9, n, p) + pow(8, n, p)) % p)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
a = 10**N - 8**N - 2*(9**N)
b = a % (10**9  + 7)
print(b)


Failing test case input:
2282

Expected output:
450657193


Actual output:
919362346


Fixed submission (verdict: Accepted):
N = int(input())
a = 10**N + 8**N - 2*9**N
b = a % (10**9  + 7)
print(b)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
ans = ((10 ** (n - 2)) * ((n - 1) * n)) % ((10 ** 9)+ 7)
print(ans)

Failing test case input:
979

Expected output:
342705852


Actual output:
990948593


Fixed submission (verdict: Accepted):
n = int(input())
ans = (10 ** n - (9 ** n + 9 ** n - 8 ** n)) % (10 ** 9 + 7)
print(ans)

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())

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

Failing test case input:
188540

Expected output:
687604817


Actual output:
528124209


Fixed submission (verdict: Accepted):
n = int(input())

if n <= 1:
  ans = 0
else:
  ans = (10**n - 9**n - 9**n + 8**n) % (10**9+7)
  
print(ans)
Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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

    
    all_p = modpow(10, n, mod)
    
    not_0 = modpow(9, n, mod)
    
    not_9 = modpow(9, n, mod)
    
    not_0_9 = modpow(8, n, mod)
    
    ans = all_p - not_0 - not_9 + not_0_9
    print(ans)

if __name__ == '__main__':
    main()

Failing test case input:
1889

Expected output:
325108626


Actual output:
-674891381


Fixed submission (verdict: Accepted):
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

    
    all_p = modpow(10, n, mod)
    
    not_0 = modpow(9, n, mod)
    
    not_9 = modpow(9, n, mod)
    
    not_0_9 = modpow(8, n, mod)
    
    ans = all_p - not_0 - not_9 + not_0_9
    print(ans%mod)

if __name__ == '__main__':
    main()

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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))


Failing test case input:
34393

Expected output:
727143384


Actual output:
-1272856630


Fixed submission (verdict: Accepted):
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%MOD))

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys

input=sys.stdin.buffer.readline





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





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


Failing test case input:
555348

Expected output:
556355172


Actual output:
-443644835


Fixed submission (verdict: Accepted):
import sys

input=sys.stdin.buffer.readline





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





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()
Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys

def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
MOD=10**9+7

def main():
    n = II()
    sumv10 = 1
    for _ in range(n):
        sumv10 *= 10
        sumv10 %= MOD
    sumv9 = 1
    for _ in range(n):
        sumv9 *= 9
        sumv9 %= MOD
    sumv9 *= 2
    sumv8 = 1
    for _ in range(n):
        sumv8 *= 8
        sumv8 %= MOD
    print(sumv10 - sumv9 + sumv8)

if __name__ == '__main__':
    main()

Failing test case input:
38647

Expected output:
55814822


Actual output:
1055814829


Fixed submission (verdict: Accepted):
import sys

def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
MOD=10**9+7

def main():
    n = II()
    sumv10 = 1
    for _ in range(n):
        sumv10 *= 10
        sumv10 %= MOD
    sumv9 = 1
    for _ in range(n):
        sumv9 *= 9
        sumv9 %= MOD
    sumv9 *= 2
    sumv8 = 1
    for _ in range(n):
        sumv8 *= 8
        sumv8 %= MOD
    print((sumv10 - sumv9 + sumv8)%MOD)

if __name__ == '__main__':
    main()

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):



import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
input = sys.stdin.readline




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)


Failing test case input:
555348

Expected output:
556355172


Actual output:
-443644835


Fixed submission (verdict: Accepted):



import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
input = sys.stdin.readline




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

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
2627

Expected output:
951498737


Actual output:
-48501270


Fixed submission (verdict: Accepted):
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(int(a%(1e9+7)))
Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):






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


N = int(input())

ALL = mod_pow(10, N)
side = mod_pow(9, N)
none = mod_pow(8, N)

print(ALL - side * 2 + none)

Failing test case input:
17848

Expected output:
506395298


Actual output:
-493604709


Fixed submission (verdict: Accepted):






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


N = int(input())

ALL = mod_pow(10, N)
side = mod_pow(9, N)
none = mod_pow(8, N)

MOD = 10 ** 9 + 7

print((ALL - side * 2 + none) % MOD)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):



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

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


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


Failing test case input:
20670

Expected output:
311209106


Actual output:
1311209113


Fixed submission (verdict: Accepted):



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

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


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

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())
mod = 10**9 + 7
ans = pow(10,n,mod) - (pow(9,n,mod)*2 - pow(8,n,mod))
print(ans)

Failing test case input:
38647

Expected output:
55814822


Actual output:
1055814829


Fixed submission (verdict: Accepted):
n = int(input())
mod = 10**9 + 7
ans = (pow(10,n,mod) - (pow(9,n,mod)*2 - pow(8,n,mod))) % mod
print(ans)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
37402

Expected output:
288115537


Actual output:
-711884470


Fixed submission (verdict: Accepted):
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)%(10**9+7))

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
 
MOD = 10**9 + 7
 
if N==1:
    print(0)
elif N==2:
    print(2)
else:
    ans = pow(10,N,MOD) - 2*pow(9,N,MOD) + pow(8,N,MOD)
    print(ans)

Failing test case input:
15925

Expected output:
539990163


Actual output:
-460009844


Fixed submission (verdict: Accepted):
N = int(input())
 
MOD = 10**9 + 7
 
if N==1:
    print(0)
elif N==2:
    print(2)
else:
    ans = pow(10,N,MOD) - 2*pow(9,N,MOD) + pow(8,N,MOD)
    ans = ans%MOD
    print(ans)

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
print((10 ** N - 8 ** N) % (10 ** 9 + 7))


Failing test case input:
4234

Expected output:
645343714


Actual output:
757596976


Fixed submission (verdict: Accepted):
N = int(input())
print((10 ** N - 2 * (9 ** N) + 8 ** N) % (10 ** 9 + 7))
Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
mod = 10 ** 9 + 7
print((pow(10, n, mod) - 2 * pow(9, n, mod) + pow(8, n, mod)))

Failing test case input:
203

Expected output:
857414219


Actual output:
-142585788


Fixed submission (verdict: Accepted):
n = int(input())
mod = 10 ** 9 + 7
print((pow(10, n, mod) - 2 * pow(9, n, mod) + pow(8, n, mod)) % mod)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
a = (10**N-8**N)%(10**9+7)
print(a)

Failing test case input:
112403

Expected output:
286663221


Actual output:
337674433


Fixed submission (verdict: Accepted):
N = int(input())
a = (10**N+8**N-2*(9**N))%((10**9)+7)
print(a)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
ans = ((10**n)%(10**9+7) - (2*(9**n) - 8**n)%(10**9+7)%(10**9+7))
print(ans)

Failing test case input:
4064

Expected output:
961003123


Actual output:
-38996884


Fixed submission (verdict: Accepted):
n=int(input())
ans = ((10**n)%(10**9+7) - (2*(9**n) - 8**n)%(10**9+7))%(10**9+7)
print(ans)

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
i = int(input())
print(i, (10**i - 9**i - 9**i + 8**i) % (10**9 + 7))


Failing test case input:
25292

Expected output:
66208857


Actual output:
25292 66208857


Fixed submission (verdict: Accepted):
i = int(input())
print((10**i - 9**i - 9**i + 8**i) % (10**9 + 7))

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
a = (10**N*+8**N-2*(9**N))%(10**9+7)
print(a)

Failing test case input:
4064

Expected output:
961003123


Actual output:
552239327


Fixed submission (verdict: Accepted):
N = int(input())
a = (10**N+8**N-2*(9**N))%((10**9)+7)
print(a)

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
mod = 10**9+7
print(pow(10, N, mod) - (pow(9, N, mod) * 2 - pow(8, N, mod)))

Failing test case input:
1294

Expected output:
440007546


Actual output:
-559992461


Fixed submission (verdict: Accepted):
N = int(input())
mod = 10**9+7
ans = pow(10, N, mod) - ((pow(9, N, mod) * 2) - pow(8, N, mod))
ans %= mod
ans = (ans + mod) % mod
print(ans)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
mod = 10**9 + 7
ans = 10**n % mod
ans -= (2 * 9**n) % mod
ans += (8**n) % mod

print(ans)

Failing test case input:
6100

Expected output:
898681079


Actual output:
-101318928


Fixed submission (verdict: Accepted):
n = int(input())
mod = 10**9 + 7
ans = 10**n % mod
ans -= (2 * 9**n) % mod
ans += (8**n) % mod

print(ans%mod)

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
MOD = 10**9 + 7

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

print(ans)

Failing test case input:
67881

Expected output:
465817182


Actual output:
-534182825


Fixed submission (verdict: Accepted):
N = int(input())
MOD = 10**9 + 7

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

print(ans % MOD)
Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
mod = int(1e9) + 7
print(pow(10, N, mod) - pow(9, N, mod) - pow(9, N, mod) + pow(8, N, mod))

Failing test case input:
8318

Expected output:
781897777


Actual output:
-218102230


Fixed submission (verdict: Accepted):
N = int(input())
mod = int(1e9) + 7
print((pow(10, N, mod) - pow(9, N, mod) - pow(9, N, mod) + pow(8, N, mod))%mod)

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
mod=1000000007
n=int(input())
print(0 if n==1 else pow(10,n,mod)-1)

Failing test case input:
37402

Expected output:
288115537


Actual output:
67455098


Fixed submission (verdict: Accepted):
mod=1000000007
n=int(input())

print(0 if n==1 else (pow(10,n)-pow(9,n)-pow(9,n)+pow(8,n))%mod)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
Mod = 10**9+7
print(pow(10,N,Mod)-2*pow(9,N,Mod)+pow(8,N,Mod))

Failing test case input:
8318

Expected output:
781897777


Actual output:
-218102230


Fixed submission (verdict: Accepted):
N = int(input())
Mod = 10**9+7
print((pow(10,N,Mod)-2*pow(9,N,Mod)+pow(8,N,Mod))%Mod)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
37402

Expected output:
288115537


Actual output:
-711884470


Fixed submission (verdict: Accepted):
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%mod)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
m=1000000007
print((pow(10,n,m)-2*pow(9,n,m)+pow(8,n,m)))

Failing test case input:
708630

Expected output:
669444534


Actual output:
-330555473


Fixed submission (verdict: Accepted):
n=int(input())
m=1000000007
print(((pow(10,n,m)-2*pow(9,n,m)+pow(8,n,m))+m)%m)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = 10**9+7
def mod(i,j):
    ans = 1
    for _ in range(j):
        ans = (ans*i)%a
    return(ans)

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

Failing test case input:
694

Expected output:
315324489


Actual output:
-684675518


Fixed submission (verdict: Accepted):
n = int(input())
a = 10**9+7
def mod(i,j):
    ans = 1
    for _ in range(j):
        ans = (ans*i)%a
    return(ans)

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

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

mod = 10**9 + 7
a = (10**n) % mod
b = (9**n) % mod
c = (8**n) % mod

print(a - 2*b + c)

Failing test case input:
76846

Expected output:
501630130


Actual output:
1501630137


Fixed submission (verdict: Accepted):
n = int(input())

mod = 10**9 + 7
a = (10**n) % mod
b = (9**n) % mod
c = (8**n) % mod

print((a - 2*b + c)%mod)
Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from collections import defaultdict
from collections import deque
from collections import Counter
import math
import itertools

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n = readInt()
if n==1:
	print(0)
	exit()
mod = 10**9+7
a = pow(10,n,mod)
b = pow(8,n,mod)
c = pow(9,n,mod)
print(a-2*c+b)


Failing test case input:
6812

Expected output:
797002527


Actual output:
-202997480


Fixed submission (verdict: Accepted):
from collections import defaultdict
from collections import deque
from collections import Counter
import math
import itertools

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n = readInt()
if n==1:
	print(0)
	exit()
mod = 10**9+7
a = pow(10,n,mod)
b = pow(8,n,mod)
c = pow(9,n,mod)
print((a-2*c+b)%mod)

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
p = 10**9+7
N = int(input())
print(pow(10, N, p) - pow(9, N, p) * 2 + pow(8, N, p))

Failing test case input:
9378

Expected output:
349134206


Actual output:
-650865801


Fixed submission (verdict: Accepted):
p = 10**9+7
N = int(input())
print((pow(10, N, p) - pow(9, N, p) * 2 + pow(8, N, p)) % p)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
10667

Expected output:
70415393


Actual output:
1070415400


Fixed submission (verdict: Accepted):
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)
   if ans<0:
      ans+=mod
   print(ans%mod)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def modpow(a,n,mod):
    res = 1
    while n > 0:
        if n&1:
            res = res * a % mod
        a = a * a % mod
        n >>= 1
    return res



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

Failing test case input:
1294

Expected output:
440007546


Actual output:
535110223


Fixed submission (verdict: Accepted):
import math

mod = 10**9+7
N = int(input())

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

def main():
    ans = 0
    x0 = modpow(8,N)
    x1 = modpow(9,N)
    x2 = modpow(10,N)
    ans = (x2-2*x1+x0)%mod    

    print(ans)
main()

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
MOD = 10**9 + 7
n = int(input())
ans = pow(10, n, MOD) - pow(9, n, MOD) * 2 + pow(8, n, MOD)
print(ans)

Failing test case input:
34393

Expected output:
727143384


Actual output:
-1272856630


Fixed submission (verdict: Accepted):
MOD = 10**9 + 7
n = int(input())
ans = MOD + pow(10, n, MOD) - pow(9, n, MOD) * 2 + pow(8, n, MOD)
print(ans % MOD)
Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):

import sys
input = sys.stdin.readline
MOD = 10**9 + 7

n = int(input())

ret = pow(10, n, MOD)
ret -= pow(9, n, MOD)
ret -= pow(9, n, MOD)
ret += pow(8, n, MOD)

print(ret)

Failing test case input:
6812

Expected output:
797002527


Actual output:
-202997480


Fixed submission (verdict: Accepted):

import sys
input = sys.stdin.readline
MOD = 10**9 + 7

n = int(input())

ret = pow(10, n, MOD)
ret -= pow(9, n, MOD)
ret -= pow(9, n, MOD)
ret += pow(8, n, MOD)

print(ret % MOD)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

MOD = 10**9 + 7

print(pow(10, n, MOD)-pow(9, n, MOD) - pow(9, n, MOD) + pow(8, n, MOD))

Failing test case input:
6053

Expected output:
584615795


Actual output:
-415384212


Fixed submission (verdict: 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 = (ans+MOD)%MOD

print(ans)

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())

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

Failing test case input:
10667

Expected output:
70415393


Actual output:
1070415400


Fixed submission (verdict: 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)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
mod = 10 ** 9 + 7
A = pow(10, N, mod)
B = pow(9, N, mod)
C = pow(8, N, mod)
A = A - (2 * B - C)
if A < 0:
  A = A + mod
print(A)

Failing test case input:
9961

Expected output:
540079694


Actual output:
-459920313


Fixed submission (verdict: Accepted):
N = int(input())
mod = 10 ** 9 + 7
A = pow(10, N, mod)
B = pow(9, N, mod)
C = pow(8, N, mod)
A = A - (2 * B - C)
A %= mod
if A < 0:
  A = A + mod
print(A)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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) )
  

Failing test case input:
6053

Expected output:
584615795


Actual output:
-415384212


Fixed submission (verdict: Accepted):
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)) % (10**9 + 7))

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
pr=10**9+7
print((pow(10,N,pr)-2*pow(9,N,pr)+pow(8,N,pr)%pr))

Failing test case input:
9378

Expected output:
349134206


Actual output:
-650865801


Fixed submission (verdict: Accepted):
N=int(input())
pr=10**9+7
print((pow(10,N,pr)-2*pow(9,N,pr)+pow(8,N,pr))%pr)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a = int(input())
b = 9**a - 2*(8**a) + 7**a
c = (10**9) + 7
print(b%c)

Failing test case input:
970

Expected output:
678801259


Actual output:
118661064


Fixed submission (verdict: Accepted):
a = int(input())
b = 10**a - 2*(9**a) + 8**a
c = 10**9 + 7
print(b%c)
Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())
mod = 10**9+7
a = pow(10, n, mod)
b = pow(9, n, mod)
c = pow(8,n,mod)
ans = a-2*b+c
print(ans)

Failing test case input:
15925

Expected output:
539990163


Actual output:
-460009844


Fixed submission (verdict: Accepted):
n = int(input())
mod = 10**9+7
a = pow(10, n, mod)
b = pow(9, n, mod)
c = pow(8,n,mod)
ans = a-2*b+c
ans %= mod
print(ans)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

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


Failing test case input:
901

Expected output:
912668781


Actual output:
-87331226


Fixed submission (verdict: Accepted):
n = int(input())

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

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    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))

if __name__ == "__main__":
    main()

Failing test case input:
15421

Expected output:
778744163


Actual output:
-1221255851


Fixed submission (verdict: Accepted):
def main():
    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)

if __name__ == "__main__":
    main()

Problem: p02554
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):

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


Failing test case input:
16756

Expected output:
461790329


Actual output:
-538209678


Fixed submission (verdict: Accepted):

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

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
970

Expected output:
678801259


Actual output:
1678801266


Fixed submission (verdict: Accepted):
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)

Problem: p02554
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
MOD = 1000000000 + 7
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
print(str(power_func(10, N, MOD) - 2 * power_func(9, N, MOD) + power_func(8, N, MOD)))


Failing test case input:
131677

Expected output:
810813404


Actual output:
-189186603


Fixed submission (verdict: Accepted):
N = int(input())
MOD = 1000000000 + 7
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
print(str((power_func(10, N, MOD) - 2 * power_func(9, N, MOD) + power_func(8, N, MOD)) % MOD))