buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
n = int(input()) MOD = 10**9+7 # ans = (10**n-9**n) + (10**n-9**n) - (10**n-8**n) ans = pow(10,n,MOD) -2 * pow(9,n,MOD) + pow(8,n,MOD) print(ans)
n = int(input()) MOD = 10**9+7 # ans = (10**n-9**n) + (10**n-9**n) - (10**n-8**n) ans = pow(10,n,MOD) -2 * pow(9,n,MOD) + pow(8,n,MOD) ans %= MOD print(ans)
[["+", 36, 36, 0, 656, 0, 1, 0, 677, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 677, 17, 132], ["+", 36, 36, 0, 656, 0, 1, 0, 677, 12, 22]]
5
50
#include <iostream> using namespace std; using ll = long long; constexpr ll M = 1e9 + 7; #define MOD(a, b) ((((ll)(a) % M) * ((ll)(b) % M)) % M) ll mypw(int x, int n) { if (n <= 0) return 1; if (n == 1) return x; ll k = mypw(x, n / 2); k = MOD(k, k); if (n % 2 == 0) { return k; } else { retu...
#include <iostream> using namespace std; using ll = long long; constexpr ll M = 1e9 + 7; #define MOD(a, b) ((((ll)(a) % M) * ((ll)(b) % M)) % M) ll mypw(int x, int n) { if (n <= 0) return 1; if (n == 1) return x; ll k = mypw(x, n / 2); k = MOD(k, k); if (n % 2 == 0) { return k; } else { retu...
[["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 22]]
1
149
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i, n) for (int i = 0; i < (int)(n); i++) //二項係数の計算 int nCr(int A, int B) { ll ans = 1; for (int i = 0; i < B; i++) { ans *= A - i; } for (int i = 0; i < B; i++) { ans /= i + 1; } return ans; } lon...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i, n) for (int i = 0; i < (int)(n); i++) //二項係数の計算 int nCr(int A, int B) { ll ans = 1; for (int i = 0; i < B; i++) { ans *= A - i; } for (int i = 0; i < B; i++) { ans /= i + 1; } return ans; } lon...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 132], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22]]
1
227
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define int long long int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; if (n <= 1) cout << 0 << endl; else if (n == 2) cout << 2 << endl; else { int ans = 1, nonzero = 1, nonnine = 1, n...
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define int long long int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; if (n <= 1) cout << 0 << endl; else if (n == 2) cout << 2 << endl; else { int ans = 1, nonzero = 1, nonnine = 1, n...
[["+", 0, 57, 75, 76, 0, 9, 0, 52, 0, 89], ["+", 75, 76, 0, 9, 0, 52, 15, 339, 0, 24], ["+", 0, 9, 0, 52, 15, 339, 51, 16, 31, 22], ["+", 0, 9, 0, 52, 15, 339, 51, 16, 17, 18], ["+", 0, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["+", 75, 76, 0, 9, 0, 52, 15, 339, 0, 25]]
1
181
N=int(input()) ans=10**n-2*(9**n)+8**n ans=ans%1000000007 print(ans)
n=int(input()) ans=10**n-2*(9**n)+8**n ans=ans%1000000007 print(ans)
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22]]
5
34
#include <bits/stdc++.h> #define int long long #define mod 1000000007 using namespace std; signed main() { int n, semua, atau, dua; cin >> n; semua = atau = dua = 1; for (int i = 0; i < n; i++) { semua = (10 * semua + mod) % mod; atau = (9 * atau + mod) % mod; dua = (8 * dua + mod) % mod; } cou...
#include <bits/stdc++.h> #define int long long #define mod 1000000007 using namespace std; signed main() { int n, semua, atau, dua; cin >> n; semua = atau = dua = 1; for (int i = 0; i < n; i++) { semua = (10 * semua + mod) % mod; atau = (9 * atau + mod) % mod; dua = (8 * dua + mod) % mod; } cou...
[["+", 0, 16, 31, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 31, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 23, 0, 25], ["+", 31, 23, 0, 16, 31, 16, 31, 16, 17, 109], ["+", 31, 23, 0, 16, 31, 16, 31, 16, 12, 22]]
1
111
import java.util.Arrays; import java.util.HashMap; import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().run(); } private void run() { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long ans = 0; ans = pow_m(10, n) - pow_m(9, n) - pow_m(9,...
import java.util.Arrays; import java.util.HashMap; import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().run(); } private void run() { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long ans = 0; ans = pow_m(10, n) - pow_m(9, n) - pow_m(9, ...
[["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22]]
3
1,100
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = sc.nextInt(); long ans = 0; long all = 1; long minas = 1; long plus = 1; long mod = 1000000007; for (int i = 0; i < N; i++) { all = all * 10 % mod; ...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = sc.nextInt(); long ans = 0; long all = 1; long minas = 1; long plus = 1; long mod = 1000000007; for (int i = 0; i < N; i++) { all = all * 10 % mod; ...
[["+", 0, 195, 8, 196, 0, 1, 0, 11, 17, 132], ["+", 0, 195, 8, 196, 0, 1, 0, 11, 12, 22], ["+", 8, 498, 0, 195, 8, 196, 0, 1, 0, 35], ["+", 0, 195, 8, 196, 0, 1, 0, 11, 31, 22]]
3
138
#include <bits/stdc++.h> #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define endl "\n" #define ALL(a) ...
#include <bits/stdc++.h> #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define endl "\n" #define ALL(a) ...
[["+", 31, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 31, 16, 31, 23, 0, 16, 12, 16, 12, 13]]
1
173
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } using namespace s...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } using namespace s...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 132], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22]]
1
274
// #pragma GCC optimize("Ofast") // #pragma GCC target("avx,avx2,fma") // #pragma GCC optimization ("unroll-loops") #include <bits/stdc++.h> using namespace std; /********************************************************************/ #define M1 1000000007 #define M3 1000000009 #define M2 998244353 #define ll long long ...
// #pragma GCC optimize("Ofast") // #pragma GCC target("avx,avx2,fma") // #pragma GCC optimization ("unroll-loops") #include <bits/stdc++.h> using namespace std; /********************************************************************/ #define M1 1000000007 #define M3 1000000009 #define M2 998244353 #define ll long long ...
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 16, 12, 23, 0, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
589
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<string, string> pss; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pii> vii; typedef vector<ll> vl; typedef vector<vl> vvl; double EPS = 1e-9; int INF = 1000000005; l...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<string, string> pss; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pii> vii; typedef vector<ll> vl; typedef vector<vl> vvl; double EPS = 1e-9; int INF = 1000000005; l...
[["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 12, 22], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22]]
1
556
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define pie 3.1415926536 #define pb push_back #define N 1000000007 #define M 998244353 #define rep(i, a, b) for (int i = a; i <= b; i++) #define nrep(i, a, b) for (int i = a; i >= b; i--) #define pl pair<ll, ll> #define pi pair<...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define pie 3.1415926536 #define pb push_back #define N 1000000007 #define M 998244353 #define rep(i, a, b) for (int i = a; i <= b; i++) #define nrep(i, a, b) for (int i = a; i >= b; i--) #define pl pair<ll, ll> #define pi pair<...
[["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 12, 22]]
1
245
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))
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22]]
5
70
#include <bits/stdc++.h> using namespace std; typedef long long ll; /* ll modpow(ll x,ll y,ll mod){ ll res=1; for(ll i=0;i<y;i++){ res=res*x%mod; } return res; }*/ unsigned long long modpow(unsigned long long a, unsigned long long n, unsigned long long mod) { unsigned...
#include <bits/stdc++.h> using namespace std; typedef long long ll; /* ll modpow(ll x,ll y,ll mod){ ll res=1; for(ll i=0;i<y;i++){ res=res*x%mod; } return res; }*/ long long modpow(long long a, long long n, long long mod) { long long res = 1; while (n > 0) { if (n & 1) res = res % ...
[["-", 36, 36, 0, 30, 0, 14, 39, 86, 0, 87], ["-", 49, 53, 54, 55, 0, 56, 39, 86, 0, 87], ["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 87]]
1
155
#include <bits/stdc++.h> using namespace std; typedef long long ll; /* ll modpow(ll x,ll y,ll mod){ ll res=1; for(ll i=0;i<y;i++){ res=res*x%mod; } return res; }*/ unsigned long long modpow(unsigned long long a, unsigned long long n, unsigned long long mod) { unsigned...
#include <bits/stdc++.h> using namespace std; typedef long long ll; /* ll modpow(ll x,ll y,ll mod){ ll res=1; for(ll i=0;i<y;i++){ res=res*x%mod; } return res; }*/ long long modpow(long long a, long long n, long long mod) { long long res = 1; for (ll i = 0; i < n; i++) { res = res * a % ...
[["-", 36, 36, 0, 30, 0, 14, 39, 86, 0, 87], ["-", 49, 53, 54, 55, 0, 56, 39, 86, 0, 87], ["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 87]]
1
141
#include "bits/stdc++.h" using namespace std; typedef long long ll; #define _USE_MATH_DEFINES #include <math.h> #define rep(i, n) for (int i = 0; i < n; i++) #define NIL = -1; #define all(x) x.begin(), x.end() const ll INF = 1LL << 60; const ll mod = 1e9 + 7; int digit(ll x) { if (x / 10 == 0) return 1; return...
#include "bits/stdc++.h" using namespace std; typedef long long ll; #define _USE_MATH_DEFINES #include <math.h> #define rep(i, n) for (int i = 0; i < n; i++) #define NIL = -1; #define all(x) x.begin(), x.end() const ll INF = 1LL << 60; const ll mod = 1e9 + 7; int digit(ll x) { if (x / 10 == 0) return 1; return...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 132], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22]]
1
634
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; const ll mm = 1e9 + 7; ll kai(ll a, ll b) { ll ans = 1; while (a > b) { ans = (ans * a) % mm; a--; } return ans; } ll joyou(ll a, ll b) { ll ans = 1; while (b) { ans *= a; ans %= mm; b--; } ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; const ll mm = 1e9 + 7; ll kai(ll a, ll b) { ll ans = 1; while (a > b) { ans = (ans * a) % mm; a--; } return ans; } ll joyou(ll a, ll b) { ll ans = 1; while (b) { ans *= a; ans %= mm; b--; } ...
[["+", 49, 50, 51, 16, 31, 16, 31, 23, 0, 24], ["+", 49, 50, 51, 16, 31, 16, 31, 23, 0, 25], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 109], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 12, 22]]
1
174
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. ******************************************...
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. ******************************************...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
142
#include <bits/stdc++.h> using namespace std; const long long INF = 1LL << 60; const long long MOD = 1000000007; int main() { int n; cin >> n; if (n == 1) { cout << 0 << endl; return 0; } unsigned long long ans = 1; for (int i = 0; i < n; i++) { ans *= 10; ans %= MOD; } unsigned long lo...
#include <bits/stdc++.h> using namespace std; const long long INF = 1LL << 60; const long long MOD = 1000000007; int main() { int n; cin >> n; if (n == 1) { cout << 0 << endl; return 0; } unsigned long long ans = 1; for (int i = 0; i < n; i++) { ans *= 10; ans %= MOD; } unsigned long lo...
[["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25]]
1
172
/* ꧁༒☬महाकाल☬༒꧂ ꧁༒ঔमहाकालঔ༒꧂ ঔৣ۝महाकालᴳᵒᵈ۝ঔৣ */ #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC optimization("unroll-loops" #include <bits/stdc++.h> using namespace std; //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> // using namesp...
/* ꧁༒☬महाकाल☬༒꧂ ꧁༒ঔमहाकालঔ༒꧂ ঔৣ۝महाकालᴳᵒᵈ۝ঔৣ */ #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC optimization("unroll-loops" #include <bits/stdc++.h> using namespace std; //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> // using namesp...
[["+", 0, 16, 31, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 16, 31, 16, 31, 16, 12, 16, 12, 22], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 72], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 22]]
1
285
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()
[["-", 75, 665, 64, 196, 0, 1, 0, 662, 12, 612], ["+", 75, 665, 64, 196, 0, 1, 0, 662, 12, 612]]
5
85
#include <bits/stdc++.h> using namespace std; #define set_precision(ans, l) cout << fixed << setprecision(l) << ans; #define rep(i, a, b) for (int i = a; i < b; i++) #define repb(i, a, b) for (int i = a; i >= b; i--) #define vi vector<int> #define vl vector<long long int> #define Vi vector<vector<int>> #define vpi vec...
#include <bits/stdc++.h> using namespace std; #define set_precision(ans, l) cout << fixed << setprecision(l) << ans; #define rep(i, a, b) for (int i = a; i < b; i++) #define repb(i, a, b) for (int i = a; i >= b; i--) #define vi vector<int> #define vl vector<long long int> #define Vi vector<vector<int>> #define vpi vec...
[["+", 31, 23, 0, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 25], ["+", 0, 16, 12, 16, 31, 23, 0, 16, 17, 109], ["+", 0, 16, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 22]]
1
441
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using vll = vector<ll>; #define all(v) v.begin(), v.end() const ll mod = 1e9 + 7; ll modpow(ll a, ll b) { ll ans = 1 % mod; while (b) { if (b & 1) ans = (ans * a) % mod; a = (a * a...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using vll = vector<ll>; #define all(v) v.begin(), v.end() const ll mod = 1e9 + 7; ll modpow(ll a, ll b) { ll ans = 1 % mod; while (b) { if (b & 1) ans = (ans * a) % mod; a = (a * a...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 132], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22]]
1
155
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using vll = vector<ll>; #define all(v) v.begin(), v.end() const ll mod = 1e9 + 7; ll modpow(ll a, ll b) { ll ans = 1 % mod; while (b) { if (b & 1) ans = (ans * a) % mod; a = (a * a...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using vll = vector<ll>; #define all(v) v.begin(), v.end() const ll mod = 1e9 + 7; ll modpow(ll a, ll b) { ll ans = 1 % mod; while (b) { if (b & 1) ans = (ans * a) % mod; a = (a * a...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13]]
1
155
def resolve(): 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) if __name__ == "__main__": resolve()
def resolve(): 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) if __name__ == "__main__": resolve()
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
74
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)
[["-", 0, 1, 0, 662, 12, 657, 31, 657, 17, 33], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 17, 72]]
5
38
import sys input=sys.stdin.buffer.readline #sys.setrecursionlimit(10**9) #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())) de...
import sys input=sys.stdin.buffer.readline #sys.setrecursionlimit(10**9) #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())) de...
[["+", 0, 652, 3, 4, 0, 657, 12, 23, 0, 24], ["+", 0, 652, 3, 4, 0, 657, 12, 23, 0, 25]]
5
218
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; const int INF = 1001001001; const int mod = 1000000007; struct mint { // 自動的にmodを取ってくれるクラスです。 ll x; mint(ll x = 0) : x(x % mod) {} mint &operator+=(const mint a) { if ((x += a.x) >= mod) ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; const int INF = 1001001001; const int mod = 1000000007; struct mint { // 自動的にmodを取ってくれるクラスです。 ll x; mint(ll x = 0) : x(x % mod) {} mint &operator+=(const mint a) { if ((x += a.x) >= mod) ...
[["-", 15, 339, 51, 16, 31, 23, 0, 42, 0, 110], ["+", 15, 339, 51, 16, 31, 23, 0, 42, 0, 107], ["+", 15, 339, 51, 16, 31, 23, 0, 16, 31, 22], ["+", 15, 339, 51, 16, 31, 23, 0, 16, 17, 33]]
1
416
n = int(input()) MOD = 1000000007 a,b,c,d=pow(9,n,MOD),pow(9,n,MOD),pow(8,n,MOD),pow(10,n,MOD) print(d-a-b+c)
n = int(input()) MOD = 1000000007 a,b,c,d=pow(9,n,MOD),pow(9,n,MOD),pow(8,n,MOD),pow(10,n,MOD) print((d-a-b+c+MOD)%MOD)
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 17, 72], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 12, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 25], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
64
#define _USE_MATH_DEFIMES #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <climits> #include <clocale> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <ioman...
#define _USE_MATH_DEFIMES #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cctype> #include <climits> #include <clocale> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <ioman...
[["-", 49, 50, 51, 4, 0, 16, 12, 91, 17, 33]]
1
814
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; const long long INF = 1LL << 60; const int MOD = 1000000007; int main() { ll N; cin >> N; ll total = 1; for (int i = 1; i <= N; ++i) { total = total * 10 % MOD; } ll seki = 1; for (int i = 1; i <= N; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; const long long INF = 1LL << 60; const int MOD = 1000000007; int main() { ll N; cin >> N; ll total = 1; for (int i = 1; i <= N; ++i) { total = total * 10 % MOD; } ll seki = 1; for (int i = 1; i <= N; ...
[["+", 31, 16, 31, 16, 31, 16, 31, 16, 31, 13], ["+", 31, 16, 31, 16, 31, 16, 31, 16, 17, 48], ["+", 31, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 17, 72]]
1
167
N = int(input()) mod = 10**9+7 print(pow(10, N, mod) - ((pow(9, N, mod) * 2 % mod) - pow(8, N, mod)))
N = int(input()) mod = 10**9+7 print((pow(10, N, mod) - ((pow(9, N, mod) * 2 % mod) - pow(8, N, mod))) % mod)
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 12, 23, 0, 657, 12, 652, 3, 4, 0, 25], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
52
// g++ -std=c++17 -Wshadow -Wall -fsanitize=address -fsanitize=undefined // -D_GLIBCXX_DEBUG -g PROGRAM -o OUTPUT -DLOCAL -lasan -lubsan #include <bits/stdc++.h> #define ll unsigned long long #define ull unsigned long long #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define eps 1e-6...
// g++ -std=c++17 -Wshadow -Wall -fsanitize=address -fsanitize=undefined // -D_GLIBCXX_DEBUG -g PROGRAM -o OUTPUT -DLOCAL -lasan -lubsan #include <bits/stdc++.h> #define ll unsigned long long #define ull unsigned long long #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define eps 1e-6...
[["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 72], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 22]]
1
472
#include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <utility> #include <vector> using namespace std; typedef long long ll; ll mod = 1e9 + 7; // ll mod = 998244353; #define rep(i, n) for (int i = 0; i < (n)...
#include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <utility> #include <vector> using namespace std; typedef long long ll; ll mod = 1e9 + 7; // ll mod = 998244353; #define rep(i, n) for (int i = 0; i < (n)...
[["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 31, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 31, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25]]
1
157
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <utility> #include <vector> #define rep(i, n) for (int i = ...
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <utility> #include <vector> #define rep(i, n) for (int i = ...
[["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 107]]
1
935
n = input() mod = 10**9 + 7 ans = (pow(10, n, mod) - ((2 * pow(9, n, mod)) % mod - pow(8, n, mod) + mod) % mod + mod) % mod print(ans)
n = int(input()) mod = 10**9 + 7 ans = (pow(10, n, mod) - ((2 * pow(9, n, mod)) % mod - pow(8, n, mod) + mod) % mod + mod) % mod print(ans)
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
62
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define MOD 1000000007LL #define rep(i, n) for (ll(i) = 0LL; (i) < (ll)(n); (i)++) #define rep2(i, s, e) for (ll(i) = (ll)(s); (i) < (ll)(e); (i)++) #define repi(i, n) for (ll(i) = 0LL; (i) <= ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define MOD 1000000007LL #define rep(i, n) for (ll(i) = 0LL; (i) < (ll)(n); (i)++) #define rep2(i, s, e) for (ll(i) = (ll)(s); (i) < (ll)(e); (i)++) #define repi(i, n) for (ll(i) = 0LL; (i) <= ...
[["-", 8, 9, 0, 57, 64, 1, 0, 11, 17, 132], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 107]]
1
503
n = int(input()) if n ==1: print(0) exit() mod = 10*9+7 print((10**n+8**n-9**n-9**n)%mod)
n = int(input()) if n ==1: print(0) exit() mod = 10**9+7 print((10**n+8**n-9**n-9**n)%mod)
[["-", 0, 1, 0, 662, 12, 657, 31, 657, 17, 48], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 17, 578]]
5
49
#include <algorithm> #include <cstring> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define all(v) (v).begin(), (v).end() #define pb push_back #define ll long long #define pii pair<int, int> #define pll pair<l...
#include <algorithm> #include <cstring> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define all(v) (v).begin(), (v).end() #define pb push_back #define ll long long #define pii pair<int, int> #define pll pair<l...
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 13], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 48]]
1
150
#include <cstdint> #include <iostream> #include <vector> using namespace std; constexpr int64_t kMod = 1e9 + 7; int main() { int64_t N; cin >> N; int64_t full = 1; int64_t non = 1; int64_t both = 1; for (int64_t n = 0; n < N; ++n) { full *= 10; full %= kMod; non *= 9; non %= kMod; bo...
#include <cstdint> #include <iostream> #include <vector> using namespace std; constexpr int64_t kMod = 1e9 + 7; int main() { int64_t N; cin >> N; int64_t full = 1; int64_t non = 1; int64_t both = 1; for (int64_t n = 0; n < N; ++n) { full *= 10; full %= kMod; non *= 9; non %= kMod; bo...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 132], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22]]
1
114
#include <bits/stdc++.h> using namespace std; // typedef using ll = long long; using str = string; using PL = pair<ll, ll>; using P = pair<int, int>; using VL = vector<ll>; using VI = vector<int>; using VS = vector<str>; using VP = vector<P>; using VPL = vector<PL>; using VVL = vector<VL>; using VVI = vector<VI>; // c...
#include <bits/stdc++.h> using namespace std; // typedef using ll = long long; using str = string; using PL = pair<ll, ll>; using P = pair<int, int>; using VL = vector<ll>; using VI = vector<int>; using VS = vector<str>; using VP = vector<P>; using VPL = vector<PL>; using VVL = vector<VL>; using VVI = vector<VI>; // c...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
282
// Problem : C - Ubiquity // Contest : AtCoder - AtCoder Beginner Contest 178 // URL : https://atcoder.jp/contests/abc178/tasks/abc178_c // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> using namespace std; #define endl "\n" #de...
// Problem : C - Ubiquity // Contest : AtCoder - AtCoder Beginner Contest 178 // URL : https://atcoder.jp/contests/abc178/tasks/abc178_c // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> using namespace std; #define endl "\n" #de...
[["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 12, 22]]
1
214
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (n); ++i) #define FOR(i, m, n) for (ll i = m; i < (n); i++) #define all(x) (x).begin(), (x).end() using namespace std; typedef long long ll; using vi = vector<int>; using vii = vector<vi>; using pii = pair<int, int>; using vl = vector<...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < (n); ++i) #define FOR(i, m, n) for (ll i = m; i < (n); i++) #define all(x) (x).begin(), (x).end() using namespace std; typedef long long ll; using vi = vector<int>; using vii = vector<vi>; using pii = pair<int, int>; using vl = vector<...
[["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 33], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 22], ["-", 0, 11, 12, 16, 31, 23, 0, 16, 17, 33], ["-", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22]]
1
186
import java.util.*; public class Main { static long mod = 1_000_000_007; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long all = modPow(10L, n); long eight = modPow(8L, n); long nine = modPow(9L, n); long ans = (all - nine - nine + eig...
import java.util.*; public class Main { static long mod = 1_000_000_007L; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long all = modPow(10L, n); long eight = modPow(8L, n); long nine = modPow(9L, n); long ans = (all - nine - nine + ei...
[["-", 0, 235, 8, 498, 0, 124, 49, 200, 51, 499], ["+", 0, 235, 8, 498, 0, 124, 49, 200, 51, 499], ["+", 51, 16, 31, 23, 0, 16, 31, 16, 17, 72], ["+", 51, 16, 31, 23, 0, 16, 31, 16, 12, 22], ["-", 0, 195, 8, 196, 0, 503, 49, 200, 51, 499], ["+", 0, 195, 8, 196, 0, 503, 49, 200, 51, 499]]
3
173
// list index out of rangeエラー表示用 #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, s, n) for (int i = (s); i < (int)(n); i++) int main() { long long waru = powl(10, 9) + 7; long long n; cin >> n; if (n == 1) cout << 0; else { long long ans = 1; long long b = 1; ...
// list index out of rangeエラー表示用 #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, s, n) for (int i = (s); i < (int)(n); i++) int main() { long long waru = powl(10, 9) + 7; long long n; cin >> n; if (n == 1) cout << 0; else { long long ans = 1; long long b = 1; ...
[["+", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 17, 132], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35]]
1
164
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update /* * coder :: ATUL_PANDEY_2608 * >>> INDIA <<< */ using namespace std; using namespace __gn...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update /* * coder :: ATUL_PANDEY_2608 * >>> INDIA <<< */ using namespace std; using namespace __gn...
[["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 132], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 52, 8, 9, 0, 1, 0, 35]]
1
309
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define mod 1000000007 int main() { long N; long long sum = 0, all = 1, tmp1 = 1, tmp2 = 1; cin >> N; rep(i, N) { all = all * 10; all = all % mod; tmp1 = tmp1 * 9; tmp1 = tmp1 % mod; tmp2 =...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define mod 1000000007 int main() { long N; long long sum = 0, all = 1, tmp1 = 1, tmp2 = 1; cin >> N; rep(i, N) { all = all * 10; all = all % mod; tmp1 = tmp1 * 9; tmp1 = tmp1 % mod; tmp2 =...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
121
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=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)
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 31, 23, 0, 657, 12, 652, 3, 4, 0, 25], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
83
n = int(input()) mod = 10**9+7 x = 10**n%mod y = 2*9**n%mod - 8**n%mod print(x-y)
n = int(input()) mod = 10**9+7 x = 10**n%mod y = 2*9**n%mod - 8**n%mod print((x-y)%mod)
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 25], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
43
def mypow(x,k,p): out = 1 while(k > 0): if(k%2 == 1): out = out * x % p k = k // 2 x *= x return out p = 10 ** 9 + 7 n = int(input()) res = mypow(10,n,p) - mypow(9,n,p)*2 + mypow(8,n,p) print(res)
def mypow(x,k,p): out = 1 while(k > 0): if(k%2 == 1): out = out * x % p k = k // 2 x *= x return out p = 10 ** 9 + 7 n = int(input()) res = (mypow(10,n,p) - mypow(9,n,p)*2 + mypow(8,n,p)) % p print(res)
[["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 31, 23, 0, 657, 12, 652, 3, 4, 0, 25], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 109], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]]
5
95
""" int(input()) map(int, input().split()) list(map(int, input().split())) input() input().split() """ n = int(input()) mod = 1000000007 tmp = (10**n)%mod diff = 2*(9**n)%mod eight = (8**n)%mod ans = tmp - diff + eight print(ans)
""" int(input()) map(int, input().split()) list(map(int, input().split())) input() input().split() """ n = int(input()) mod = 1000000007 tmp = (10**n)%mod diff = 2*(9**n)%mod eight = (8**n)%mod ans = tmp - diff + eight ans%=mod print(ans)
[["+", 36, 36, 0, 656, 0, 1, 0, 677, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 677, 17, 132], ["+", 36, 36, 0, 656, 0, 1, 0, 677, 12, 22]]
5
54
""" int(input()) map(int, input().split()) list(map(int, input().split())) input() input().split() """ n = int(input()) mod = 1000000007 tmp = 1 diff = 1 eight = 1 for i in range(n): tmp *= 10 tmp %= mod diff *= 9 diff %= mod eight *= 8 eight %= mod ans = tmp - 2*diff + eight print(ans) # ...
""" int(input()) map(int, input().split()) list(map(int, input().split())) input() input().split() """ n = int(input()) mod = 1000000007 tmp = 1 diff = 1 eight = 1 for i in range(n): tmp *= 10 tmp %= mod diff *= 9 diff %= mod eight *= 8 eight %= mod ans = tmp - 2*diff + eight ans %= mod pri...
[["+", 36, 36, 0, 656, 0, 1, 0, 677, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 677, 17, 132], ["+", 36, 36, 0, 656, 0, 1, 0, 677, 12, 22]]
5
67
def pow_k(x, n,mod = 10**9+7): x %= mod if n == 0: return 1 K = 1 while n > 1: if n % 2 != 0: K *= x K %= mod x *= x x %= mod n //= 2 return K * x % mod def solve(n,mod = 10**9+7): total = pow_k(10,n) not_include_0 = pow_k(9,n...
def pow_k(x, n,mod = 10**9+7): x %= mod if n == 0: return 1 K = 1 while n > 1: if n % 2 != 0: K *= x K %= mod x *= x x %= mod n //= 2 return K * x % mod def solve(n,mod = 10**9+7): total = pow_k(10,n) not_include_0 = pow_k(9,...
[["+", 8, 196, 0, 37, 0, 657, 31, 23, 0, 24], ["+", 0, 657, 31, 23, 0, 657, 31, 657, 17, 109], ["+", 0, 657, 31, 23, 0, 657, 31, 657, 12, 22], ["+", 31, 23, 0, 657, 12, 657, 31, 23, 0, 25], ["+", 0, 657, 31, 23, 0, 657, 12, 657, 17, 109], ["+", 0, 657, 31, 23, 0, 657, 12, 657, 12, 22]]
5
145
#include <bits/stdc++.h> using namespace std; #define FASTIO1 ios_base::sync_with_stdio(false) #define FASTIO2 cin.tie(NULL), cout.tie(NULL) #define count_1(p) __builtin_popcountll(p) #define count_0(p) __builtin_ctzll(p) #define all(x) (x).begin(), (x).end() #define ll long long #define pb push_back #define mp make_p...
#include <bits/stdc++.h> using namespace std; #define FASTIO1 ios_base::sync_with_stdio(false) #define FASTIO2 cin.tie(NULL), cout.tie(NULL) #define count_1(p) __builtin_popcountll(p) #define count_0(p) __builtin_ctzll(p) #define all(x) (x).begin(), (x).end() #define ll long long #define pb push_back #define mp make_p...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13]]
1
283
import sys def input(): return sys.stdin.readline().strip() def main(): def nCr(n,r): mod = 10 ** 9 + 7 a = b = 1 for i in range(r): a = (a * (n - i)) % mod b = (b * (r - i)) % mod return (a * pow(b,mod-2,mod))%mod N = int(input()) mod = 10 ** 9...
import sys def input(): return sys.stdin.readline().strip() def main(): def nCr(n,r): mod = 10 ** 9 + 7 a = b = 1 for i in range(r): a = (a * (n - i)) % mod b = (b * (r - i)) % mod return (a * pow(b,mod-2,mod))%mod N = int(input()) mod = 10 ** 9...
[["+", 0, 14, 8, 196, 0, 1, 0, 677, 31, 22], ["+", 0, 14, 8, 196, 0, 1, 0, 677, 17, 132], ["+", 0, 14, 8, 196, 0, 1, 0, 677, 12, 22]]
5
161
n = int(input()) j = q = h = 1 rem = 10**9+7 for i in range(n): j *= 10 j %= rem q *= 9 q %= rem h *= 8 h %= rem print(j-q*2+h)
n = int(input()) j = q = h = 1 rem = 10**9+7 for i in range(n): j *= 10 j %= rem q *= 9 q %= rem h *= 8 h %= rem print((j-q*2+h)%rem)
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 25], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
58
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using pii = pair<int, int>; const int mod = 1e9 + 7; ll powmod(ll a, ll b) { ll ret = 1; rep(i, b) { ret = (ret * a) % mod; } return ret; } int main() { ll n; cin >> n; ll ans = powmod(10, ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using pii = pair<int, int>; const int mod = 1e9 + 7; ll powmod(ll a, ll b) { ll ret = 1; rep(i, b) { ret = (ret * a) % mod; } return ret; } int main() { ll n; cin >> n; ll ans = powmod(10, ...
[["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
132
n = int(input()) mod = 10**9 + 7 max = (10**n)%mod a = 8**n%mod b = 9**n%mod no09 = a nine_in = (b - a)%mod zero_in = (b - a)%mod ans = abs(max - no09 - nine_in - zero_in) print(ans)
n = int(input()) mod = 10**9 + 7 max = (10**n)%mod a = 8**n%mod b = 9**n%mod no09 = a nine_in = (b - a)%mod zero_in = (b - a)%mod ans = abs((max - no09 - nine_in - zero_in)%mod) print(ans)
[["+", 12, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 12, 652, 3, 4, 0, 657, 31, 23, 0, 25], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 22]]
5
75
#create date: 2020-09-13 21:03 import sys stdin = sys.stdin def ns(): return stdin.readline().rstrip() def ni(): return int(ns()) def na(): return list(map(int, stdin.readline().split())) def pow(a, n, p): bi = str(format(n, "b")) res = 1 for i in range(len(bi)): res = (res * res) % p if ...
#create date: 2020-09-13 21:03 import sys stdin = sys.stdin def ns(): return stdin.readline().rstrip() def ni(): return int(ns()) def na(): return list(map(int, stdin.readline().split())) def pow(a, n, p): bi = str(format(n, "b")) res = 1 for i in range(len(bi)): res = (res * res) % p if ...
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 31, 23, 0, 657, 12, 652, 3, 4, 0, 25], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
184
#ifdef DBG_MACRO_NO_WARNING #include <dbg.h> #endif #include <bits/stdc++.h> #define all(c) c.begin(), c.end() #define isz(c) (int)c.size() using namespace std; using ll = long long; using ii = pair<int, int>; using vi = vector<int>; ll const MOD = 1e9 + 7; ll binpow(ll a, ll b) { a %= MOD; ll ans = 1; while (...
#ifdef DBG_MACRO_NO_WARNING #include <dbg.h> #endif #include <bits/stdc++.h> #define all(c) c.begin(), c.end() #define isz(c) (int)c.size() using namespace std; using ll = long long; using ii = pair<int, int>; using vi = vector<int>; ll const MOD = 1e9 + 7; ll binpow(ll a, ll b) { a %= MOD; ll ans = 1; while (...
[["+", 0, 37, 0, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 37, 0, 16, 31, 23, 0, 16, 12, 22]]
1
259
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); final long MOD = 1_000_000_007; long x10 = 1; long x9 = 1; long x8 = 1; for (int i = 0; i < N; i++) { x10 *= 10; x9 *= 9...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); final long MOD = 1_000_000_007; long x10 = 1; long x9 = 1; long x8 = 1; for (int i = 0; i < N; i++) { x10 *= 10; x9 *= 9...
[["+", 0, 195, 8, 196, 0, 1, 0, 11, 31, 22], ["+", 0, 195, 8, 196, 0, 1, 0, 11, 17, 132], ["+", 0, 195, 8, 196, 0, 1, 0, 11, 12, 22], ["+", 8, 498, 0, 195, 8, 196, 0, 1, 0, 35]]
3
138
#include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map> #incl...
#include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map> #incl...
[["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 24], ["-", 0, 43, 49, 50, 51, 16, 12, 16, 17, 109], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 21], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 25]]
1
274
#include <bits/stdc++.h> #define int long long using namespace std; const int N = 2e5 + 5; const int mod = 1e9 + 7; int n, dp[N][2][2]; void add(int &x, int y) { x += y; if (x >= mod) x -= mod; } signed main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n; dp[0][0][0] = 1; f...
#include <bits/stdc++.h> #define int long long using namespace std; const int N = 1e6 + 5; const int mod = 1e9 + 7; int n, dp[N][2][2]; void add(int &x, int y) { x += y; if (x >= mod) x -= mod; } signed main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n; dp[0][0][0] = 1; f...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13]]
1
243
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; long long A = 1, B = 1, C = 1; for (int i = 0; i < N; i++) { A *= 10; B *= 8; C *= 9; A = A % (1000000000 + 7); B = B % (1000000000 + 7); C = C % (1000000000 + 7); } // printf("A=%llu B=%llu C=%llu\n",A,B,C);...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; long long A = 1, B = 1, C = 1; for (int i = 0; i < N; i++) { A *= 10; B *= 8; C *= 9; A = A % (1000000000 + 7); B = B % (1000000000 + 7); C = C % (1000000000 + 7); } // printf("A=%llu B=%llu C=%llu\n",A,B,C);...
[["+", 0, 43, 49, 50, 51, 16, 12, 16, 31, 13], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 17, 48]]
1
129
#include <iostream> using namespace std; int main(void) { int n; cin >> n; int tmp = 1000000007; long mod8, mod9, mod10; mod8 = 1; mod9 = 1; mod10 = 1; for (int i = 0; i < n; i++) { mod8 = (mod8 * 8) % tmp; mod9 = (mod9 * 9) % tmp; mod10 = (mod10 * 10) % tmp; } int res = mod10 - 2 * mod9...
#include <iostream> using namespace std; int main(void) { int n; cin >> n; long tmp = 1000000007; long mod8, mod9, mod10; mod8 = 1; mod9 = 1; mod10 = 1; for (int i = 0; i < n; i++) { mod8 = (mod8 * 8) % tmp; mod9 = (mod9 * 9) % tmp; mod10 = (mod10 * 10) % tmp; } long res = (mod10 - 2 * m...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 25], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 109], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]]
1
119
inf = pow(10,9)+ 7 n=int(input()) if n==1: print(0) elif n==2: print(1) else: f=pow(10,n,inf) - 2*pow(9,n,inf) + pow(8,n,inf) print(f%inf)
inf = pow(10,9)+ 7 n=int(input()) if n==1: print(0) elif n==2: print(2) else: f=pow(10,n,inf) - 2*pow(9,n,inf) + pow(8,n,inf) print(f%inf)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
74
N=int(input()) P=10**9+7 s_10=1 for i in range(N): s_10=(s_10*10)%P s_9=1 for i in range(N): s_9=(s_9*9)%P s_9=(s_9*2)%P s_8=1 for i in range(N): s_8=(s_8*8)%P print (s_10-s_9+s_8)
N=int(input()) P=10**9+7 s_10=1 for i in range(N): s_10=(s_10*10)%P s_9=1 for i in range(N): s_9=(s_9*9)%P s_9=(s_9*2)%P s_8=1 for i in range(N): s_8=(s_8*8)%P print ((s_10-s_9+s_8)%P)
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 25], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
92
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long long ans = 1, ex = 1, ex2 = 1, mod = 1000000007; for (int i = 0; i < n; i++) { ans = (ans * 10) % mod; ex = (ex * 9) % mod; ex2 = (ex2 * 8) % mod; } cout << (ans - 2 * ex + ex2) % mod; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long long ans = 1, ex = 1, ex2 = 1, mod = 1000000007; for (int i = 0; i < n; i++) { ans = (ans * 10) % mod; ex = (ex * 9) % mod; ex2 = (ex2 * 8) % mod; } cout << (ans - 2 * ex + ex2 + mod * 3) % mod; }
[["+", 0, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 22], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13]]
1
97
n = int(input()) def power_func(a,n,p): bi = str(format(n,"b"))#2進表現に res = 1 for i in range(len(bi)): res = (res*res) %p if bi[i] == "1": res = (res*a) %p return res if n == 1: print(0) else: mod = 10**9+7 print(power_func(10, n, mod)-(power_func(9, n, mod)*2-pow...
n = int(input()) def power_func(a,n,p): bi = str(format(n,"b"))#2進表現に res = 1 for i in range(len(bi)): res = (res*res) %p if bi[i] == "1": res = (res*a) %p return res if n == 1: print(0) else: mod = 10**9+7 print((power_func(10, n, mod)-(power_func(9, n, mod)*2-po...
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 12, 23, 0, 657, 12, 652, 3, 4, 0, 25], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
127
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #define ll long long using namespace std; const int INF = 0x3f3f3f3f; const double pi = acos(-1.0), eps = 1e-8; const ll mod = 1e9 + 7; const i...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #define ll long long using namespace std; const int INF = 0x3f3f3f3f; const double pi = acos(-1.0), eps = 1e-8; const ll mod = 1e9 + 7; const i...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13]]
1
455
#!/usr/bin/env python3 from collections import defaultdict,deque from heapq import heappush, heappop from bisect import bisect_left, bisect_right import sys, random, itertools, math sys.setrecursionlimit(10**5) input = sys.stdin.readline sqrt = math.sqrt def LI(): return list(map(int, input().split())) def LF(): return...
#!/usr/bin/env python3 from collections import defaultdict,deque from heapq import heappush, heappop from bisect import bisect_left, bisect_right import sys, random, itertools, math sys.setrecursionlimit(10**5) input = sys.stdin.readline sqrt = math.sqrt def LI(): return list(map(int, input().split())) def LF(): return...
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 31, 23, 0, 657, 12, 652, 3, 4, 0, 25], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
366
#include <bits/stdc++.h> using namespace std; typedef long long LL; const LL mod = 1000000007; int main() { // ifstream cin("input.txt"); LL n; cin >> n; if (n == 1) { cout << 0; return 0; } LL p1 = 1, p2 = 1, p3 = 1; for (int i = 0; i < n; ++i) p1 = (p1 * 10) % mod, p2 = (p2 * 9) % mod,...
#include <bits/stdc++.h> using namespace std; typedef long long LL; const LL mod = 1000000007; int main() { // ifstream cin("input.txt"); LL n; cin >> n; if (n == 1) { cout << 0; return 0; } LL p1 = 1, p2 = 1, p3 = 1; for (int i = 0; i < n; ++i) p1 = (p1 * 10) % mod, p2 = (p2 * 9) % mod,...
[["+", 31, 23, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 51, 16, 31, 23, 0, 16, 31, 16, 17, 72], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 31, 13], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 17, 48]]
1
146
#include <iostream> using namespace std; #define ull unsigned long long #define u unsigned #define mod (u)(1e9 + 7) int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); ull a10 = 1, a9 = 1, a8 = 1; u n; cin >> n; while (n--) { a10 = (a10 * (10)) % mod; a9 = (a9 * 9) % mod; a8 = (a8 *...
#include <iostream> using namespace std; #define ull unsigned long long #define u unsigned #define mod (u)(1e9 + 7) int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); ull a10 = 1, a9 = 1, a8 = 1; u n; cin >> n; while (n--) { a10 = (a10 * (10)) % mod; a9 = (a9 * 9) % mod; a8 = (a8 *...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
117
#include <bits/stdc++.h> #define ll long long #define pi 3.14159265358979 #define mod 1000000007 #define rep(i, n) for (ll i = 0; i < n; i++) using namespace std; const int INF = 1000100100; long long int mod_pow(long long int x, long long int n, long long int m) { long long int res = 1; while (n > 0) { if (n ...
#include <bits/stdc++.h> #define ll long long #define pi 3.14159265358979 #define mod 1000000007 #define rep(i, n) for (ll i = 0; i < n; i++) using namespace std; const int INF = 1000100100; long long int mod_pow(long long int x, long long int n, long long int m) { long long int res = 1; while (n > 0) { if (n ...
[["+", 12, 16, 31, 16, 31, 16, 31, 16, 31, 13], ["+", 12, 16, 31, 16, 31, 16, 31, 16, 17, 48], ["+", 12, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 11, 12, 16, 31, 16, 31, 16, 17, 72]]
1
151
n = int(input()) mod = 10**9+7 a = pow(10,n,mod) b = pow(8,n,mod) c = pow(9,n,mod) ans = a-2*c+b if ans < 0: print(ans+mod) else: print(ans)
n = int(input()) mod = 10**9+7 a = pow(10,n,mod) b = pow(8,n,mod) c = pow(9,n,mod) ans = a-2*c+b ans = ans%mod if ans < 0: print(ans+mod) else: print(ans)
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 109], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]]
5
71
N = int(input()) mod = 1000000007 print((10**N)%mod - (2*(9**N))%mod + (8**N)%mod)
N = int(input()) mod = 1000000007 print(((10**N)%mod - (2*(9**N))%mod + (8**N)%mod)%mod)
[["+", 0, 657, 31, 657, 31, 657, 31, 23, 0, 24], ["+", 31, 23, 0, 657, 12, 657, 31, 23, 0, 25], ["+", 0, 657, 31, 23, 0, 657, 12, 657, 17, 109], ["+", 0, 657, 31, 23, 0, 657, 12, 657, 12, 22]]
5
41
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep2(i, x, n) for (int i = x; i < (n); i++) #define all(x) x.begin(), x.end() typedef long long ll; ll mod = 1000000007; ll inf = 1e18; int main() { ll n; cin >> n; ll ans = 1, ans2 = 1, ans3 = 1; rep(i, n) ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep2(i, x, n) for (int i = x; i < (n); i++) #define all(x) x.begin(), x.end() typedef long long ll; ll mod = 1000000007; ll inf = 1e18; int main() { ll n; cin >> n; ll ans = 1, ans2 = 1, ans3 = 1; rep(i, n) ...
[["+", 31, 23, 0, 16, 31, 16, 12, 16, 31, 13], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 17, 48]]
1
138
#include <algorithm> #include <iostream> #include <vector> using namespace std; using LL = long long; LL mod = 1e9 + 7; LL pow_L(LL x, LL n) { LL x_n = x, res = 1; while (n > 0) { if ((n & 1) == 1) { res = (res * x_n) % mod; } n = n >> 1; x_n = x_n * x_n % mod; } return res; } int main(...
#include <algorithm> #include <iostream> #include <vector> using namespace std; using LL = long long; LL mod = 1e9 + 7; LL pow_L(LL x, LL n) { LL x_n = x, res = 1; while (n > 0) { if ((n & 1) == 1) { res = (res * x_n) % mod; } n = n >> 1; x_n = x_n * x_n % mod; } return res; } int main(...
[["-", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89]]
1
166
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; #define rep2(i, n) f...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; #define rep2(i, n) f...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
524
# coding: utf-8 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())))
# coding: utf-8 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())))
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 31, 23, 0, 657, 12, 652, 3, 4, 0, 25], ["+", 0, 37, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 37, 0, 652, 3, 4, 0, 657, 12, 22]]
5
88
n=int(input()) ans=0 mod=10**9+7 if n>=2: ans+=pow(10,n,mod) ans-=pow(9,n,mod) ans-=pow(9,n,mod) ans+=pow(8,n,mod) print(ans)
n=int(input()) ans=0 mod=10**9+7 if n>=2: ans+=pow(10,n,mod) ans-=pow(9,n,mod) ans-=pow(9,n,mod) ans+=pow(8,n,mod) print(ans%mod)
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
67
#include <algorithm> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) using namespace std; typedef long long ll; type...
#include <algorithm> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) using namespace std; typedef long long ll; type...
[["+", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 17, 132], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35]]
1
301
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define pi 3.141592653589 ll power(ll b, ll e, ll m) { if (e == 0) return 1; if (e & 1) return b * power(b * b % m, e / 2, m) % m; return power(b * b % m, e / 2, m); } ll power(ll b, ll e) { if (e == 0) retu...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define pi 3.141592653589 ll power(ll b, ll e, ll m) { if (e == 0) return 1; if (e & 1) return b * power(b * b % m, e / 2, m) % m; return power(b * b % m, e / 2, m); } ll power(ll b, ll e) { if (e == 0) retu...
[["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 22], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 25], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 72], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 109], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]]
1
215
n = int(input()) if n==1: print(1) elif n==2: print(2) else: print(((10**n-2*9**n+8**n))%(10**9+7))
n = int(input()) if n==1: print(0) elif n==2: print(2) else: print(((10**n-2*9**n+8**n))%(10**9+7))
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
56
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <vector> using namespace std; bool cmp(long long a, long long b) { return...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <vector> using namespace std; bool cmp(long long a, long long b) { return...
[["+", 64, 1, 0, 11, 12, 16, 12, 16, 31, 13], ["+", 64, 1, 0, 11, 12, 16, 12, 16, 17, 48], ["+", 0, 11, 12, 16, 12, 16, 12, 23, 0, 24], ["+", 0, 11, 12, 16, 12, 16, 12, 23, 0, 25]]
1
498
#include <stdio.h> int main() { const long long int mod = 7 + 1e9; int n; long long int ans = 0, n9 = 1, n8 = 1, n10 = 1; scanf("%d", &n); for (int i = 0; i < n; i++) { n9 *= 9; n9 = n9 % mod; n8 *= 8; n8 = n8 % mod; n10 *= 10; n10 = n10 % mod; } ans = n10 - 2 * n9 + n8; for (in...
#include <stdio.h> int main() { const long long int mod = 7 + 1e9; int n; long long int ans = 0, n9 = 1, n8 = 1, n10 = 1; scanf("%d", &n); for (int i = 0; i < n; i++) { n9 *= 9; n9 = n9 % mod; n8 *= 8; n8 = n8 % mod; n10 *= 10; n10 = n10 % mod; } ans = n10 - 2 * n9 + n8; for (in...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 98]]
0
163
import sys,queue,math,copy,itertools,bisect,collections,heapq def main(): sys.setrecursionlimit(10**7) INF = 10**18 MOD = 10**9 + 7 LI = lambda : [int(x) for x in sys.stdin.readline().split()] _LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()] NI = lambda : int(sys.stdin.readline()...
import sys,queue,math,copy,itertools,bisect,collections,heapq def main(): sys.setrecursionlimit(10**7) INF = 10**18 MOD = 10**9 + 7 LI = lambda : [int(x) for x in sys.stdin.readline().split()] _LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()] NI = lambda : int(sys.stdin.readline()...
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
200
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back const int mod = 1e9 + 7; ll binpow(ll a, ll b) { if (b < 0) return 0; ll ans = 1; while (b) { if (b % 2) ans = (ans * a) % mod; a = (a * a) % mod; b /= 2; } return ans; } int main() { ll n; cin >>...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back const int mod = 1e9 + 7; ll binpow(ll a, ll b) { if (b < 0) return 0; ll ans = 1; while (b) { if (b % 2) ans = (ans * a) % mod; a = (a * a) % mod; b /= 2; } return ans; } int main() { ll n; cin >>...
[["+", 31, 16, 12, 23, 0, 16, 31, 23, 0, 24], ["+", 31, 16, 12, 23, 0, 16, 31, 23, 0, 25], ["+", 31, 16, 31, 16, 12, 23, 0, 16, 17, 109], ["+", 31, 16, 31, 16, 12, 23, 0, 16, 12, 22]]
1
155
#!/usr/bin/env python3 import sys MOD = 1000000007 # type: int def solve(N: int): a = pow(10, N, MOD) b = pow(9, N, MOD) c = pow(8, N, MOD) return 2 * (a - b) - (a - c) # Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools def main(): def iterate_tokens(): for line in sys...
#!/usr/bin/env python3 import sys MOD = 1000000007 # type: int def solve(N: int): a = pow(10, N, MOD) b = pow(9, N, MOD) c = pow(8, N, MOD) return (2 * (a - b) - (a - c)) % MOD # Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools def main(): def iterate_tokens(): for lin...
[["+", 8, 196, 0, 37, 0, 657, 31, 23, 0, 24], ["+", 0, 657, 31, 23, 0, 657, 12, 23, 0, 25], ["+", 0, 14, 8, 196, 0, 37, 0, 657, 17, 109], ["+", 0, 14, 8, 196, 0, 37, 0, 657, 12, 22]]
5
133
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using ll = long long; #define rep(i, n) for (ll i = 0; i < (n); i++) using namespace std; const ll MOD = 1000000007; ll modPow(ll a, ll n) { if (n == 0) return 1; if (n == 1) return a % MOD; if (n % 2 == 1) ...
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using ll = long long; #define rep(i, n) for (ll i = 0; i < (n); i++) using namespace std; const ll MOD = 1000000007; ll modPow(ll a, ll n) { if (n == 0) return 1; if (n == 1) return a % MOD; if (n % 2 == 1) ...
[["+", 51, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 51, 16, 31, 23, 0, 16, 12, 16, 12, 13]]
1
164
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll N; cin >> N; ll Mod = 1000000007; ll a = 1, b = 1, c = 1; for (ll i = 0; i < N; i++) { a *= 10; a %= Mod; } for (ll j = 0; j < N; j++) { b *= 9; b %= Mod; } for (ll k = 0; k < N; k++) { c *= 8; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll N; cin >> N; ll Mod = 1000000007; ll a = 1, b = 1, c = 1; for (ll i = 0; i < N; i++) { a *= 10; a %= Mod; } for (ll j = 0; j < N; j++) { b *= 9; b %= Mod; } for (ll k = 0; k < N; k++) { c *= 8; ...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
132
n = gets.to_i if n <= 2 puts n * (n - 1) return end puts (9 ** n - (8 ** n * 2 - 7 ** n)) % (10 ** 9 + 7)
n = gets.to_i if n <= 2 puts n * (n - 1) return end puts (10 ** n - (9 ** n * 2 - 8 ** n)) % (10 ** 9 + 7)
[["-", 0, 738, 31, 739, 0, 738, 31, 738, 31, 612], ["+", 0, 738, 31, 739, 0, 738, 31, 738, 31, 612], ["-", 12, 739, 0, 738, 31, 738, 31, 738, 31, 612], ["+", 12, 739, 0, 738, 31, 738, 31, 738, 31, 612], ["-", 0, 738, 12, 739, 0, 738, 12, 738, 31, 612], ["+", 0, 738, 12, 739, 0, 738, 12, 738, 31, 612]]
4
45
def main(): mod = 10 ** 9 + 7 n = int(input()) ans = pow(10, n, mod) - 2 * pow(9, n, mod) + pow(8, n, mod) print(ans) if __name__ == '__main__': main()
def main(): mod = 10 ** 9 + 7 n = int(input()) ans = pow(10, n, mod) - 2 * pow(9, n, mod) + pow(8, n, mod) print(ans % mod) if __name__ == '__main__': main()
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
64
#include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; long long mod = pow(10, 9) + 7; long long ans = 1, full = 1, nine = 1; for (int i = 0; i < n; i++) { ans = ans * 10 % mod; full = full * 8 % mod; nine = nine * 9 % mod; } ans += mod; ans -= nine * 2 - full; ...
#include <bits/stdc++.h> using namespace std; int main() { long long n; cin >> n; long long mod = pow(10, 9) + 7; long long ans = 1, full = 1, nine = 1; for (int i = 0; i < n; i++) { ans = ans * 10 % mod; full = full * 8 % mod; nine = nine * 9 % mod; } ans += mod * 3; ans -= nine * 2 - fu...
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
107
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (i = 0; i < n; i++) // 2D::rep(i,j)rep(j,j)cin>>bin[i][j]; // vector<int> a(n) #define Graph vector<vector<int>> #define A1 cout << "No" << endl #define A2 cout << "Yes" << endl #define A3 cout << ans << #define AA(i) cout << i <<...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (i = 0; i < n; i++) // 2D::rep(i,j)rep(j,j)cin>>bin[i][j]; // vector<int> a(n) #define Graph vector<vector<int>> #define A1 cout << "No" << endl #define A2 cout << "Yes" << endl #define A3 cout << ans << #define AA(i) cout << i <<...
[["+", 0, 16, 31, 16, 31, 16, 12, 23, 0, 24], ["+", 31, 16, 31, 16, 12, 23, 0, 16, 17, 109], ["+", 31, 16, 31, 16, 12, 23, 0, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 12, 23, 0, 25]]
1
182
n = int(input()) mod = 10**9+7 a = 10**n % mod b = 9**n % mod c = 8**n % mod print(a-2*b+c)
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)
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 25], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
46
#include <bits/stdc++.h> using namespace std; int64_t MOD = 1000000007; double PI = 3.141592653589793; int64_t mypow(int64_t x, int64_t y) // x ^ y { if (y == 0) return 1; if (y == 1) return x; else if (y % 2 == 1) return mypow(x, y - 1) * x % MOD; else { int64_t tmp = mypow(x, y / 2); ret...
#include <bits/stdc++.h> using namespace std; int64_t MOD = 1000000007; double PI = 3.141592653589793; int64_t mypow(int64_t x, int64_t y) // x ^ y { if (y == 0) return 1; if (y == 1) return x; else if (y % 2 == 1) return mypow(x, y - 1) * x % MOD; else { int64_t tmp = mypow(x, y / 2); ret...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
135
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)
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)
[["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 31, 23, 0, 657, 12, 652, 3, 4, 0, 25], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 109], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]]
5
61
/* 在太阳西斜的这个世界里 置身天上之森。 等这场战争结束之后 不归之人与望眼欲穿的众人 人人本着正义之名 长存不灭的过去 逐渐消逝的未来 我回来了 纵使日薄西山 即便看不到未来 此时此刻的光辉 盼君勿忘 */ #include <algorithm> #include <cstdio> #include <iostream> using namespace std; typedef long long LL; const LL mod = 1000000007; LL power(LL a, LL b, LL p) { LL ans = 1; for (; b; b >>= 1) { if (b & 1) ...
/* 在太阳西斜的这个世界里 置身天上之森。 等这场战争结束之后 不归之人与望眼欲穿的众人 人人本着正义之名 长存不灭的过去 逐渐消逝的未来 我回来了 纵使日薄西山 即便看不到未来 此时此刻的光辉 盼君勿忘 */ #include <algorithm> #include <cstdio> #include <iostream> using namespace std; typedef long long LL; const LL mod = 1000000007; LL power(LL a, LL b, LL p) { LL ans = 1; for (; b; b >>= 1) { if (b & 1) ...
[["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22]]
1
147