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()) m=1000000007 print((pow(10,n,m)-2*pow(9,n,m)+pow(8,n,m)))
n=int(input()) m=1000000007 print(((pow(10,n,m)-2*pow(9,n,m)+pow(8,n,m))+m)%m)
[["+", 0, 657, 31, 23, 0, 657, 31, 23, 0, 24], ["+", 0, 657, 31, 23, 0, 657, 31, 23, 0, 25], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 17, 72], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 12, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
44
#include <bits/stdc++.h> #define ll long long const ll MOD = 1e9 + 7; using namespace std; ll powermod(ll n, ll x) { ll ret = 1; while (x) { if (x & 1) { (ret *= n) %= MOD; } x >>= 1; (n *= n) %= MOD; } return ret; } int main() { ll N; cin >> N; ll a = powermod(10, N); ll b = (2 * ...
#include <bits/stdc++.h> #define ll long long const ll MOD = 1e9 + 7; using namespace std; ll powermod(ll n, ll x) { ll ret = 1; while (x) { if (x & 1) { (ret *= n) %= MOD; } x >>= 1; (n *= n) %= MOD; } return ret; } int main() { ll N; cin >> N; ll a = powermod(10, N); ll b = (2 * ...
[["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 25], ["+", 51, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 51, 16, 31, 23, 0, 16, 31, 16, 12, 22], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 72], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 22]]
1
143
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define f first #define s second #define pb push_back #define all(c) (c).begin(), (c).end() #define sz(x) (int)(x).size() #define fastio \ ios_base::sync_with_stdio(0); ...
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define f first #define s second #define pb push_back #define all(c) (c).begin(), (c).end() #define sz(x) (int)(x).size() #define fastio \ ios_base::sync_with_stdio(0); ...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 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]]
1
238
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vector<int>> vvi; int main() { ll N; cin >> N; ll mod = 1e9 + 7; ll ans10 = 1; ll ans9 = 1; ll ans8 = 1; for (int i = 0; i < N; i++) { ans10 = (ans10 * 10) % mod; ans9 = (ans9 * 9) % mod; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vector<int>> vvi; int main() { ll N; cin >> N; ll mod = 1e9 + 7; ll ans10 = 1; ll ans9 = 1; ll ans8 = 1; for (int i = 0; i < N; i++) { ans10 = (ans10 * 10) % mod; ans9 = (ans9 * 9) % mod; ...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
125
#include <algorithm> #include <assert.h> #include <bitset> #include <deque> #include <functional> #include <iostream> #include <iterator> #include <limits> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include ...
#include <algorithm> #include <assert.h> #include <bitset> #include <deque> #include <functional> #include <iostream> #include <iterator> #include <limits> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include ...
[["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 72], ["+", 51, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 51, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 51, 16, 31, 23, 0, 16, 12, 16, 12, 22]]
1
237
#include <bits/stdc++.h> using namespace std; int main() { const long long MODULO = (1e9) + 7; int N; cin >> N; long long pow8 = 1; long long pow9 = 1; long long pow10 = 1; for (int i = 1; i <= N; ++i) { pow8 = (8 * pow8) % MODULO; pow9 = (9 * pow9) % MODULO; pow10 = (10 * pow10) % MODULO; ...
#include <bits/stdc++.h> using namespace std; int main() { const long long MODULO = (1e9) + 7; int N; cin >> N; long long pow8 = 1; long long pow9 = 1; long long pow10 = 1; for (int i = 1; i <= N; ++i) { pow8 = (8 * pow8) % MODULO; pow9 = (9 * pow9) % MODULO; pow10 = (10 * pow10) % MODULO; ...
[["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 25], ["+", 51, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 51, 16, 31, 23, 0, 16, 31, 16, 12, 22]]
1
119
#include <bits/stdc++.h> using namespace std; int main() { const long long MODULO = (1e9) + 7; int N; cin >> N; long long pow8 = 1; long long pow9 = 1; long long pow10 = 1; for (int i = 1; i <= N; ++i) { pow8 = (8 * pow8) % MODULO; pow9 = (9 * pow9) % MODULO; pow10 = (10 * pow10) % MODULO; ...
#include <bits/stdc++.h> using namespace std; int main() { const long long MODULO = (1e9) + 7; int N; cin >> N; long long pow8 = 1; long long pow9 = 1; long long pow10 = 1; for (int i = 1; i <= N; ++i) { pow8 = (8 * pow8) % MODULO; pow9 = (9 * pow9) % MODULO; pow10 = (10 * pow10) % MODULO; ...
[["+", 51, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 51, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
119
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; using ll = long long; using vl = vector<ll>; using vvl = vector<vector<ll>>; using vc = vector<char>; using vvc = vector<vector<char>>; using vi = vector<int>; using vs = vector<string>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define...
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; using ll = long long; using vl = vector<ll>; using vvl = vector<vector<ll>>; using vc = vector<char>; using vvc = vector<vector<char>>; using vi = vector<int>; using vs = vector<string>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define...
[["+", 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
211
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr int MOD = 1e9 + 7; inline int pot(ll n, unsigned int k, int mod = MOD) { ll ret = 1; while (k) { if (k & 1u) { ret *= n; ret %= mod; } n *= n; n %= mod; k >>= 1u; } return ret; } ll sub(ll a, ll co...
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr int MOD = 1e9 + 7; inline int pot(ll n, unsigned int k, int mod = MOD) { ll ret = 1; while (k) { if (k & 1u) { ret *= n; ret %= mod; } n *= n; n %= mod; k >>= 1u; } return ret; } ll sub(ll a, ll co...
[["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 25], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 17, 109], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 12, 22]]
1
223
N = int(input()) ans = (9**N - 2*8**N + 7**N)%(10**9+7) print(ans)
N = int(input()) ans = (10**N - 2*9**N + 8**N)%(10**9+7) print(ans)
[["-", 31, 23, 0, 657, 31, 657, 31, 657, 31, 612], ["+", 31, 23, 0, 657, 31, 657, 31, 657, 31, 612], ["-", 0, 657, 31, 657, 12, 657, 12, 657, 31, 612], ["+", 0, 657, 31, 657, 12, 657, 12, 657, 31, 612], ["-", 12, 657, 31, 23, 0, 657, 12, 657, 31, 612], ["+", 12, 657, 31, 23, 0, 657, 12, 657, 31, 612]]
5
37
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))
[["+", 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
33
# # # author : samars_diary # # 16-09-2020 │ 18:28:11 # # # import sys, os.path, math #if(os.path.exists('input.txt')): #sys.stdin = open('input.txt',"r") #sys.stdout = open('output.txt',"w") sys.setrecursionlimit(10 ** 5) def mod(): return...
# # # author : samars_diary # # 16-09-2020 │ 18:28:11 # # # import sys, os.path, math #if(os.path.exists('input.txt')): #sys.stdin = open('input.txt',"r") #sys.stdout = open('output.txt',"w") sys.setrecursionlimit(10 ** 5) def mod(): return...
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["+", 0, 657, 12, 657, 12, 652, 3, 4, 0, 25], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 652, 3, 4, 0, 657, 12, 652, 63, 22], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 24]]
5
198
/** * Author : RDP * There are no two words in the English language more harmful than "good job". * 1729 ;) **/ #include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <lis...
/** * Author : RDP * There are no two words in the English language more harmful than "good job". * 1729 ;) **/ #include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <lis...
[["+", 31, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 25], ["+", 12, 16, 31, 16, 31, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 16, 31, 16, 12, 16, 12, 22]]
1
360
i = int(input()) print(i, (10**i - 9**i - 9**i + 8**i) % (10**9 + 7))
i = int(input()) print((10**i - 9**i - 9**i + 8**i) % (10**9 + 7))
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 21]]
5
38
#include "bits/stdc++.h" #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define REP(i, n) for (int i = 1; i <= (int)(n); i++) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() using namespace std; using ll = long long; using pi = pair<int, int>; const ll INF = 1LL << 60; // const ll mod = 1e...
#include "bits/stdc++.h" #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define REP(i, n) for (int i = 1; i <= (int)(n); i++) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() using namespace std; using ll = long long; using pi = pair<int, int>; const ll INF = 1LL << 60; // const ll mod = 1e...
[["-", 31, 16, 12, 23, 0, 2, 3, 4, 0, 13], ["+", 31, 16, 12, 23, 0, 2, 3, 4, 0, 22]]
1
638
#include "bits/stdc++.h" #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define REP(i, n) for (int i = 1; i <= (int)(n); i++) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() using namespace std; using ll = long long; using pi = pair<int, int>; const ll INF = 1LL << 60; const ll mod = 1e9 +...
#include "bits/stdc++.h" #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define REP(i, n) for (int i = 1; i <= (int)(n); i++) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() using namespace std; using ll = long long; using pi = pair<int, int>; const ll INF = 1LL << 60; const ll mod = 1e9 +...
[["-", 12, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 12, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["-", 12, 23, 0, 16, 31, 2, 3, 4, 0, 13], ["+", 12, 23, 0, 16, 31, 2, 3, 4, 0, 13]]
1
229
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) typedef long long ll; using namespace std; const int MOD = 1e9 + 7; int mpow(ll a, int b) { int ans = 1; while (b) { if (b % 2 == 1) ans = (ans * a) % MOD; b /= 2; a = (a * a) % MOD; } return ans; } int main() { ll n; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) typedef long long ll; using namespace std; const int MOD = 1e9 + 7; int mpow(ll a, int b) { int ans = 1; while (b) { if (b % 2 == 1) ans = (ans * a) % MOD; b /= 2; a = (a * a) % MOD; } return ans; } int main() { ll n; ...
[["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 25], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22]]
1
138
"""AtCoder Beginner Contest 178. C """ import sys def input() -> str: # noqa: A001 """Input.""" return sys.stdin.readline()[:-1] def main(): """Run.""" mod = 1000000007 n = int(input()) ans = 0 if n <= 1: ans = 0 elif n == 2: ans = 2 else: ans = 10**n...
"""AtCoder Beginner Contest 178. C """ import sys def input() -> str: # noqa: A001 """Input.""" return sys.stdin.readline()[:-1] def main(): """Run.""" mod = 1000000007 n = int(input()) ans = 0 if n <= 1: ans = 0 elif n == 2: ans = 2 else: ans = 10**n...
[["-", 8, 196, 0, 1, 0, 677, 12, 657, 31, 612], ["+", 8, 196, 0, 1, 0, 677, 12, 657, 31, 612]]
5
98
#include <bits/stdc++.h> #define sort stable_sort using namespace std; int _; mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); const int mod = 1e9 + 7; int n; inline int powlog(int x, int t) { int ans = 1; while (t--) { ans *= x; ans %= mod; } return ans; } int main() { // fo...
#include <bits/stdc++.h> #define sort stable_sort using namespace std; int _; mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); const int mod = 1e9 + 7; int n; inline long long powlog(int x, int t) { long long ans = 1; while (t--) { ans *= x; ans %= mod; } return ans; } int main...
[["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 0, 30, 0, 14, 39, 86, 0, 96], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
142
#include <bits/stdc++.h> #define sort stable_sort using namespace std; int _; mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); const int mod = 1e9 + 7; int n; inline long long powlog(int x, int t) { long long ans = 1; while (t--) { ans *= x; ans %= mod; } return ans; } int main...
#include <bits/stdc++.h> #define sort stable_sort using namespace std; int _; mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); const int mod = 1e9 + 7; int n; inline long long powlog(int x, int t) { long long ans = 1; while (t--) { ans *= x; ans %= mod; } return ans; } int main...
[["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 25], ["+", 0, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 0, 16, 31, 23, 0, 16, 31, 16, 12, 22]]
1
142
#include "bits/stdc++.h" using namespace std; const int MAX = 700000; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD ...
#include "bits/stdc++.h" using namespace std; const int MAX = 700000; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD ...
[["+", 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
736
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fi first #define se second #define sz(a) (a).size() #define all(c) (c).begin(), (c).end() #define rep(i, n) for (int i = 0; i < n; i++) #define forn(i, n) for (int i = 1; i <= n; i++) #define ford(i, n) for (int i = n; i >= 0; i--) #define REP(i...
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fi first #define se second #define sz(a) (a).size() #define all(c) (c).begin(), (c).end() #define rep(i, n) for (int i = 0; i < n; i++) #define forn(i, n) for (int i = 1; i <= n; i++) #define ford(i, n) for (int i = n; i >= 0; i--) #define REP(i...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
218
#include <bits/stdc++.h> #define int long long #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define sz(a) a.size() #define re return #define MP make_pair #define pb push_back #define pii pair<int, int> #define se second #define fi first using namespace std; const int MOD = 1e9 + 7; int n; int ...
#include <bits/stdc++.h> #define int long long #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define sz(a) a.size() #define re return #define MP make_pair #define pb push_back #define pii pair<int, int> #define se second #define fi first using namespace std; const int MOD = 1e9 + 7; int n; int ...
[["+", 31, 23, 0, 16, 31, 16, 31, 16, 17, 72], ["+", 0, 16, 31, 16, 31, 16, 12, 16, 31, 22], ["+", 0, 16, 31, 16, 31, 16, 12, 16, 17, 48], ["+", 0, 16, 31, 16, 31, 16, 12, 16, 12, 13]]
1
158
#include <bits/stdc++.h> using namespace std; int n; int main() { cin >> n; int m = n, k = n; long long ans = 1, cnt = 1, tle = 1; while (n--) { ans *= (long long)10; ans %= (long long)1000000007; } while (m--) { cnt *= (long long)9; cnt %= (long long)1000000007; } while (k--) { tle ...
#include <bits/stdc++.h> using namespace std; int n; int main() { cin >> n; int m = n, k = n; long long ans = 1, cnt = 1, tle = 1; while (n--) { ans *= (long long)10; ans %= (long long)1000000007; } while (m--) { cnt *= (long long)9; cnt %= (long long)1000000007; } while (k--) { tle ...
[["-", 31, 23, 0, 16, 31, 16, 31, 16, 31, 13], ["+", 31, 23, 0, 16, 31, 16, 31, 16, 31, 13]]
1
130
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <time.h> #include <vector> using namespace std; #define ll long long const ll mod = 1e9 + 7; ll po(ll a, ll b) { ll ans = 1; whil...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <time.h> #include <vector> using namespace std; #define ll long long const ll mod = 1e9 + 7; ll po(ll a, ll b) { ll ans = 1; whil...
[["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 109], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]]
1
158
m=10**9+7 n=int(input()) a=(8**n)%m b=(9**n)%m c=(10**n)%m print((2*b-c+a)%m)
m=10**9+7 n=int(input()) a=(8**n)%m b=(9**n)%m c=(10**n)%m print((c-2*b+a)%m)
[["+", 0, 657, 31, 23, 0, 657, 31, 657, 31, 22], ["+", 0, 657, 31, 23, 0, 657, 31, 657, 17, 33], ["-", 0, 657, 31, 23, 0, 657, 31, 657, 17, 33], ["-", 0, 657, 31, 23, 0, 657, 31, 657, 12, 22]]
5
56
n = int(input()) mod = 1000000007 ans = pow(10,n,mod) - 2*pow(9,n,mod) + pow(8,n,mod) print(ans)
n = int(input()) mod = 1000000007 ans = pow(10,n,mod) - 2*pow(9,n,mod) + 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
45
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int mod = 1e9 + 7; LL qpow(int a, int b) { LL res = 1; while (b) { if (b & 1) res = res * a % mod; a = 1LL * a * a % mod; b >>= 1; } return res; } int main() { LL n; cin >> n; if (n == 1) cout << 0 << '\n'...
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int mod = 1e9 + 7; LL qpow(int a, int b) { LL res = 1; while (b) { if (b & 1) res = res * a % mod; a = 1LL * a * a % mod; b >>= 1; } return res; } int main() { LL n; cin >> n; if (n == 1) cout << 0 << '\n'...
[["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 22]]
1
138
#include <bits/stdc++.h> #define ll long long int #define pb push_back #define forn(i, n1, n2) for (ll i = n1; i < n2; i++) #define w(t) \ ll t; \ cin >> t; ...
#include <bits/stdc++.h> #define ll long long int #define pb push_back #define forn(i, n1, n2) for (ll i = n1; i < n2; i++) #define w(t) \ ll t; \ cin >> t; ...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
428
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; #define _GLIBCXX_DEBUG int mod = 1e9 + 7; int main() { ll n; cin >> n; ll ten, nine, eight = 1; rep(i, n) { ten *= 10; ten %= mod; nine *= 9; nine %= mod; eight *= 8; eigh...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; #define _GLIBCXX_DEBUG int mod = 1e9 + 7; int main() { ll n; cin >> n; ll ten = 1, nine = 1, eight = 1; rep(i, n) { ten *= 10; ten %= mod; nine *= 9; nine %= mod; eight *= 8; ...
[["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
111
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; #define _GLIBCXX_DEBUG ll mod = 1e9 + 7; int main() { ll n; cin >> n; ll times10 = 1; rep(i, n) { times10 = 10 * times10; times10 = times10 % mod; } ll times9 = 1; rep(i, n) { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; #define _GLIBCXX_DEBUG ll mod = 1e9 + 7; int main() { ll n; cin >> n; ll times10 = 1; rep(i, n) { times10 = 10 * times10; times10 = times10 % mod; } ll times9 = 1; rep(i, n) { ...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 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]]
1
153
from functools import reduce N = int(input()) mod = 10**9 + 7 def powmod(val, n, mod): # vals = [val]*n # ret = reduce(lambda x, y: x * y % mod, vals) # return ret for i in range(n): ret = ret * val % mod return ret all = powmod(10, N, mod) b = powmod(9, N, mod) c = powmod(8, N, mod)...
from functools import reduce N = int(input()) mod = 10**9 + 7 def powmod(val, n, mod): # vals = [val]*n # ret = reduce(lambda x, y: x * y % mod, vals) # return ret ret = 1 for i in range(n): ret = ret * val % mod return ret all = powmod(10, N, mod) b = powmod(9, N, mod) c = powmo...
[["+", 0, 14, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 14, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 14, 8, 196, 0, 1, 0, 662, 12, 612]]
5
98
N = int(input()) mod = 10**9 + 7 def powmod(val, n, mod): ret = 1 for i in range(n): ret = ret * val % mod return ret all = powmod(10, N, mod) b = powmod(9, N, mod) c = powmod(8, N, mod) ans = all - (2*b - c) print(ans)
N = int(input()) mod = 10**9 + 7 def powmod(val, n, mod): ret = 1 for i in range(n): ret = ret * val % mod return ret all = powmod(10, N, mod) b = powmod(9, N, mod) c = powmod(8, N, mod) ans = (all - (2*b - c))%mod print(ans)
[["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 12, 657, 31, 23, 0, 657, 12, 23, 0, 25], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 109], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]]
5
90
n = int(input()) mod = 1000000007 if n < 2: print(0) else: print(pow(10, n, mod) - 2 * pow(9, n, mod) + pow(8, n, mod))
n = int(input()) mod = 1000000007 if n < 2: print(0) else: print((pow(10, n, mod) - 2 * pow(9, n, mod) + pow(8, 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
53
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)
[["-", 0, 657, 31, 657, 31, 652, 3, 4, 0, 22], ["+", 0, 657, 31, 657, 31, 652, 3, 4, 0, 22], ["-", 31, 657, 12, 657, 12, 652, 3, 4, 0, 22], ["+", 31, 657, 12, 657, 12, 652, 3, 4, 0, 22], ["-", 31, 23, 0, 657, 12, 652, 3, 4, 0, 22], ["+", 31, 23, 0, 657, 12, 652, 3, 4, 0, 22]]
5
51
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #define debug(var) cerr << (#var) << " = " << (var) << endl; #else #define debug(var) #endif void init() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); } const int mod = 1e9 + 7; long long binpow(long long b, long long e) { if (!e) ret...
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #define debug(var) cerr << (#var) << " = " << (var) << endl; #else #define debug(var) #endif void init() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); } const int mod = 1e9 + 7; long long binpow(long long b, long long e) { if (!e) ret...
[["+", 0, 16, 31, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 16, 31, 16, 31, 16, 12, 16, 12, 22]]
1
212
#include <bits/stdc++.h> using namespace std; using ll = long long; ll mod = 1e9 + 7; ll binpow(ll a, ll b) { ll res = 1; while (b > 0) { if (b & 1) { res = res * a; res %= mod; } a = a * a % mod; b >>= 1; } return res; } int main() { ll n; cin >> n; if (n == 1) cout <<...
#include <bits/stdc++.h> using namespace std; using ll = long long; ll mod = 1e9 + 7; ll binpow(ll a, ll b) { ll res = 1; while (b > 0) { if (b & 1) { res = res * a; res %= mod; } a = a * a % mod; b >>= 1; } return res; } int main() { ll n; cin >> n; if (n == 1) cout <<...
[["+", 0, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 16, 12, 16, 31, 23, 0, 16, 12, 22]]
1
138
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int mod = 1000000007; long sum = (2 * pow(9, n, mod)) % mod; long part = sum - pow(8, n, mod); if (part < 0) part += mod; long ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int mod = 1000000007; long sum = (2 * pow(9, n, mod)) % mod; long part = sum - pow(8, n, mod); if (part < 0) part += mod; long ...
[["+", 0, 16, 31, 23, 0, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 23, 0, 16, 31, 23, 0, 25], ["+", 31, 23, 0, 16, 31, 23, 0, 16, 17, 109], ["+", 31, 23, 0, 16, 31, 23, 0, 16, 12, 22]]
3
190
/* AUTHOR : Ankit Kumar BRANCH : Information Technology INSTITUTE : Birla Institute of Technology */ #include <bits/stdc++.h> using namespace std; #define fast \ ios_base::sync_with_stdio(0); \...
/* AUTHOR : Ankit Kumar BRANCH : Information Technology INSTITUTE : Birla Institute of Technology */ #include <bits/stdc++.h> using namespace std; #define fast \ ios_base::sync_with_stdio(0); \...
[["+", 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
1,355
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i < n; i++) #define ll long long #define INF 21474836...
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i < n; i++) #define ll long long #define INF 21474836...
[["-", 0, 16, 31, 16, 31, 2, 3, 4, 0, 13], ["+", 0, 16, 31, 16, 31, 2, 3, 4, 0, 13], ["-", 0, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["-", 12, 23, 0, 16, 12, 2, 3, 4, 0, 13], ["+", 12, 23, 0, 16, 12, 2, 3, 4, 0, 13]]
1
194
// #pragma GCC optimize("Ofast") // #pragma GCC optimize("unroll-loops") // #pragma GCC // target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native") #include "bits/stdc++.h" #ifdef FFS #include "debug.h" #else #define debug(args...) #endif #define endl '\n' using namespace std; using ll = long long; using ...
// #pragma GCC optimize("Ofast") // #pragma GCC optimize("unroll-loops") // #pragma GCC // target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native") #include "bits/stdc++.h" #ifdef FFS #include "debug.h" #else #define debug(args...) #endif #define endl '\n' using namespace std; using ll = long long; using ...
[["+", 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
185
#include <bits/stdc++.h> using namespace std; typedef long long ll; //マクロ // forループ関係 //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for...
#include <bits/stdc++.h> using namespace std; typedef long long ll; //マクロ // forループ関係 //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for...
[["+", 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
237
n = int(input()) mod = 10**9+7 ans = pow(10, n, mod) ans -= pow(9, n, mod) ans += pow(8, n, mod) print(ans % mod)
n = int(input()) mod = 10**9+7 ans = pow(10, n, mod) ans -= pow(9, n, mod)*2 ans += pow(8, n, mod) print(ans % mod)
[["+", 0, 656, 0, 1, 0, 677, 12, 657, 17, 48], ["+", 0, 656, 0, 1, 0, 677, 12, 657, 12, 612]]
5
51
package main import ( "fmt" ) const mod = 1000000007 func main() { var n int fmt.Scan(&n) ans := (powmod(10, n) - 2*powmod(9, n) + powmod(8, n) + mod) % mod fmt.Println(ans) } func powmod(x, n int) int { res := 1 for i := 0; i < n; i++ { res *= x res %= mod } return res }
package main import ( "fmt" ) const mod = 1000000007 func main() { var n int fmt.Scan(&n) ans := (powmod(10, n) - 2*powmod(9, n)%mod + powmod(8, n) + mod) % mod fmt.Println(ans) } func powmod(x, n int) int { res := 1 for i := 0; i < n; i++ { res *= x res %= mod } return res }
[["+", 0, 16, 31, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 16, 31, 16, 31, 16, 12, 16, 12, 22]]
7
114
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mod = 1000000007; ll powmod(ll x, ll y) { ll res = 1; for (ll i = 0; i < y; i++) { res = res * x % mod; } return res; } int main() { ll n; cin >> n; ll ans = powmod(10, n) - powmod(9, n) - powmod(9, n) + powmod(8, n); ans...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mod = 1000000007; ll powmod(ll x, ll y) { ll res = 1; for (ll i = 0; i < y; i++) { res = res * x % mod; } return res; } int main() { ll n; cin >> n; ll ans = powmod(10, n) - powmod(9, n) - powmod(9, n) + powmod(8, n); ans...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 62], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
126
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mod = 1000000007; ll powmod(ll x, ll y) { ll res = 1; for (ll i = 0; i < y; i++) { res = res * x % mod; } return res; } int main() { ll n; cin >> n; ll ans = powmod(10, n) - powmod(9, n) - powmod(9, n) + powmod(8, n); ans...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mod = 1000000007; ll powmod(ll x, ll y) { ll res = 1; for (ll i = 0; i < y; i++) { res = res * x % mod; } return res; } int main() { ll n; cin >> n; ll ans = powmod(10, n) - powmod(9, n) - powmod(9, n) + powmod(8, n); ans ...
[["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 44]]
1
126
n=int(input()) a=1000000007 ans=10**n%a-9**n%a-9**n%a+8**n%a print(ans)
n=int(input()) a=1000000007 ans=(10**n%a-9**n%a-9**n%a+8**n%a)%a print(ans)
[["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 12, 657, 31, 23, 0, 657, 12, 657, 17, 109], ["+", 12, 657, 31, 23, 0, 657, 12, 657, 12, 22], ["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 25]]
5
40
#include <algorithm> #include <cstdio> #include <iostream> #include <vector> #define ll long long #define REP(i, n) for (int(i) = 0; (i) < (int)(n); (i)++) #define foreach(c, itr) \ for (__typeof((c).begin()) itr = (c).begin(); itr != (c).end(); itr++) using name...
#include <algorithm> #include <cstdio> #include <iostream> #include <vector> #define ll long long #define REP(i, n) for (int(i) = 0; (i) < (int)(n); (i)++) #define foreach(c, itr) \ for (__typeof((c).begin()) itr = (c).begin(); itr != (c).end(); itr++) using name...
[["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 22]]
1
137
#include <bits/stdc++.h> using namespace std; using ll = long long; const int MOD = 1e9 + 7; ll cal(ll a, ll n) { ll tmp = a; tmp = tmp % MOD; for (ll i = 0; i < n - 1; ++i) { tmp = tmp * a; tmp = tmp % MOD; } return tmp; } int main() { int n; cin >> n; ll ans = cal(10, n) - cal(9, n) - cal(9...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int MOD = 1e9 + 7; ll cal(ll a, ll n) { ll tmp = a; tmp = tmp % MOD; for (ll i = 0; i < n - 1; ++i) { tmp = tmp * a; tmp = tmp % MOD; } return tmp; } int main() { int n; cin >> n; ll ans = cal(10, n) - cal(9, n) - cal(9...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 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]]
1
138
#include <bits/stdc++.h> using namespace std; #define MOD (1000000000 + 7) #define pb(x) push_back(x) #define mp(x, y) make_pair(x, y) #define nl '\n' #define all(x) x.begin(), x.end() #define print(vec, l, r) \ for (int i = l; i <= r; i++) ...
#include <bits/stdc++.h> using namespace std; #define MOD (1000000000 + 7) #define pb(x) push_back(x) #define mp(x, y) make_pair(x, y) #define nl '\n' #define all(x) x.begin(), x.end() #define print(vec, l, r) \ for (int i = l; i <= r; i++) ...
[["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22], ["+", 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
289
#include <bits/stdc++.h> #include <iostream> #include <string.h> #include <string> using namespace std; long long mod = 1000000000 + 7; long powpow(long x, long n) { long y = 1; for (int i = 0; i < n; i++) { y *= x; y %= mod; } return y; } int main() { long n; cin >> n; long ans = powpow(10, ...
#include <bits/stdc++.h> #include <iostream> #include <string.h> #include <string> using namespace std; long long mod = 1000000000 + 7; long powpow(long x, long n) { long y = 1; for (int i = 0; i < n; i++) { y *= x; y %= mod; } return y; } int main() { long n; cin >> n; long ans = powpow(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
115
#include <bits/stdc++.h> //{ START using namespace std; #define int int64_t #define rep(i, a, n) for (int i = (a); i < (n); ++i) #define reps(i, a, n) for (int i = (n - 1); i > (a - 1); --i) #define arep(i, x) for (auto &&i : (x)) #define irep(i, x) for (auto i = (x).begin(); i != (x).end(); ++i) #define rirep(i, x) f...
#include <bits/stdc++.h> //{ START using namespace std; #define int int64_t #define rep(i, a, n) for (int i = (a); i < (n); ++i) #define reps(i, a, n) for (int i = (n - 1); i > (a - 1); --i) #define arep(i, x) for (auto &&i : (x)) #define irep(i, x) for (auto i = (x).begin(); i != (x).end(); ++i) #define rirep(i, x) f...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 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]]
1
576
#include <bits/stdc++.h> using namespace std; int main() { int long long n; cin >> n; if (n == 1) { cout << 0 << endl; } else { int long long x = 1, y = 1, z = 1; int long long ans; int long long mod = 1000000007; for (int long long i = 0; i < n; i++) { x = (x * 10) % mod; y = (...
#include <bits/stdc++.h> using namespace std; int main() { int long long n; cin >> n; if (n == 1) { cout << 0 << endl; } else { int long long x = 1, y = 1, z = 1; int long long ans; int long long mod = 1000000007; for (int long long i = 0; i < n; i++) { x = (x * 10) % mod; y = (...
[["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 25], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22]]
1
133
// 及时当勉励,岁月不待人! //当前状态 : attempted #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <queue> #include <stack> #include <string> #include <vector> #define MP make_pair using namespace std; typedef long long ll; const int inf = 0x3f3f3f3f; const ll...
// 及时当勉励,岁月不待人! //当前状态 : attempted #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <queue> #include <stack> #include <string> #include <vector> #define MP make_pair using namespace std; typedef long long ll; const int inf = 0x3f3f3f3f; const ll...
[["+", 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
317
N = int(input()) mod = int(1e9) + 7 print(pow(10, N, mod) - pow(9, N, mod) - pow(9, N, mod) + pow(8, N, mod))
N = int(input()) mod = int(1e9) + 7 print((pow(10, N, mod) - pow(9, N, mod) - pow(9, N, mod) + pow(8, N, mod))%mod)
[["+", 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
54
#include <bits/stdc++.h> typedef long long LL; const int N = 1e6 + 10; using namespace std; const int mod = 1e9 + 7; LL f[N]; LL qpow(LL x, LL k) { LL res = 1; while (k) { if (k & 1) res = res * x % mod; k >>= 1; x = x * x % mod; } return res; } LL C(LL n, LL m) { return f[n] * (qpow(f[m] * ...
#include <bits/stdc++.h> typedef long long LL; const int N = 1e6 + 10; using namespace std; const int mod = 1e9 + 7; LL f[N]; LL qpow(LL x, LL k) { LL res = 1; while (k) { if (k & 1) res = res * x % mod; k >>= 1; x = x * x % mod; } return res; } LL C(LL n, LL m) { return f[n] * (qpow(f[m] * ...
[["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 72], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 16, 12, 16, 31, 16, 31, 16, 17, 109], ["+", 0, 16, 12, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 11, 12, 16, 31, 16, 31, 16, 17, 109], ["+", 0, 11, 12, 16, 31, 16, 31, 16, 12, 22]]
1
290
#include <bits/stdc++.h> using namespace std; #define loop(i, x, z) for (int i = x; i < z; i++) using ll = long long; #define pb push_back #define fi first #define se second #define all(x) x.begin(), x.end() typedef pair<int, int> pii; const ll M = 1000000007; typedef int item; ll p(ll a, int n) { ll res = 1; while...
#include <bits/stdc++.h> using namespace std; #define loop(i, x, z) for (int i = x; i < z; i++) using ll = long long; #define pb push_back #define fi first #define se second #define all(x) x.begin(), x.end() typedef pair<int, int> pii; const ll M = 1000000007; typedef int item; ll p(ll a, int n) { ll res = 1; while...
[["+", 0, 11, 12, 16, 31, 16, 12, 74, 0, 24], ["+", 12, 16, 31, 16, 12, 74, 39, 77, 39, 78], ["+", 0, 11, 12, 16, 31, 16, 12, 74, 0, 25], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
177
#include "bits/stdc++.h" using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define mod 1000000007 int main() { ll n; cin >> n; ll ans = 1; ll buf = 1; ll buf2 = 1; if (n < 2) { cout << 0 << endl; return 0; } rep(i, n) ans = ans * 10 % mod; rep(i, n) bu...
#include "bits/stdc++.h" using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define mod 1000000007 int main() { ll n; cin >> n; ll ans = 1; ll buf = 1; ll buf2 = 1; if (n < 2) { cout << 0 << endl; return 0; } rep(i, n) ans = ans * 10 % mod; rep(i, n) bu...
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
138
#!/usr/bin/env python # -*- coding: utf-8 -*- def main(): n = int(input()) mod = pow(10,9) + 7 ans = pow(10,n,mod) ans -= pow(9,n,mod)*2 ans += pow(8,n,mod) print(ans) if __name__ == '__main__': main()
#!/usr/bin/env python # -*- coding: utf-8 -*- def main(): n = int(input()) mod = pow(10,9) + 7 ans = pow(10,n,mod) ans -= pow(9,n,mod)*2 ans += 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
71
#include <bits/stdc++.h> using namespace std; #define ll long long const int mod = 1e9 + 7; ll fastexpo(ll a, ll b) { if (b == 0) return 1; ll ans = (fastexpo(a, b / 2)) % mod; if (b % 2 == 1) return (a % mod * ans % mod * ans % mod) % mod; else return (ans % mod * ans % mod) % mod; } int main()...
#include <bits/stdc++.h> using namespace std; #define ll long long const int mod = 1e9 + 7; ll fastexpo(ll a, ll b) { if (b == 0) return 1; ll ans = (fastexpo(a, b / 2)) % mod; if (b % 2 == 1) return (a % mod * ans % mod * ans % mod) % mod; else return (ans % mod * ans % mod) % mod; } int main()...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
169
#include <bits/stdc++.h> using namespace std; int main(void) { long long int n, m, i = 0, j, MOD = 1000000007, a = 1, c = 1, p = 1; cin >> n; for (i = 0; i < n; i++) { a = a * 10 % MOD; c = c * 9 % MOD; p = p * 8 % MOD; } cout << (a + MOD - c - c + p) % MOD << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main(void) { long long int n, m, i = 0, j, MOD = 1000000007, a = 1, c = 1, p = 1; cin >> n; for (i = 0; i < n; i++) { a = a * 10 % MOD; c = c * 9 % MOD; p = p * 8 % MOD; } cout << (a + MOD + MOD - c - c + p) % MOD << endl; return 0; }
[["+", 0, 16, 31, 16, 31, 16, 31, 16, 17, 72], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22]]
1
106
#include <bits/stdc++.h> using namespace std; long long powermod(long long power, long long base) { long long n = 1; for (long long i = 0; i < power; i++) { n *= base; n %= 1000000007; } return n; } int main() { long long N; cin >> N; if (N > 1) { long long ans; ans = powermod(N, 10) - 2...
#include <bits/stdc++.h> using namespace std; long long powermod(long long power, long long base) { long long n = 1; for (long long i = 0; i < power; i++) { n *= base; n %= 1000000007; } return n; } int main() { long long N; cin >> N; if (N > 1) { long long ans; ans = powermod(N, 10) - 2...
[["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 132], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22]]
1
124
N = int(input()) mod = 10**9 + 7 ans = pow(10,N,mod) ans -= pow(9,N,mod) ans -= pow(9,N,mod) ans += pow(8,N,mod) print(ans)
N = int(input()) mod = 10**9 + 7 ans = pow(10,N,mod) ans -= pow(9,N,mod) ans -= pow(9,N,mod) ans += pow(8,N,mod) ans %= mod print(ans)
[["+", 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
59
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 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)
[["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 0, 1, 0, 662, 12, 657, 31, 23, 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 <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; int binpow(int a, int b) { int res = 1; while (b) { if (b & 1) res = 1LL * res * a % MOD; a = 1LL * a * a % MOD; b >>= 1; } return res; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n...
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; int binpow(int a, int b) { int res = 1; while (b) { if (b & 1) res = 1LL * res * a % MOD; a = 1LL * a * a % MOD; b >>= 1; } return res; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n...
[["+", 31, 16, 31, 16, 31, 16, 31, 16, 31, 13], ["+", 31, 16, 31, 16, 31, 16, 31, 16, 17, 72]]
1
136
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; int main() { int n; cin >> n; int a = 1, b = 1, c = 1; for (int i = 1; i <= n; i++) { a = a * 10 % MOD; b = b * 9 % MOD; c = c * 8 % MOD; } a = (a - b % MOD + MOD) % MOD; a = (a - b % MOD + MOD) % MOD; a = (a + c % MOD +...
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; int main() { int n; cin >> n; long long a = 1, b = 1, c = 1; for (int i = 1; i <= n; i++) { a = a * 10 % MOD; b = b * 9 % MOD; c = c * 8 % MOD; } a = (a - b % MOD + MOD) % MOD; a = (a - b % MOD + MOD) % MOD; a = (a + c %...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 109], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
133
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; using pli = pair<ll, int>; #define fi first #define se second #define pb push_back #define sz(x) (int)((x).size()) #define fast \ ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; using pli = pair<ll, int>; #define fi first #define se second #define pb push_back #define sz(x) (int)((x).size()) #define fast \ ...
[["+", 0, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 16, 12, 16, 31, 23, 0, 16, 12, 22]]
1
228
N = int(input()) M = 7 + 10 ** 9 A = 0 def fac_mod(a, b): x = 1 for i in range(1, b+1): x = (x*a) % M return x A = fac_mod(10, N) - fac_mod(9, N) * 2 + fac_mod(8, N) % M if A < 0: A = M - A print(A)
N = int(input()) M = 7 + 10 ** 9 A = 0 def fac_mod(a, b): x = 1 for i in range(1, b+1): x = (x*a) % M return x A = (fac_mod(10, N) - fac_mod(9, N) * 2 + fac_mod(8, N)) % M if A < 0: A = M + A print(A)
[["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 31, 23, 0, 657, 12, 652, 3, 4, 0, 25], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 72]]
5
92
MOD = 10**9 + 7 n = int(input()) ans = pow(10, n, MOD) - pow(9, n, MOD) * 2 + pow(8, n, MOD) print(ans)
MOD = 10**9 + 7 n = int(input()) ans = MOD + pow(10, n, MOD) - pow(9, n, MOD) * 2 + pow(8, n, MOD) print(ans % MOD)
[["+", 0, 662, 12, 657, 31, 657, 31, 657, 31, 22], ["+", 0, 662, 12, 657, 31, 657, 31, 657, 17, 72], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
49
n = int(input()) a = 10**9+7 def mod(i,j): ans = 1 for _ in range(j): ans = (ans*i)%a return(ans) print((mod(10,n)-mod(9,n)*2+mod(8,n)%a))
n = int(input()) a = 10**9+7 def mod(i,j): ans = 1 for _ in range(j): ans = (ans*i)%a return(ans) print(((mod(10,n)-mod(9,n)*2+mod(8,n))%a))
[["+", 3, 4, 0, 23, 0, 657, 31, 23, 0, 24], ["+", 31, 23, 0, 657, 12, 652, 3, 4, 0, 25]]
5
76
#include <bits/stdc++.h> using namespace std; /* -------------------------------------------------TEMPLATE------------------------------------------------*/ #define C continue; #define R return #define int long long #define D double #define I insert #define ull unsigned long long #define ui unsigned int #define ld lon...
#include <bits/stdc++.h> using namespace std; /* -------------------------------------------------TEMPLATE------------------------------------------------*/ #define C continue; #define R return #define int long long #define D double #define I insert #define ull unsigned long long #define ui unsigned int #define ld lon...
[["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 72], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 22], ["+", 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
656
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, mod = 1e9 + 7, ans = 0; cin >> n; ll a = 1, b = 1, c = 1; for (int i = 0; i < n; i++) { a = (a * 10) % mod; b = (b * 9) % mod; c = (c * 8) % mod; } cout << (a - b - b + c + mod) % mod << endl; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, mod = 1e9 + 7, ans = 0; cin >> n; ll a = 1, b = 1, c = 1; for (int i = 0; i < n; i++) { a = (a * 10) % mod; b = (b * 9) % mod; c = (c * 8) % mod; } cout << ((a - b - b + c) % mod + mod) % mod << endl; }
[["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 25], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22]]
1
111
N = int(input()) MOD = 10 ** 9 + 7 answer = pow(10, N, MOD) + pow(8, N, MOD) - 2 * pow(9, N, MOD) print(answer + MOD if answer < 0 else answer % MOD)
N = int(input()) MOD = 10 ** 9 + 7 answer = (pow(10, N, MOD) + pow(8, N, MOD) - 2 * pow(9, N, MOD)) % MOD print(answer + MOD if answer < 0 else answer)
[["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 25], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 109], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22], ["-", 0, 652, 3, 4, 0, 41, 0, 657, 17, 109], ["-", 0, 652, 3, 4, 0, 41, 0, 657, 12, 22]]
5
59
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define endl "\n...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define endl "\n...
[["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 25], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22]]
1
116
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)
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 72]]
5
51
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define M 1000000007 ll powll(ll x, ll y) { ll re = 1; rep(i, y) { re = re * x % M; } return re; } int main() { int n; cin >> n; ll out = 0; ll total = 0; ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define M 1000000007 ll powll(ll x, ll y) { ll re = 1; rep(i, y) { re = re * x % M; } return re; } int main() { int n; cin >> n; ll out = 0; ll total = 0; ...
[["+", 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], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32]]
1
135
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)
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22]]
5
50
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define ff first #define ss second #define rsz resize #define ins insert #define mp make_pair #define pf push_front #define pb push_back #define eb emplace_back #define ft front() #define bk back() #define sz(x) (int)(x).size() ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define ff first #define ss second #define rsz resize #define ins insert #define mp make_pair #define pf push_front #define pb push_back #define eb emplace_back #define ft front() #define bk back() #define sz(x) (int)(x).size() ...
[["+", 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], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
279
def func(x, n): res = 1 for _ in range(n): res = res * x % MOD return res n = int(input()) MOD = 10**9 + 7 ans = func(10, n) - func(9, n) - func(9, n) + func(8, n) print(ans)
def func(x, n): res = 1 for _ in range(n): res = res * x % MOD return res n = int(input()) MOD = 10**9 + 7 ans = func(10, n) - func(9, n) - func(9, n) + func(8, n) 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
76
#include <bits/stdc++.h> #define lli long long using namespace std; long long mod = 1e9 + 7; lli power(lli x, lli y, lli m = mod) { lli res = 1; while (y > 0) { if (y & 1) res = (res * x) % m; y = y >> 1; x = (x * x) % m; } if (res < 0) res += m; return res; } // lli fact[2000009]; // l...
#include <bits/stdc++.h> #define lli long long using namespace std; long long mod = 1e9 + 7; lli power(lli x, lli y, lli m = mod) { lli res = 1; while (y > 0) { if (y & 1) res = (res * x) % m; y = y >> 1; x = (x * x) % m; } if (res < 0) res += m; return res; } // lli fact[2000009]; // l...
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
210
#include <bits/stdc++.h> using namespace std; long long pow_mod(int a, long x) { long long ret = a; for (long i = x; i > 1; i--) { ret = ret * a % 1000000007; } return ret; } int main() { long n; cin >> n; if (n == 1) { cout << 0; return 0; } cout << (pow_mod(10, n) + pow_mod(8, n) - 2...
#include <bits/stdc++.h> using namespace std; long long pow_mod(int a, long x) { long long ret = a; for (long i = x; i > 1; i--) { ret = ret * a % 1000000007; } return ret; } int main() { long n; cin >> n; if (n == 1) { cout << 0; return 0; } cout << ((pow_mod(10, n) + pow_mod(8, n) - ...
[["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 0, 16, 12, 16, 12, 2, 3, 4, 0, 25], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 13]]
1
113
#include <bits/stdc++.h> using namespace std; #define PI 3.14159265358979323846 #define ll long long int #define ff first #define ss second #define int long long int #define pb push_back #define N 1000010 #define MOD 1000000007 int bexp(int a, int b) { if (b < 0) return 0; int res = 1; while (b) { if ...
#include <bits/stdc++.h> using namespace std; #define PI 3.14159265358979323846 #define ll long long int #define ff first #define ss second #define int long long int #define pb push_back #define N 1000010 #define MOD 1000000007 int bexp(int a, int b) { if (b < 0) return 0; int res = 1; while (b) { if ...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
169
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0); #define FOR(i, s, n) for (int i = (s); i < (n); i++) #define REP(i, n) FOR(i, 0, n) #define RREP(i...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0); #define FOR(i, s, n) for (int i = (s); i < (n); i++) #define REP(i, n) FOR(i, 0, n) #define RREP(i...
[["+", 75, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 75, 16, 31, 23, 0, 16, 31, 16, 12, 22]]
1
319
# coding: utf-8 # Your code here! mod=10**9+7 N=int(input()) a,b,c=1,1,1 for _ in range(N): a*=10 a%=mod b*=9 b%=mod c*=8 c%=mod print(a-2*b+c)
# coding: utf-8 # Your code here! mod=10**9+7 N=int(input()) a,b,c=1,1,1 for _ in range(N): a*=10 a%=mod b*=9 b%=mod c*=8 c%=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
64
#include <algorithm> #include <cstdio> #include <cstring> #include <functional> #include <queue> #define MM 1000000007 using namespace std; int main(void) { long long a, b, c, x; int n, i; scanf("%d", &n); a = 1; b = 1; c = 1; for (i = 0; i < n; i++) { a = a * 10; a = a % MM; b = b * 9; b ...
#include <algorithm> #include <cstdio> #include <cstring> #include <functional> #include <queue> #define MM 1000000007 using namespace std; int main(void) { long long a, b, c, x; int n, i; scanf("%d", &n); a = 1; b = 1; c = 1; for (i = 0; i < n; i++) { a = a * 10; a = a % MM; b = b * 9; b ...
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 72], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25]]
1
141
#include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; long long powmod(long long x, long long y) { long long ret = 1; while (y--) { ret *= x; ret %= mod; } return ret; } int main() { long long N; cin >> N; long long all = powmod(10, N); long long no0 = powmod(9, N); l...
#include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; long long powmod(long long x, long long y) { long long ret = 1; while (y--) { ret *= x; ret %= mod; } return ret; } int main() { long long N; cin >> N; long long all = powmod(10, N); long long no0 = powmod(9, N); l...
[["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22]]
1
139
#include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; long long powmod(long long x, long long y) { long long ret = 1; while (y--) { ret *= x; ret %= mod; } return ret; } int main() { long long N; cin >> N; long long all = powmod(10, N); long long no0 = powmod(9, N); l...
#include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; long long powmod(long long x, long long y) { long long ret = 1; while (y--) { ret *= x; ret %= mod; } return ret; } int main() { long long N; cin >> N; long long all = powmod(10, N); long long no0 = powmod(9, N); l...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13]]
1
139
#include <limits.h> #include <math.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define MOD 1000000007 typedef long long ll; int max(int a, int b) { if (a > b) return a; else return b; } int min(int a, int b) { if (a < b) return a; else return b; } /*qso...
#include <limits.h> #include <math.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define MOD 1000000007 typedef long long ll; int max(int a, int b) { if (a > b) return a; else return b; } int min(int a, int b) { if (a < b) return a; else return b; } /*qso...
[["-", 51, 16, 31, 16, 31, 16, 31, 16, 31, 13], ["+", 51, 16, 31, 16, 31, 16, 31, 16, 31, 13]]
0
204
N = int(input()) mod = 10**9 +7 def powmod(x,y): res = 1 for i in range(0,y,1): res = (res*x) % mod return res ans = powmod(10,N) - powmod(9,N) - powmod(9,N) + powmod(8,N) print(ans)
N = int(input()) mod = 10**9 +7 def powmod(x,y): res = 1 for i in range(0,y,1): res = (res*x) % mod return res ans = (powmod(10,N) - powmod(9,N) - powmod(9,N) + powmod(8,N)) % 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
82
#include <iostream> using namespace std; int main() { long long int N, i, ans_ten = 1, ans_eight = 1, ans_nine = 1, ans; cin >> N; for (i = 1; i <= N; i += 1) { ans_ten = (ans_ten * 10) % 1000000007; ans_eight = (ans_eight * 8) % 1000000007; ans_nine = (ans_nine * 9) % 1000000007; } ans = ((ans_...
#include <iostream> using namespace std; int main() { long long int N, i, ans_ten = 1, ans_eight = 1, ans_nine = 1, ans; cin >> N; for (i = 1; i <= N; i += 1) { ans_ten = (ans_ten * 10) % 1000000007; ans_eight = (ans_eight * 8) % 1000000007; ans_nine = (ans_nine * 9) % 1000000007; } ans = (((ans...
[["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 16, 31, 23, 0, 25], ["+", 31, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 31, 16, 31, 23, 0, 16, 12, 16, 12, 13], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 13], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72]]
1
111
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++) using namespace std; typedef long long ll; ll N; ll MOD = 1000000007; ll a = 10; ll b = 9; ll c = 8; int main() { cin >> N; rep(i, N - 1) { a = ...
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++) using namespace std; typedef long long ll; ll N; ll MOD = 1000000007; ll a = 10; ll b = 9; ll c = 8; int main() { cin >> N; rep(i, N - 1) { a = ...
[["+", 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
141
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++) using namespace std; typedef long long ll; ll N; ll MOD = 1000000007; ll a = 10; ll b = 9; ll c = 8; int main() { cin >> N; rep(i, N - 1) { a = ...
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++) using namespace std; typedef long long ll; ll N; ll MOD = 1000000007; ll a = 10; ll b = 9; ll c = 8; int main() { cin >> N; rep(i, N - 1) { a = ...
[["+", 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
141
#include <bits/stdc++.h> using namespace std; using ll = long long; int mod = 1000000007; ll powMod(ll x, ll n) { ll res = 1; for (ll i = 0; i < n; i++) { res = res * 10 % mod; } return res; } int main() { int n; cin >> n; ll res = powMod(10, n) - powMod(9, n) * 2 + powMod(8, n); res = (res % mod...
#include <bits/stdc++.h> using namespace std; using ll = long long; int mod = 1000000007; ll powMod(ll x, ll n) { ll res = 1; for (ll i = 0; i < n; i++) { res = res * x % mod; } return res; } int main() { int n; cin >> n; ll res = powMod(10, n) - powMod(9, n) * 2 + powMod(8, n); res = (res % mod ...
[["-", 0, 1, 0, 11, 12, 16, 31, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 12, 22]]
1
122
n = int(input()) powof10 = 1 powof9 = 1 powof8 = 1 MOD = 10**9+7 for _ in range(n): powof10 *= 10 powof10 %= MOD powof9 *= 9 powof9 %= MOD powof8 *= 8 powof8 %= MOD print(powof10-2*powof9+powof8)
n = int(input()) powof10 = 1 powof9 = 1 powof8 = 1 MOD = 10**9+7 for _ in range(n): powof10 *= 10 powof10 %= MOD powof9 *= 9 powof9 %= MOD powof8 *= 8 powof8 %= MOD print((powof10-2*powof9+powof8) % 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
60
N = int(input()) MOD = 1000000007 A = pow(10, N, MOD) B = pow(9, N, MOD) C = pow(8, N, MOD) X = A - 2 * B + C print(X)
N = int(input()) MOD = 1000000007 A = pow(10, N, MOD) B = pow(9, N, MOD) C = pow(8, N, MOD) X = A - 2 * B + C print(X % MOD)
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
54
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll mod = 1e9 + 7; ll modpow(ll a, ll n, ll mod) { ll res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } int main() { ll n; cin >> n; ll ans = modpow(10, n, mod) - m...
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll mod = 1e9 + 7; ll modpow(ll a, ll n, ll mod) { ll res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } int main() { ll n; cin >> n; ll ans = modpow(10, n, mod) - m...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 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]]
1
136
#include <bits/stdc++.h> using namespace std; using ll = long long; int m = 1e9 + 7; int main() { int n; cin >> n; ll a = 1, b = 1, c = 1; for (int i = 0; i < n; ++i) { a = a * 10 % m; b = b * 9 % m; c = c * 8 % m; } cout << (a - 2 * b + c) % m << endl; }
#include <bits/stdc++.h> using namespace std; using ll = long long; int m = 1e9 + 7; int main() { int n; cin >> n; ll a = 1, b = 1, c = 1; for (int i = 0; i < n; ++i) { a = a * 10 % m; b = b * 9 % m; c = c * 8 % m; } cout << (a - 2 * b + c + 2 * m) % m << endl; }
[["+", 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
101
N =input() N = int(N) M = 10 ** 9 +7 x = 2 * 9 ** N % M y = 8 ** N % M z = 10 ** N % M - x + y print(z)
N =input() N = int(N) M = 10 ** 9 +7 x = 2 * 9 ** N % M y = 8 ** N % M z = 10 ** N % M - x + y z = z % M print(z)
[["+", 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
49
#include <algorithm> #include <iostream> using namespace std; int main() { long int N, Q = 1000000007, n10 = 1, n9 = 1, n8 = 1; cin >> N; for (int i = 0; i < N; i++) { n10 = n10 * 10 % Q; n9 = n9 * 9 % Q; n8 = n8 * 8 % Q; } cout << (n10 + n8 - 2 * n9) % Q << endl; return 0; }
#include <algorithm> #include <iostream> using namespace std; int main() { long int N, Q = 1000000007, n10 = 1, n9 = 1, n8 = 1; cin >> N; for (int i = 0; i < N; i++) { n10 = n10 * 10 % Q; n9 = n9 * 9 % Q; n8 = n8 * 8 % Q; } cout << (2 * Q + n10 + n8 - 2 * n9) % Q << endl; return 0; }
[["+", 0, 16, 31, 16, 31, 16, 31, 16, 31, 13], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 17, 48], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 31, 23, 0, 16, 31, 16, 31, 16, 17, 72]]
1
97
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define IOS \ ios::sync_with_stdio(0); \ cin....
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define IOS \ ios::sync_with_stdio(0); \ cin....
[["+", 51, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 51, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
549