TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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.

Submission attempts (in order):
M = 10**9 + 7
n = int(input())
print((pow(10, n, M) - 2 * pow(9, n, M) + pow(8, n, M) % M)


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


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
def powmod(a, n, p):
    if(n==0):
        return 1
    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())
if(N==1):
  print(0)
else:
  print(powmod(10,N-2,10**9+7))


N=int(input())
if(N==1):
  print(0)
else:
  result = (-7)**(N-2) if(N%2==0)else 1000000007-7**(N-2)
  print(result)

def powmod(a, n, p):
    if(n==0):
        return 1
    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())
if(N==1):
  print(0)
else:
  print(powmod(10,N-2))

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)


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
MOD = int(1e9 + 7)

a, b, c = 1, 1, 1

for i in range(n):
    a *= 10;
    b *= 18;
    c *= 8;
    a %= MOD;
    b %= MOD;
    c %= MOD;
    
print((a - b + c) % MOD);

n = int(input())
MOD = int(1e9 + 7)

cnt = n * (n - 1) % MOD

for i in range(n - 2):
    cnt *= 9
    cnt %= MOD

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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))


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


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):

import math
N = int(input())
a = 10**9+7

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


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


import math
N = int(input())
a = 10**9+7

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


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



import math
N = int(input())
a = 10**9+7

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


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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
a, b, c = 1, 1, 1
for i in range(n):
  a, b, c = a * 10, b * 9, c * 8
  a, b, c = a % (10**9+7), b % (10**9+7), , c % (10**9+7)
print(0 if n==1 else (a - b*2 + c) % (10**9+7))

n = int(input())
a, b, c = 1, 1, 1
for i in range(n):
  a, b, c = a * 10, b * 9, c * 8
  a, b, c = a % (10**9+7), b % (10**9+7), c % (10**9+7)
print(0 if n==1 else (a - b*2 + c) % (10**9+7))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
ans = 10**N - 2*(9**N) - 8**N
print(ans)

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import sys
input = sys.stdin.readline
def main():
    N = int(input())
    M = 10**9 + 7
    if N == 1:
        print(0)
        return
    ans = 0
    ans = 10**N - (9**N)*2 + 8**N - 2
    print(ans%M)    

if __name__ == '__main__':
    main()

import sys
input = sys.stdin.readline
def main():
    N = int(input())
    M = 10**9 + 7
    if N == 1:
        print(0)
        return
    ans = 0
    ans = 10**N - (9**N)*2 + 8**N 
    print(ans%M)    

if __name__ == '__main__':
    main()

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
def binexp(b):
  res = 1
  while b>0:
    if b&1:
      res *= a
      res%=mod
    a *= a
    a%=mod
    b>>=1
  return res
mod = 1000000007
n = int(input())
if n==1:
  print(0)
elif n==2:
  print(1)
else:
  count = 1
  n -= 2
  ans = binexp(n)
  print(ans)

def binexp(a,b):
  res = 1
  while b>0:
    if b&1:
      res *= a
      res%=mod
    a *= a
    a%=mod
    b>>=1
  return res
mod = 1000000007
n = int(input())
if n==1:
  print(0)
elif n==2:
  print(2)
else:
  ans = binexp(10,n)
  ans1 = binexp(9,n)
  ans2 = binexp(8,n)
  print((ans-2*ans1+ans2)%mod)


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
a,b,c,d=map(int,input().split())

if a*b>0 and c*d>0 and (a<0 ^ c<0):
  ans=max(a*d,b*c)
else:
  ans=max(a*c,b*d)
print(ans)

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
if n==1:
  print(0)
else:
  print(int(x%mod))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
def main():
    n = int(input())
    MOD = 10**9 + 7

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


if __name__ == "__main__":
    main()

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

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


if __name__ == "__main__":
    main()

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())


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

print(a%(1e9+7))

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
mod=10**9+7
ans=pow(n,10,mod)
ans-=2*pow(n,9,mod)
ans+=pow(n,8,mod)
print(ans%mod)

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)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
MOD = 10**9 + 7
if n == 1:
    print(0)
