Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, m, n) for(int i = (int)(m); i < (int)(n); ++i)

const int MOD = 1e+9 + 7;

template <typename T=long long>
t pow_mod(T n, T p, T m)
{
    if(p == 0) return 1;
    if(p%2 == 1) return pow_mod<T>(n, p-1, m) * n % m;
    else{
        T tmp = pow_mod<T>(n, p/2, m) % m;
        return tmp * tmp % m;
    }
}

// nCk を O(n) で求めるクラス
template <typename T>
class Combination 
{
    private:
        int _mod;
        std::vector<T> factorial, factorial_inv;

    public:
        Combination(int n, int mod): _mod(mod), factorial(n+1, 1), factorial_inv(n+1)
        {
            for(int i = 1; i <= n; ++i) factorial[i] = (i*factorial[i-1]) % _mod;
            factorial_inv[n] = pow_mod<T>(factorial[n], _mod-2, _mod);  // 逆元を取る操作は重いので一回のみ行う
            for(int i = n; i >= 1; --i) factorial_inv[i-1] = (i*factorial_inv[i]) % _mod;
        } 

        T operator()(int n, int k)
        {
            if(n < 0 or k > n) return 0;
            return factorial[n] * factorial_inv[k] %_mod * factorial_inv[n-k] %_mod;
        }
};

int main()
{
    int N;
    cin >> N;

    Combination<long long> comb(N, MOD);

    long long ans = 0;
    FOR(i, 1, N){  // 0 が i 個あるとき
        ans += comb(N, i) * (pow_mod<long long>(9, N-i, MOD)-pow_mod<long long>(8, N-i, MOD)) % MOD;
        ans %= MOD;
    }
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc:12:1: error: 't' does not name a type
   12 | t pow_mod(T n, T p, T m)
      | ^
a.cc: In constructor 'Combination<T>::Combination(int, int)':
a.cc:34:32: error: 'pow_mod' was not declared in this scope; did you mean '_mod'?
   34 |             factorial_inv[n] = pow_mod<T>(factorial[n], _mod-2, _mod);  // 逆元を取る操作は重いので一回のみ行う
      |                                ^~~~~~~
      |                                _mod
a.cc:34:41: error: expected primary-expression before '>' token
   34 |             factorial_inv[n] = pow_mod<T>(factorial[n], _mod-2, _mod);  // 逆元を取る操作は重いので一回のみ行う
      |                                         ^
a.cc: In function 'int main()':
a.cc:54:30: error: 'pow_mod' was not declared in this scope
   54 |         ans += comb(N, i) * (pow_mod<long long>(9, N-i, MOD)-pow_mod<long long>(8, N-i, MOD)) % MOD;
      |                              ^~~~~~~
a.cc:54:38: error: expected primary-expression before 'long'
   54 |         ans += comb(N, i) * (pow_mod<long long>(9, N-i, MOD)-pow_mod<long long>(8, N-i, MOD)) % MOD;
      |                                      ^~~~
a.cc:54:38: error: expected ')' before 'long'
   54 |         ans += comb(N, i) * (pow_mod<long long>(9, N-i, MOD)-pow_mod<long long>(8, N-i, MOD)) % MOD;
      |                             ~        ^~~~
      |                                      )
a.cc: In instantiation of 'Combination<T>::Combination(int, int) [with T = long long int]':
a.cc:50:39:   required from here
   50 |     Combination<long long> comb(N, MOD);
      |                                       ^
a.cc:34:52: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = long long int; _Alloc = std::allocator<long long int>; reference = long long int&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   34 |             factorial_inv[n] = pow_mod<T>(factorial[n], _mod-2, _mod);  // 逆元を取る操作は重いので一回のみ行う
      |                                           ~~~~~~~~~^
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: declared here
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~