elif n == 2:
    print(1)
else:
    ans = pow(10, n, MOD) + pow(8, n, MOD) - 2 * pow(9, n, MOD)
    print(ans % MOD)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
ans = 1
ans1 = 1
ans2 = 1
mod = 1000000007
for i in range(n):
	ans = (ans*10)%mod
    ans2 = (ans2*8)%mod
	ans1 = (ans1*9)%mod
ans = (ans - ans1 + mod)%mod
ans = (ans - ans1 + mod)%mod
ans = (ans + ans2)%mod
print(ans)


n = int(input())
ans = 1
ans2 = 1
mod = 1000000007
for i in range(n):
	ans = (ans*10)%mod
	ans2 = (ans2*8)%mod
ans = (ans - ans2 + mod)%mod
print(ans)


n = int(input())
ans = 1
ans2 = 1
mod = 1000000007
for i in range(n):
	ans = (ans*10)%mod
    ans2 = (ans2*8)%mod
ans = (ans - ans2 + mod)%mod
print(ans)

n = int(input())
ans = 1
ans1 = 1
ans2 = 1
mod = 1000000007
for i in range(n):
	ans = (ans*10)%mod
	ans2 = (ans2*8)%mod
	ans1 = (ans1*9)%mod
ans = (ans - ans1 + mod)%mod
ans = (ans - ans1 + mod)%mod
ans = (ans + ans2)%mod
print(ans)


Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
ans = (((n - 1) ** 8 % 1000000007) * (2 * n - 1)) % 1000000007
print(ans)

n = int(input())
ans = (((10 ** n) - 1) - (9 ** n) - (9 ** n) + (8 ** n) + 1) % 1000000007
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
x = n*(n-1)%1000000007
y = 10**(n-2)%1000000007
print((x*y)%1000000007

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
M=10**9+7
print((pow(10,n,M)-pow(8,n,M))%M)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
if n >=2:
  ans = (10**(n-2)*n*(n-1))/(10**9 + 7)
else:
  ans = 0
print(ans)

n = int(input())
print((10**n -2*9**n + 8**n)/1000000007)

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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 %= res
            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) % mod
    print(ans)
 
if __name__ == '__main__':
    main()

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) % mod
    print(ans)
 
if __name__ == '__main__':
    main()


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N=int(input())

a=2**N-2
MOD=10**9+7

p=1
b=0
import math
for i in range(1,N):
    p=(math.factorial(N))/math.factorial((N-i))
    b=p*8+(2**(N-i)-2)%MOD
ans=a+b%MOD
print(int(ans))

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

ans=10**N %MOD
ans=ans-2*9**N %MOD
ans=ans+8**N %MOD

print(ans%MOD)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
MOD = 10**9 + 7
ans = pow(10,n,MOD) - 2*pow(9.n,MOD) - pow(8,n,MOD)
print(ans%MOD)

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

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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import sys
N = int(input())

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

if N == 2:
    print(1)
    sys.exit(0)

# out = (N * (N - 1) * (10 ** (N - 2))) % ((10 ** 9) + 7)
out = ((10 ** N) - ((9 ** N) * 2 - (8 ** N))) % ((10 ** 9) + 7)
print(out)


import sys
N = int(input())

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

if N == 2:
    print(2)
    sys.exit(0)

# out = (N * (N - 1) * (10 ** (N - 2))) % ((10 ** 9) + 7)
out = ((10 ** N) - ((9 ** N) * 2 - (8 ** N))) % ((10 ** 9) + 7)
print(out)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)

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

ret1 = modpow(10,N,MOD) 
ret2 = modpow(8,N,MOD)
ret3 = modpow(9,N,MOD)
ret = (ret1 - ret3 - ret3 + ret2) % MOD
print(ret)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
#ans=(n*(n-1))//2*pow(8,n-2)
#ans=(pow(10,n)-pow(8,n))%1000000007
ans=(10**n-8**n)%1000000007
print(ans%1000000007)
    

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)

N = int(input())








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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
mod = 10**9+7
N = int(input())
ans = (pow(a,N,mod) - 2*pow(b, N, mod) + pow(c, N, mod))%mod
if ans < 0:
    ans += mod
print(ans)


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)


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
MOD = 10 ** 9 + 7
if N == 1:
  print(0)
  exit()
a = 1
b = 1
c = 1
for i in range(N):
  a = pow(10, n, MOD)
  b = pow(9, n, MOD)
  c = pow(8, n, MOD)
ans = a - (2 * b) + c
if ans < 0:
  ans += MOD
print(ans)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
def main():
    N = input()
    print((10 ** N - 9 ** N - 9 ** N + 8 ** N)%(10**9 + 7))

main()

def main():
    N = int(input())
    print((10**N - 9**N - 9**N + 8**N)%(10**9 + 7))

main()


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())

c = 1
ans =1

for i in range(n) :
    ans = ans * (pow(8,i+1)%1000000007) % 1000000007
print(ans)

n = int(input())

a=1
b=1
c=1

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

print((a-b-b+c)% 1000000007)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
n = int(input())
mod = int(1e9)+7
print((pow(10, n, mod) - 2*pow(9, n, mod) + pow(8, n, mod))%mod)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n,m=int(input()),10**9+7
print((pow(10,p,m)-2*pow(9,p,m)+pow(8,p,m))%m)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
a=(10**n-8**n)//(10**9+7)
print(a)


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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
def main():
  MOD = int(1e9 + 7)
  n = int(input())
  print((pow(10,n,MOD) - 2*pow(9 , n , MOD)%MOD + pow(8 , n , MOD) + MOD)%MOD)

if __namme__ == "__main__":
  main()

def main():
  MOD = int(1e9 + 7)
  n = int(input())
  print((pow(10,n,MOD) - 2*pow(9 , n , MOD)%MOD + pow(8 , n , MOD) + MOD)%MOD)
 
if __name__ == "__main__":
  main()

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
ans = pow(10,n,mod)
ans -= pow(9,n,mod)*2
ans += pow(8,n,mod)
print(ans%mod)


import numpy as np

n = int(input())
MOD = 1000000007
ans = 10**n - 9**n -9**n + 8**n
ans = ans % MOD
print(ans)


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):

NUM = 1000000007

N = int(input())

all_colab = pow(10, N)
except_0or9_colab = pow(9, N)
except_0and9_colab = pow(8, N)

print(all_colab - (2*except_0or9_colab + except_0and9_colab))

NUM = 1000000007

N = int(input())

all_colab = pow(10, N)
except_0or9_colab = pow(9, N)
except_0and9_colab = pow(8, N)

include_0and9_colab = all_colab - (2*except_0or9_colab - except_0and9_colab)

print(include_0and9_colab % NUM)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
k=10**9+7
ans=(10**n)%k-(8**n)%k
print(ans%k)

n=int(input())
k=10**9+7
ans=(10**n)%k+(8**n)%k-2*((9**n)%k)
print(ans%k)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
P=1000000007
print((pow(10,n,P)-pow(8,n,P)) % P)

n=int(input())
P=1000000007
all = pow(10,n,P)
no0 = pow(9,n,P)
no9 = pow(9,n,P)
neither = pow(8,n,P)
print((all - (no0 + no9 - neither)) % P)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
mod = 10**9 + 7
print(pow(10, n, mod) - 2*pow(9, n, mod) - pow(8, n, mod))

n = int(input())
print(pow(10, n, mod) - 2*pow(9, n, mod) - pow(9, n, mod))

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

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

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
a = 2*(10^N-9^N)-(10^N-8^N)

ans = a % (10^9+7)
print(ans)


N = int(input())

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

N = int(input())
a = 2 * (10**(N) - 9**(N)) - (10**(N) - 8**(N))        
ans = a % (10**9+7)
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())

zero_least = 1

not_09 = 1

all_num = 1
for _ in range(n):
    zero_least = zero_least * 9
    not_09 = not_09 * 8 
    all_num = all_num * 10

nine_least = zero_least

result = zero_least + not_09 + nine_least - all_num

waru  =1
for i in range(9):
    waru = waru * 10
waru += 9

print(result%waru)

N = int(input())

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import numpy as np

m = 1e9+7

N = int(input())

print(type(N))

def culc_mod(a, b, md):
    """a^b (mod md)"""
    tmp = 1
    for _ in range(b):
        tmp *= a
        tmp = tmp%md
    return tmp
    
a = culc_mod(10, N, m)
b = culc_mod(9, N, m)
c = culc_mod(8, N, m)

print(int((a-2*b+c)%m))

import numpy as np

m = 1e9+7

N = int(input())

def culc_mod(a, b, md):
    """a^b (mod md)"""
    tmp = 1
    for _ in range(b):
        tmp *= a
        tmp = tmp%md
    return tmp
    
a = culc_mod(10, N, m)
b = culc_mod(9, N, m)
c = culc_mod(8, N, m)

print(int((a-2*b+c)%m))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):

def cal(N):
  for n in range(3,N+1):
    left = N - n
    right = n
    if left < 6:
      return 1
    else:
      return 1 + cal(left)

    if right < 6:
      return 1
    else:
      return 1 + cal(right)
    
    
S = int(input())

if S < 3:
  print(0)
  exit()
else:
  ans = cal(S)
  print((1+ans)%dekai())


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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
a = (10**N*+8**N-2*(9**N))%((10**9)+7)
print(a)

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

N = int(input())
a = (10**N-8**N)%(10**9+7)
print(a)

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a=list(input())
print((a.count('9')+a.count('0'))%10**9+7)

#                               #
    # author : samars_diary #
    
#                               #

import sys, os.path, math

#if(os.path.exists('input.txt')):
    
    #sys.stdout = open('output.txt',"w")



mod =  1000000007
def i(): return sys.stdin.readline().strip()
def ii(): return int(sys.stdin.readline())
def li(): return list(sys.stdin.readline().strip())
def mii(): return map(int, sys.stdin.readline().split())
def lii(): return list(map(int, sys.stdin.readline().strip().split()))

#print=sys.stdout.write

a=ii();print((pow(10,a,mod)+pow(8,a,mod)-2*pow(9,a,mod))%mod)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import sys

input=sys.stdin.buffer.readline



#from functools import lru_cache

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


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


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


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


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


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


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


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


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

if __name__=="__main__":
	main()


import sys

input=sys.stdin.buffer.readline



#from functools import lru_cache

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


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


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


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


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


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


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


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


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

if __name__=="__main__":
	main()


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import sys
input = sys.stdin.readline
mod = int(1e9)+7

def solve():
    n=int(input())
    if n<3:
        print(0)
        return
    dp=[0]*2001
    dp[3]=dp[4]=dp[5]=1
    for i in range(6,n+1):
        dp[i]=(dp[i-1]+dp[i-3])%mod
    print(dp[n])

if __name__=="__main__":
    solve()





import sys
import math
input = sys.stdin.readline
mod = int(1e9)+7

def solve():
    n=int(input())
    ans = pow(10,n,mod)-(2*pow(9,n,mod)-pow(8,n,mod))
    print(ans%mod)

    
if __name__=="__main__":
    solve()





Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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))


s = int(input())

n = 10 ** s - 9 ** s - 9 ** s + 8 ** s

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
cur = 8
bot = n
t = 0
for i in range(1, n):
    t += cur*(bot//i)
    cur *= 8
    bot *= n-i

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
A=1000000007
x=10**n - 8**n
print(x%A)

n=int(input())
A=1000000007
x=10**n - 2*9**n + 8**n
print(x%A)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = input()
satisfied_pattern = 10**N - (2*(9**N) - 8**N)
output = satisfied_pattern % (10**9+7)
print(output)


from sys import stdin
N = stdin.readline().rstrip()
N = int(N)
satisfied_pattern = 10**N - (2*(9**N) - 8**N)
output = satisfied_pattern % (10**9+7)
print(output)


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
a = 10**N - 8**N - 2*9**N
b = a % (10**9  + 7)
print(b)

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


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


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
N = int(input())

all = 0
for i in range(2, N//2+1):
    basyo = combinations_count(N, i)  

    zero_iti  = 2 ** (3 * N - 2 * i - 1)  
    zero_iti2 = 2 ** (N + 2 * i - 1)      

    all += basyo * (zero_iti + zero_iti2)

if S % 2 == 0:  
    basyo = combinations_count(N, N)
    zero_iti = 2 ** (N - 1)
    all += basyo * zero_iti

if S % 2 == 1:  
    basyo = combinations_count(N, N)
    zero_iti = 2 ** (N - 1)
    all += basyo * zero_iti

    basyo = combinations_count(N, N - 1)
    zero_iti = 2 ** (N - 2)
    all += basyo * zero_iti

print(int(all % (10**9+7)))

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


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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
from sys import stdin

N = int(stdin.readline().rstrip())

if N == 1:
    print(0)
elif N == 2:
    print(1)
else:
    print(
        (
            (10 ** N) - (9 ** N) - (9 ** N) + (8 ** N)
        ) % (10 ** 9 + 7))

from sys import stdin

N = int(stdin.readline().rstrip())

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)

import numpy as np

n = int(input())

div=1000000007

loop=(n)//10
amari=(n)%10

mod1=1
mod2=1
mod3=1
for i in range(0,loop):
  mod1=(mod1*(10**10 % div) ) % div
  mod2=(mod2*(9**10 % div) ) % div
  mod3=(mod3*(8**10 % div) ) % div
mod1=mod1*(10**amari % div)
mod2=mod2*(9**amari % div)
mod3=mod3*(8**amari % div)

#print (loop, amari)
#print (mod1, mod2, mod3)
print((((mod1-mod2*2))+mod3) % div)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
print((10**n-9**n*2+8**n)%(1e9+7))

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())

mod = int(1e9+7)

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

print(ans)


n = int(input())

mod = 10**9 + 7

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

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
def bekijou(a,x):
  MOD = 1000000009
  ret = 1
  for _ in range(x):
    ret *= a
    ret %= MOD
    
n=int(input())
ret = 0
sum = bekijou(9,n)
MOD = 1000000009
ret = (2 * sum) % MOD
ret += MOD - bekijou(8,n)
ret = bekijou(10,n) + MOD - ret
print(ret)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
ans = (10**n)%-2*(9**n)+8**n
print(ans%(10**9+7))

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


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


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
mod = 10** + 7
if N == 1:
  print(0)
else:
  ans = N*10**(n-2)
  print(ans%mod)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n=input()
print((10**n-(2*9**n-8**n))%(10**9+7))

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import math

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

n = int(input())
mod = (10**9)+7
ans = (10**n) - 2*(9**n) + 8**n
print(ans%mod)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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)


N = int(input())

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

print(ans)



Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
mod = 10 ** 9 + 7

N = int(input())

result = 0

ten = pow(10, N, mod)
nine = pow(9, N, mod)
eight = pow(8, N, mod)

result = (ten - 2 * nine + eight) % mode

print(result)

mod = 10 ** 9 + 7

N = int(input())

result = 0

ten = pow(10, N, mod)
nine = pow(9, N, mod)
eight = pow(8, N, mod)

result = (ten - 2 * nine + eight) % mod

print(result)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
mod = 10**9+7
print ((pow(10,N,mod) - 2*pow(9,N,mod) + pow(8,N,mod)) % mod)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):


import math

N=int(input())

mod=10**9+7

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




N=int(input())

mod=10**9+7

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import math
n=int(input)
m=(10**n)-(2*(9**n))+(8**n)
print(m%1000000007)

import math
n=int(input())
m=((10**n)-(2*(9**n))+(8**n))%1000000007
print(m)


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())

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

n = int(input())

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


Verdicts: Runtime Error

Accepted