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()) comb = 10**N-2*(9**N-8**N) print(comb%(10**9+7))
N = int(input()) comb = 10**N-2*9**N+8**N print(comb%(10**9+7))
[["-", 0, 662, 12, 657, 12, 657, 12, 23, 0, 24], ["-", 12, 657, 12, 657, 12, 23, 0, 657, 17, 33], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 72], ["-", 0, 662, 12, 657, 12, 657, 12, 23, 0, 25]]
5
37
n = int(input()) if n == 1: print(1) elif n == 2: print(2) else: m = 10**n -2*(9**n) + 8**n print(m%(10**9 + 7))
n = int(input()) if n == 1: print(0) elif n == 2: print(2) else: m = 10**n -2*(9**n) + 8**n print(m%(10**9 + 7))
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
57
#!/usr/bin/env python3 import sys from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union # import time # import math, cmath # import numpy as np # import scipy.sparse.csgraph as cs # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_pre...
#!/usr/bin/env python3 import sys from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union # import time # import math, cmath # import numpy as np # import scipy.sparse.csgraph as cs # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_pre...
[["+", 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
308
#include <bits/stdc++.h> #define fi first #define se second #define mp make_pair using namespace std; typedef long long ll; typedef pair<int, int> pii; const double eps = 1e-8; const int NINF = 0xc0c0c0c0; const int INF = 0x3f3f3f3f; const ll mod = 1e9 + 7; const ll N = 1e6 + 5; ll qpow(ll a, ll b) { ll res = 1; ...
#include <bits/stdc++.h> #define fi first #define se second #define mp make_pair using namespace std; typedef long long ll; typedef pair<int, int> pii; const double eps = 1e-8; const int NINF = 0xc0c0c0c0; const int INF = 0x3f3f3f3f; const ll mod = 1e9 + 7; const ll N = 1e6 + 5; ll qpow(ll a, ll b) { ll res = 1; ...
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25]]
1
210
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vl = vector<ll>; template <class T> using vc = vector<T>; template <class T> using vvc = vector<vector<T>>; #define eb emplace_back #define all(x) (x).begin(), (x).end() #define rep(i, n) for (ll i = 0; i < (n); i++) #def...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vl = vector<ll>; template <class T> using vc = vector<T>; template <class T> using vvc = vector<vector<T>>; #define eb emplace_back #define all(x) (x).begin(), (x).end() #define rep(i, n) for (ll i = 0; i < (n); i++) #def...
[["+", 0, 1, 0, 11, 12, 16, 12, 16, 17, 109], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 12, 22]]
1
714
#include <algorithm> #include <climits> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <stdlib.h> #include <utility> #include <vector> #define max_n 100001 int mod = 1e9 + 7; using namespace std; int main() { int n; cin >> n; long long total = 1; for (int i = 0; i < n; i++) ...
#include <algorithm> #include <climits> #include <cmath> #include <iostream> #include <map> #include <numeric> #include <stdlib.h> #include <utility> #include <vector> #define max_n 100001 long long mod = 1e9 + 7; using namespace std; int main() { int n; cin >> n; long long total = 1; for (int i = 0; i < n;...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 0, 30, 0, 43, 39, 86, 0, 96], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
162
#include <bits/stdc++.h> using namespace std; #define online_judge \ freopen("input.txt", "r", stdin); \ freopen("output.txt", "w", stdout); #define fastio ...
#include <bits/stdc++.h> using namespace std; #define online_judge \ freopen("input.txt", "r", stdin); \ freopen("output.txt", "w", stdout); #define fastio ...
[["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 25], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 12, 22]]
1
546
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll MOD = 1000000007; ll n; cin >>...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll MOD = 1000000007; ll n; cin >>...
[["+", 0, 43, 49, 50, 51, 16, 12, 16, 17, 48], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 12, 13]]
1
170
N = gets.to_i # $stdout = File.open(File::NULL, "w") def main max = 10 ** 9 + 7 all = 1 zero = 1 nine = 1 zn = 1 N.times.each do all = all * 10 % max zero = zero * 9 % max nine = nine * 9 % max zn = zn * 8 % max end return all - zero - nine + zn end STDOUT.puts main
N = gets.to_i # $stdout = File.open(File::NULL, "w") def main max = 10 ** 9 + 7 all = 1 zero = 1 nine = 1 zn = 1 N.times.each do all = all * 10 % max zero = zero * 9 % max nine = nine * 9 % max zn = zn * 8 % max end return (all - zero - nine + zn) % max end STDOUT.puts main
[["+", 0, 38, 0, 4, 0, 738, 31, 739, 0, 24], ["+", 0, 38, 0, 4, 0, 738, 31, 739, 0, 25], ["+", 8, 736, 0, 38, 0, 4, 0, 738, 17, 109], ["+", 8, 736, 0, 38, 0, 4, 0, 738, 12, 22]]
4
75
#include <iostream> using namespace std; using ll = long long int; ll modpow(ll a, ll b); ll key = 1000000007; int main() { ll n; cin >> n; ll ans = modpow(10, n) - modpow(9, n) * 2 + modpow(8, n); if (ans >= 0) { cout << ans % key; } else { cout << (ans + key * 2) / key; } return 0; } ll modpow(...
#include <iostream> using namespace std; using ll = long long int; ll modpow(ll a, ll b); ll key = 1000000007; int main() { ll n; cin >> n; ll ans = modpow(10, n) - modpow(9, n) * 2 + modpow(8, n); if (ans >= 0) { cout << ans % key; } else { cout << (ans + key * 2) % key; } return 0; } ll modpow(...
[["-", 0, 9, 0, 1, 0, 16, 12, 16, 17, 85], ["+", 0, 9, 0, 1, 0, 16, 12, 16, 17, 109]]
1
142
def solve(): N = int(input()) MOD = 10**9+7 U = pow(10,N,MOD) inc_zero = U - pow(9,N,MOD) inc_nine = inc_zero inc_both = U - pow(8,N,MOD) print(inc_zero+inc_nine-inc_both % MOD) if __name__ == '__main__': solve()
def solve(): N = int(input()) MOD = 10**9+7 U = pow(10,N,MOD) inc_zero = U - pow(9,N,MOD) inc_nine = inc_zero inc_both = U - pow(8,N,MOD) print((inc_zero+inc_nine-inc_both) % MOD) if __name__ == '__main__': solve()
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 25]]
5
77
# coding:utf-8 import sys import math import time #import numpy as np import collections from collections import deque from collections import Counter import queue import copy import bisect import heapq import itertools #sys.setrecursionlimit(10**7) #N, Q = map(int, input().split()) #G = [list(input()) for i in rang...
# coding:utf-8 import sys import math import time #import numpy as np import collections from collections import deque from collections import Counter import queue import copy import bisect import heapq import itertools #sys.setrecursionlimit(10**7) #N, Q = map(int, input().split()) #G = [list(input()) for i in rang...
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
133
""" こんにちは。これはクシャルです Author : thekushalghosh (クシャル) Team : CodeDiggers I prefer Python language over the C++ language :p :D Visit my website : thekushalghosh.github.io """ import sys,math,cmath,time start_time = time.time() ###########################################################...
""" こんにちは。これはクシャルです Author : thekushalghosh (クシャル) Team : CodeDiggers I prefer Python language over the C++ language :p :D Visit my website : thekushalghosh.github.io """ import sys,math,cmath,time start_time = time.time() ###########################################################...
[["-", 0, 652, 3, 4, 0, 657, 31, 23, 0, 25], ["+", 31, 23, 0, 657, 12, 652, 3, 4, 0, 25]]
5
641
#include <iostream> using namespace std; const int MOD = 1000000007; int main(void) { // Your code here! int N; cin >> N; long long K = 1, L = 1, M = 1; for (int i = 1; i <= N; i++) { K *= 10, L *= 9, M *= 8; K = K % MOD, L = L % MOD, M = M % MOD; } long long ans = K - 2 * L + M; ans = ans ...
#include <iostream> using namespace std; const long long MOD = 1000000007; int main(void) { // Your code here! int N; cin >> N; long long K = 1, L = 1, M = 1; for (int i = 1; i <= N; i++) { K *= 10, L *= 9, M *= 8; K = K % MOD, L = L % MOD, M = M % MOD; } long long ans = K - 2 * L + M + 2 * M...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 0, 30, 0, 43, 39, 86, 0, 96], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 31, 13], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 17, 48], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 12, 22]]
1
114
#include "queue" #include <algorithm> #include <cctype> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <math.h> #include <queue> #include <set> #include <stdlib.h> #include <string> #include <vector> #define inf 107374182 #define M 10010001 #define ll long long #define PII pair<int...
#include "queue" #include <algorithm> #include <cctype> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <math.h> #include <queue> #include <set> #include <stdlib.h> #include <string> #include <vector> #define inf 107374182 #define M 10010001 #define ll long long #define PII pair<int...
[["+", 31, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 31, 16, 31, 23, 0, 16, 31, 16, 12, 22]]
1
213
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; int main() { const ll mod = 1000000007; ll n; cin >> n; int i; if (n == 1) { cout << 0 << endl; return 0; } ll a = 1, b = 1, c = 1; for (i = 0; i < n; i++) { a = a * 10 % mod; b = b * 9 % mod; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; int main() { const ll mod = 1000000007; ll n; cin >> n; ll i; if (n == 1) { cout << 0 << endl; return 0; } ll a = 1, b = 1, c = 1; for (i = 0; i < n; i++) { a = a * 10 % mod; b = b * 9 % mod; ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 31, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 72], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 12, 22], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 72]]
1
164
import java.io.DataInputStream; import java.io.FileInputStream; import java.io.IOException; import java.io.PrintWriter; public class Main { static class Reader { final private int BUFFER_SIZE = 1 << 16; private DataInputStream din; private byte[] buffer; private int bufferPointer, bytesRead; pub...
import java.io.DataInputStream; import java.io.FileInputStream; import java.io.IOException; import java.io.PrintWriter; public class Main { static class Reader { final private int BUFFER_SIZE = 1 << 16; private DataInputStream din; private byte[] buffer; private int bufferPointer, bytesRead; pub...
[["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 25], ["+", 0, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 0, 16, 31, 23, 0, 16, 31, 16, 12, 22], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 17, 72], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 12, 22]]
3
809
#coding:utf-8 N = int(input()) ron = 10 ** 9 + 7 a = (10 ** N) % ron b = (9 ** N) % ron c = (9 ** N) % ron bandc = (8 ** N) % ron ans = a - b - c + bandc print("{}".format(ans))
#coding:utf-8 N = int(input()) ron = 10 ** 9 + 7 a = (10 ** N) % ron b = (9 ** N) % ron c = (9 ** N) % ron bandc = (8 ** N) % ron ans = (a - b - c + bandc) % ron print("{}".format(ans))
[["+", 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
72
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define all(v) v.begin(), v.end() using ll = long long; const int inf = int(1e10); // const ll inf = ll(1e19); const int mod = int(1e9) + 7; // a^nの計算(mod) ll modpow(ll a, ll n, ll mod) { ll res = 1; while (n > 0) { if ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define all(v) v.begin(), v.end() using ll = long long; const int inf = int(1e10); // const ll inf = ll(1e19); const int mod = int(1e9) + 7; // a^nの計算(mod) ll modpow(ll a, ll n, ll mod) { ll res = 1; while (n > 0) { if ...
[["-", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["+", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46]]
1
175
n = int(input()) def modpow(a, n, mod): res = 1 while n > 0: if n & 1: res = res * a % mod a = a * a % mod n >>= 1 return res mod = 1000000007 ans = modpow(10, n, mod) - (modpow(9, n, mod) + modpow(9, n, mod) - modpow(8, n, mod)) print(ans)
n = int(input()) def modpow(a, n, mod): res = 1 while n > 0: if n & 1: res = res * a % mod a = a * a % mod n >>= 1 return res mod = 1000000007 ans = modpow(10, n, mod) - (modpow(9, n, mod) + modpow(9, n, mod) - modpow(8, n, mod)) ans = ans % mod 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
96
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<long long> vl; #define pll pair<ll, ll> #define vpl vector<pll> #define vb vector<bool> #define PB push_back #define MP make_pair #define ln "\n" #define forn(i, e) for (ll i = 0; i < e; i++) #define forsn(i, s, e) for (ll i = s; i < e; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<long long> vl; #define pll pair<ll, ll> #define vpl vector<pll> #define vb vector<bool> #define PB push_back #define MP make_pair #define ln "\n" #define forn(i, e) for (ll i = 0; i < e; i++) #define forsn(i, s, e) for (ll i = s; i < e; ...
[["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 72], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 22]]
1
426
import sys from collections import defaultdict, Counter, namedtuple, deque import itertools import functools import bisect import heapq import math import copy # from fractions import gcd MOD = 10 ** 9 + 7 # MOD = 998244353 # sys.setrecursionlimit(10**8) n = int(input()) a = pow(9, n, MOD) b = pow(8, n, MOD) c = pow(...
import sys from collections import defaultdict, Counter, namedtuple, deque import itertools import functools import bisect import heapq import math import copy # from fractions import gcd MOD = 10 ** 9 + 7 # MOD = 998244353 # sys.setrecursionlimit(10**8) n = int(input()) a = pow(9, n, MOD) b = pow(8, n, MOD) c = pow(...
[["+", 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
82
n = int(input()) mod = 10**9 + 7 ans = 10**n % mod ans -= (2 * 9**n) % mod ans += (8**n) % mod print(ans)
n = int(input()) mod = 10**9 + 7 ans = 10**n % mod ans -= (2 * 9**n) % mod ans += (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
46
#include <bits/stdc++.h> typedef long long ll; #define ALL(l) (l).begin(), (l).end() #define rep(i, n) for (ll(i) = 0; (i) < (n); (i)++) #define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++) using namespace std; // const ll mod = 1000000007; // const ll maxn = 1000000000; //---------------------------------------...
#include <bits/stdc++.h> typedef long long ll; #define ALL(l) (l).begin(), (l).end() #define rep(i, n) for (ll(i) = 0; (i) < (n); (i)++) #define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++) using namespace std; // const ll mod = 1000000007; // const ll maxn = 1000000000; //---------------------------------------...
[["+", 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, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
227
#include <bits/stdc++.h> using namespace std; //#pragma gcc optimize("O3,unroll-loop") //#pragma gcc //target("sse,sse2,sse3,ssse3,sse4,avx,avx2,fma,abm,mmx,popcnt,tune=native") #define int long long //#define double long double #define MOD 1000000007 int fpow(int a, int b) { int ret = 1; while (b) { if (b & ...
#include <bits/stdc++.h> using namespace std; //#pragma gcc optimize("O3,unroll-loop") //#pragma gcc //target("sse,sse2,sse3,ssse3,sse4,avx,avx2,fma,abm,mmx,popcnt,tune=native") #define int long long //#define double long double #define MOD 1000000007LL int fpow(int a, int b) { int ret = 1; while (b) { if (b ...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59]]
1
149
# coding: utf-8 #a, b, c, d = map(int,input().split()) n=int(input()) ans=1 MOD=10**9+7 a=1 b=1 c=1 for i in range(n): a*=10 a%=MOD c*=8 c%=MOD for i in range(n): b*=9 b%=MOD print(a-b*2+c)
# coding: utf-8 #a, b, c, d = map(int,input().split()) n=int(input()) ans=1 MOD=10**9+7 a=1 b=1 c=1 for i in range(n): a*=10 a%=MOD c*=8 c%=MOD for i in range(n): b*=9 b%=MOD print((a-b*2+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
73
#include <cmath> #include <iomanip> #include <iostream> using namespace std; using ll = long long; const long double PI = acos(-1.0); const ll MOD = 1e9 + 7; int main() { int n; cin >> n; ll eight = 1; ll nine = 1; ll ten = 1; for (int i = 0; i < n; i++) { eight = (eight * 8) % MOD; nine = (nine...
#include <cmath> #include <iomanip> #include <iostream> using namespace std; using ll = long long; const long double PI = acos(-1.0); const ll MOD = 1e9 + 7; int main() { int n; cin >> n; ll eight = 1; ll nine = 1; ll ten = 1; for (int i = 0; i < n; i++) { eight = (eight * 8) % MOD; nine = (nine...
[["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 72], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 22]]
1
134
#C N=int(input()) mod=10**9+7 ans=pow(10,N,mod)-2*pow(9,N,mod)+pow(8,N,mod) print(ans)
#C N=int(input()) mod=10**9+7 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
#C - Ubiquity import math N = int(input()) a = 10**9+7 ans = (10**N)-(9**N - 8**N) # def combinations_count(n, r): # return math.factorial(n)%a // (math.factorial(n - r)%a * math.factorial(r))%a # # ans =(10**(N-2))%a*(combinations_count(N, 2)*2)%a-combinations_count(N, 2)%a print(ans%a)
#C - Ubiquity import math N = int(input()) a = 10**9+7 ans = (10**N)-(2*9**N - 8**N) # def combinations_count(n, r): # return math.factorial(n)%a // (math.factorial(n - r)%a * math.factorial(r))%a # # ans =(10**(N-2))%a*(combinations_count(N, 2)*2)%a-combinations_count(N, 2)%a print(ans%a)
[["+", 12, 657, 12, 23, 0, 657, 31, 657, 31, 612], ["+", 12, 657, 12, 23, 0, 657, 31, 657, 17, 48]]
5
45
n = int(input()) mod = 10**9 + 7 print((10**n % mod - (2*(9**n)) % mod + (8**n) % mod) )
n = int(input()) mod = 10**9 + 7 print((10**n - (2*(9**n)) + (8**n) ) % mod )
[["-", 0, 23, 0, 657, 31, 657, 31, 657, 17, 109], ["-", 0, 23, 0, 657, 31, 657, 31, 657, 12, 22], ["-", 0, 23, 0, 657, 31, 657, 12, 657, 17, 109], ["-", 0, 23, 0, 657, 31, 657, 12, 657, 12, 22], ["+", 0, 657, 31, 23, 0, 657, 12, 23, 0, 25], ["-", 0, 1, 0, 652, 3, 4, 0, 23, 0, 25]]
5
45
M = 10**9+7 N = int(input()) print(pow(10,N,M)-pow(9,N,M)-pow(9,N,M)+pow(8,N,M))
M = 10**9+7 N = int(input()) print((pow(10,N,M)-pow(9,N,M)-pow(9,N,M)+pow(8,N,M))%M)
[["+", 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 = int(input()) mod = 10 ** 9 + 7 ans=(10**N)%mod-(9**N)%mod-(9**N)%mod+(8**N)%mod print(ans)
N = int(input()) mod = 10 ** 9 + 7 ans=(10**N)%mod-(9**N)%mod-(9**N)%mod+(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
52
N = int(input()) MOD = 10**9 + 7 if N==1: print(0) elif N==2: print(2) else: ans = pow(10,N,MOD) - 2*pow(9,N,MOD) + pow(8,N,MOD) print(ans)
N = int(input()) MOD = 10**9 + 7 if N==1: print(0) elif N==2: print(2) else: ans = pow(10,N,MOD) - 2*pow(9,N,MOD) + pow(8,N,MOD) ans = ans%MOD print(ans)
[["+", 75, 76, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 75, 76, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 109], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 22]]
5
69
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (long long 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; ret...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (long long 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; ret...
[["+", 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
236
#include <algorithm> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, n) for (int i = (n)-1; i >= 0; i--) #define FOR(i, a, b) for (...
#include <algorithm> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, n) for (int i = (n)-1; i >= 0; i--) #define FOR(i, a, b) for (...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
207
#include <bits/stdc++.h> using namespace std; #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define MAXX 1...
#include <bits/stdc++.h> using namespace std; #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define MAXX 1...
[["+", 12, 16, 31, 23, 0, 16, 31, 23, 0, 24], ["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 25]]
1
130
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int64_t a = 1; int64_t b = 1; int64_t c = 1; for (int i = 0; i < N; i++) { a *= 10; a %= 1000000007; b *= 8; b %= 1000000007; c *= 9; c %= 1000000007; } int64_t d; d = 2 * c; d %= 1000000007; int6...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int64_t a = 1; int64_t b = 1; int64_t c = 1; for (int i = 0; i < N; i++) { a *= 10; a %= 1000000007; b *= 8; b %= 1000000007; c *= 9; c %= 1000000007; } int64_t d; d = 2 * c; d %= 1000000007; int6...
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 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, 13]]
1
104
N = int(input()) MOD = 10**9 + 7 ans = pow(10, N, MOD) - (2*pow(9, N, MOD) - pow(8, N, MOD)) print(ans)
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, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
51
// Submitted By Subhash Yadav import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigDecimal; import java.math.BigInteger; import java.math.RoundingMode; import java.text.DecimalFormat; import java.util.*; public class Main { sta...
// Submitted By Subhash Yadav import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigDecimal; import java.math.BigInteger; import java.math.RoundingMode; import java.text.DecimalFormat; import java.util.*; public class Main { sta...
[["+", 51, 16, 31, 23, 0, 16, 12, 16, 31, 499], ["+", 51, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
3
397
#pragma region Macros #include <bits/stdc++.h> using namespace std; using ll = long long; #define REP2(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; ++i) #define REP3(i, l, r) for (int i = (l), i##_len = (int)(r); i < i##_len; ++i) #define GET_MACRO_REP(_1, _2, _3, NAME, ...) NAME #define REP(...) GET_MACRO_...
#pragma region Macros #include <bits/stdc++.h> using namespace std; using ll = long long; #define REP2(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; ++i) #define REP3(i, l, r) for (int i = (l), i##_len = (int)(r); i < i##_len; ++i) #define GET_MACRO_REP(_1, _2, _3, NAME, ...) NAME #define REP(...) GET_MACRO_...
[["+", 12, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 16, 12, 16, 31, 23, 0, 25], ["+", 0, 11, 12, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 11, 12, 16, 31, 16, 12, 16, 12, 22]]
1
323
n=int(input()) modd=1000000007 if(n<=2): ans=0 else: ans=(modd+pow(10,n,modd)-pow(9,n,modd)*2+pow(8,n,modd))%modd print(ans)
n=int(input()) modd=1000000007 if(n<2): ans=0 else: ans=(modd+pow(10,n,modd)-pow(9,n,modd)*2+pow(8,n,modd))%modd print(ans)
[["-", 0, 656, 0, 57, 15, 23, 0, 666, 667, 19], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 667, 18]]
5
63
""" C """ import sys import math from functools import reduce from bisect import bisect_left def readString(): return sys.stdin.readline() def readInteger(): return int(readString()) def readStringSet(n): return sys.stdin.readline().split(" ")[:n] def readIntegerSet(n): return list(map(int, readStri...
""" C """ import sys import math from functools import reduce from bisect import bisect_left def readString(): return sys.stdin.readline() def readInteger(): return int(readString()) def readStringSet(n): return sys.stdin.readline().split(" ")[:n] def readIntegerSet(n): return list(map(int, readStri...
[["+", 0, 14, 8, 196, 0, 37, 0, 657, 17, 109], ["+", 0, 14, 8, 196, 0, 37, 0, 657, 12, 22]]
5
202
N = int(input()) a = (10**N*+8**N-2*(9**N))%((10**9)+7) print(a)
N = int(input()) a = (10**N+8**N-2*(9**N))%((10**9)+7) print(a)
[["-", 12, 657, 31, 23, 0, 657, 31, 657, 17, 48]]
5
42
#include <bits/stdc++.h> using namespace std; /*#include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; s.find_by_order(x) xth element in set x.order_of_key(x) number of elements <x*/ #define ll lon...
#include <bits/stdc++.h> using namespace std; /*#include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; s.find_by_order(x) xth element in set x.order_of_key(x) number of elements <x*/ #define ll lon...
[["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 25], ["+", 0, 9, 0, 43, 49, 50, 51, 16, 17, 109], ["+", 0, 9, 0, 43, 49, 50, 51, 16, 12, 13]]
1
292
#include <bits/stdc++.h> using namespace std; // NOT TO SUBMIT IN WRONG PLACE OR BY WRONG COMPILER // ABC 178, task c, 2020/09/13 // ms, /* */ #define LAW 1000000007 int main(void) { int N; unsigned long long ten_pow, nine_pow, h_pow, ans; cin >> N; ten_pow = 1; nine_pow = 1; h_pow = 1; for (int i = 0...
#include <bits/stdc++.h> using namespace std; // NOT TO SUBMIT IN WRONG PLACE OR BY WRONG COMPILER // ABC 178, task c, 2020/09/13 // ms, /* */ #define LAW 1000000007 int main(void) { int N; unsigned long long ten_pow, nine_pow, h_pow, ans; cin >> N; ten_pow = 1; nine_pow = 1; h_pow = 1; for (int i = 0...
[["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 72], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22], ["+", 12, 16, 31, 23, 0, 16, 12, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 17, 109], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 12, 22], ["+", 12, 16, 31, 23, 0, 16, 12, 23, 0, 25]]
1
116
import sys N = int(input()) if N == 1: print(0) sys.exit(0) if N == 2: print(1) sys.exit(0) # out = (N * (N - 1) * (10 ** (N - 2))) % ((10 ** 9) + 7) out = ((10 ** N) - ((9 ** N) * 2 - (8 ** N))) % ((10 ** 9) + 7) print(out)
import sys N = int(input()) if N == 1: print(0) sys.exit(0) if N == 2: print(2) sys.exit(0) # out = (N * (N - 1) * (10 ** (N - 2))) % ((10 ** 9) + 7) out = ((10 ** N) - ((9 ** N) * 2 - (8 ** N))) % ((10 ** 9) + 7) print(out)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
80
#include <bits/stdc++.h> using namespace std; #define ll long long int #define m 1000000007 ll binpow(ll a, ll b, ll mod) { ll res = 1; for (ll i = 1; i <= b; i++) { res = (((res + mod) * a) + mod) % mod; } return res; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll x; cin >> ...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define m 1000000007 ll binpow(ll a, ll b, ll mod) { ll res = 1; for (ll i = 1; i <= b; i++) { res = (((res + mod) * a) + mod) % mod; } return res; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll x; cin >> ...
[["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13]]
1
223
from sys import stdin def main(): input = stdin.readline N = int(input()) mod = (10 ** 9) +7 ans = 0 ans = pow(10,N,mod) - pow(8,N,mod) - (pow(9,N,mod) - pow(8,N,mod))*2 print(ans) if __name__ == "__main__": main()
from sys import stdin def main(): input = stdin.readline N = int(input()) mod = (10 ** 9) +7 ans = 0 ans = pow(10,N,mod) - pow(8,N,mod) - (pow(9,N,mod) - pow(8,N,mod))*2 ans %= mod print(ans) if __name__ == "__main__": main()
[["+", 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
89
#include <bits/stdc++.h> using namespace std; long long modpow(long long a, long long n, long long mod) { long long res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } int main() { long N, zyouken; cin >> N; zyouken = modpow(10, N, 100000000...
#include <bits/stdc++.h> using namespace std; long long modpow(long long a, long long n, long long mod) { long long res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } int main() { long N, zyouken; cin >> N; zyouken = modpow(10, N, 100000000...
[["-", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89]]
1
139
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; long int a = 1, b = 1, c = 2; for (int i = 0; i < N; i++) { a *= 10; b *= 8; c *= 9; a %= 1000000007; b %= 1000000007; c %= 1000000007; } cout << a + b - c << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; long int a = 1, b = 1, c = 2; for (int i = 0; i < N; i++) { a *= 10; b *= 8; c *= 9; a %= 1000000007; b %= 1000000007; c %= 1000000007; } cout << (1000000007 + a + b - c) % 1000000007 << endl; }
[["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 16, 31, 16, 31, 13], ["+", 31, 23, 0, 16, 31, 16, 31, 16, 17, 72], ["+", 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, 13]]
1
83
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)n; i++) int main() { long N; long PRIME = (long)1e9 + 7; cin >> N; vector<vector<int>> dp(N + 1, vector<int>(4, 0)); // 0 none // 1 only 0 // 2 only 9 // 3 both dp[0][0] = 1; dp[0][1] = 0; dp[0][2] = 0; dp[...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)n; i++) int main() { long N; long PRIME = (long)1e9 + 7; cin >> N; vector<vector<long>> dp(N + 1, vector<long>(4, 0)); // 0 none // 1 only 0 // 2 only 9 // 3 both dp[0][0] = 1; dp[0][1] = 0; dp[0][2] = 0; d...
[["-", 0, 77, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 39, 344, 3, 347, 0, 77, 39, 86, 0, 96], ["-", 0, 2, 63, 346, 3, 347, 0, 77, 39, 40], ["+", 63, 346, 3, 347, 0, 77, 39, 86, 0, 96]]
1
397
#include <bits/stdc++.h> using namespace std; #define ll long long #define mod 1000000007 ll subtraction_modulo(ll x, ll y) { return (((x - y) % mod) + mod) % mod; } long long power(long long int x, long long int y, long long p) { long long res = 1; // Initialize result x = x % p; // Update x if it is more than ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define mod 1000000007 ll subtraction_modulo(ll x, ll y) { return (((x - y) % mod) + mod) % mod; } long long power(long long int x, long long int y, long long p) { long long res = 1; // Initialize result x = x % p; // Update x if it is more than ...
[["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22]]
1
258
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; #define rep(i, n) for (int i = 0; i < n; i++) #define UNIQUE(v) \ v.erase(unique(v.begin(), v.end()), v.end()) // sortしてから使う #define INF 2147483647 #define LLINF...
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; #define rep(i, n) for (int i = 0; i < n; i++) #define UNIQUE(v) \ v.erase(unique(v.begin(), v.end()), v.end()) // sortしてから使う #define INF 2147483647 #define LLINF...
[["+", 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], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
158
#include <bits/stdc++.h> #include <iostream> #include <unordered_map> #include <unordered_set> #define pb push_back #define mpr make_pair #define pii pair<int, int> #define pll pair<ll, ll> #define ll long long #define ld long double #define fi first #define se second #define all(arr) arr.begin(), arr.end() #define rep...
#include <bits/stdc++.h> #include <iostream> #include <unordered_map> #include <unordered_set> #define pb push_back #define mpr make_pair #define pii pair<int, int> #define pll pair<ll, ll> #define ll long long #define ld long double #define fi first #define se second #define all(arr) arr.begin(), arr.end() #define rep...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13]]
1
667
#include <bits/stdc++.h> #define sz(x) (int)((x).size()) #define F first #define S second #define pb push_back #define ub upper_bound #define lb lower_bound #define all(x) x.begin(), x.end() #define pqueue priority_queue #define Speed() \ ios_base::sync_w...
#include <bits/stdc++.h> #define sz(x) (int)((x).size()) #define F first #define S second #define pb push_back #define ub upper_bound #define lb lower_bound #define all(x) x.begin(), x.end() #define pqueue priority_queue #define Speed() \ ios_base::sync_w...
[["+", 0, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 16, 12, 16, 31, 23, 0, 16, 12, 22]]
1
405
import java.util.*; public class Main { final long MOD = 1000000007; void solve() { Scanner scan = new Scanner(System.in); long n = scan.nextInt(); System.out.println((pow(10, n) - 2 * pow(9, n) + pow(8, n)) % MOD); } long pow(long x, long n) { if (n == 0) return 1; long ret = pow(x ...
import java.util.*; public class Main { final long MOD = 1000000007; void solve() { Scanner scan = new Scanner(System.in); long n = scan.nextInt(); System.out.println((pow(10, n) - (2 * pow(9, n)) % MOD + pow(8, n)) % MOD); } long pow(long x, long n) { if (n == 0) return 1; long ret ...
[["+", 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], ["+", 64, 1, 0, 11, 12, 16, 31, 16, 12, 22], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 72]]
3
156
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define pb push_back #define pob pop_back #define ff first #define ss second #define endl "\n" #define all(a) a.begin(), a.end() #define int long long #define ordered_set ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define pb push_back #define pob pop_back #define ff first #define ss second #define endl "\n" #define all(a) a.begin(), a.end() #define int long long #define ordered_set ...
[["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
479
#include <ctime> #include <iostream> using namespace std; void solve() { int N; cin >> N; if (N == 1) { cout << 0 << endl; return; } else if (N == 2) { cout << 2 << endl; return; } const int MOD = 1000000007; long long ten = 1, nine = 1, eight = 1; for (int i = 0; i < N; ++i) ten =...
#include <ctime> #include <iostream> using namespace std; void solve() { int N; cin >> N; if (N == 1) { cout << 0 << endl; return; } else if (N == 2) { cout << 2 << endl; return; } const int MOD = 1000000007; long long ten = 1, nine = 1, eight = 1; for (int i = 0; i < N; ++i) ten =...
[["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 72], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 22], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 22]]
1
214
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, a, b) for (int i = a; i < b; i++) #define repn(i, a, b) for (int i = a; i >= b; i--) #define MOD 1000000007 ll poweMOD(ll a, ll n) { if (n == 0) return 1; else { ll tmp = poweMOD(a, n / 2) % MOD; if (n % 2 == 0) r...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, a, b) for (int i = a; i < b; i++) #define repn(i, a, b) for (int i = a; i >= b; i--) #define MOD 1000000007 ll poweMOD(ll a, ll n) { if (n == 0) return 1; else { ll tmp = poweMOD(a, n / 2) % MOD; if (n % 2 == 0) r...
[["+", 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
176
N=int(input()) ans=0 NUM=7+10**9 if N==1: ans=0 else: a=10**N%NUM b=9**N%NUM b*=2 c=8**N%NUM ans=a-b+c print(ans)
N=int(input()) ans=0 NUM=7+10**9 if N==1: ans=0 else: a=10**N%NUM b=9**N%NUM b*=2 c=8**N%NUM ans=a-b+c ans%=NUM print(ans)
[["+", 75, 76, 8, 196, 0, 1, 0, 677, 31, 22], ["+", 75, 76, 8, 196, 0, 1, 0, 677, 17, 132], ["+", 75, 76, 8, 196, 0, 1, 0, 677, 12, 22]]
5
63
#include <iostream> #include <math.h> using namespace std; int main() { long long a, b, c, N; a = 1; b = 1; c = 1; N = 0; cin >> N; for (int i = 0; i < N; i++) { a *= 8; b *= 9; c *= 10; a %= 1000000007; b %= 1000000007; c %= 1000000007; } if (c - (2 * b - a) < 0) { cout <...
#include <iostream> #include <math.h> using namespace std; int main() { long long a, b, c, N; a = 1; b = 1; c = 1; N = 0; cin >> N; for (int i = 0; i < N; i++) { a *= 8; b *= 9; c *= 10; a %= 1000000007; b %= 1000000007; c %= 1000000007; } if (c - (2 * b - a) <= 0) { cout ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 31, 16, 12, 23, 0, 16, 31, 16, 17, 109], ["+", 31, 16, 12, 23, 0, 16, 31, 16, 12, 13], ["+", 0, 16, 12, 23, 0, 16, 31, 16, 17, 109], ["+", 0, 16, 12, 23, 0, 16, 31, 16, 12, 13]]
1
140
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #define mid ((l + r) >> 1) using namespace std; const long long MOD = 1e9 + 7; long long qpow(long long a, int k) { long long ans = 1; while (k) { if (k & 1) { ans = (ans * a) % MOD; } a = (a * a) % MOD; k >>= 1; ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #define mid ((l + r) >> 1) using namespace std; const long long MOD = 1e9 + 7; long long qpow(long long a, int k) { long long ans = 1; while (k) { if (k & 1) { ans = (ans * a) % MOD; } a = (a * a) % MOD; k >>= 1; ...
[["+", 31, 23, 0, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 12, 22]]
1
207
N = int(input()) mod = 10 ** 9 + 7 A = pow(10, N, mod) B = pow(9, N, mod) C = pow(8, N, mod) A = A - (2 * B - C) if A < 0: A = A + mod print(A)
N = int(input()) mod = 10 ** 9 + 7 A = pow(10, N, mod) B = pow(9, N, mod) C = pow(8, N, mod) A = A - (2 * B - C) A %= mod if A < 0: A = A + mod print(A)
[["+", 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
70
#include <bits/stdc++.h> using namespace std; using ll = long long; ll modPow(ll a, ll n, ll mod) { ll res = 1; for (ll i = 0; i < n; ++i) { res *= a; res %= mod; } return res; } int main() { const ll mod = 1e9 + 7; ll N; cin >> N; ll x1 = modPow(10, N, mod); ll x2 = 2 * modPow(9, N, mod); ...
#include <bits/stdc++.h> using namespace std; using ll = long long; ll modPow(ll a, ll n, ll mod) { ll res = 1; for (ll i = 0; i < n; ++i) { res *= a; res %= mod; } return res; } int main() { const ll mod = 1e9 + 7; ll N; cin >> N; ll x1 = modPow(10, N, mod); ll x2 = 2 * modPow(9, N, mod); ...
[["+", 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
136
mod = 10**9 + 7 def modpow(x, n): res = 1 while n > 0: if n & 1 == 1: res = res*x%mod x = x*x%mod n >>= 1 return res N = int(input()) ans = modpow(10,N)-2*modpow(9,N)+modpow(8,N) print(ans)
mod = 10**9 + 7 def modpow(x, n): res = 1 while n > 0: if n & 1 == 1: res = res*x%mod x = x*x%mod n >>= 1 return res N = int(input()) ans = (modpow(10,N)-2*modpow(9,N)+modpow(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
85
#include <bits/stdc++.h> #include <ctime> using namespace std; #define bit(x, i) (x & (1 << i)) // select the bit of position i of x #define lowbit(x) ((x) & ((x) ^ ((x)-1))) // get the lowest bit of x #define hBit(msb, n) \ asm("bsrl %1,%0" ...
#include <bits/stdc++.h> #include <ctime> using namespace std; #define bit(x, i) (x & (1 << i)) // select the bit of position i of x #define lowbit(x) ((x) & ((x) ^ ((x)-1))) // get the lowest bit of x #define hBit(msb, n) \ asm("bsrl %1,%0" ...
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 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
654
#include <bits/stdc++.h> #define ll long long #define pll pair<ll, ll> #define pii pair<int, int> #define rep(i, a, b) for (int i = a; i <= b; ++i) #define per(i, a, b) for (int i = a; i >= b; --i) #define mem0(x) memset(x, 0, sizeof(x)) #define meminf(x) memset(x, 0x3f, sizeof(x)) #define VI vector<int> #define VL vec...
#include <bits/stdc++.h> #define ll long long #define pll pair<ll, ll> #define pii pair<int, int> #define rep(i, a, b) for (int i = a; i <= b; ++i) #define per(i, a, b) for (int i = a; i >= b; --i) #define mem0(x) memset(x, 0, sizeof(x)) #define meminf(x) memset(x, 0x3f, sizeof(x)) #define VI vector<int> #define VL vec...
[["+", 3, 4, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 3, 4, 0, 16, 31, 16, 31, 23, 0, 25], ["+", 31, 2, 3, 4, 0, 16, 31, 16, 17, 109], ["+", 31, 2, 3, 4, 0, 16, 31, 16, 12, 22], ["+", 12, 16, 31, 2, 3, 4, 0, 16, 17, 72], ["+", 12, 16, 31, 2, 3, 4, 0, 16, 12, 22]]
1
189
// // main.cpp // 앳코 // // Created by 김도훈 on 2020/09/13. // Copyright © 2020 김도훈. All rights reserved. // #include <iostream> using namespace std; int main() { int N; long long a = 1, b = 2, c = 1, ans; cin >> N; for (int i = 1; i <= N; i++) { a *= 10; b *= 9; c *= 8; a %= 1000000007; ...
// // main.cpp // 앳코 // // Created by 김도훈 on 2020/09/13. // Copyright © 2020 김도훈. All rights reserved. // #include <iostream> using namespace std; int main() { int N; long long a = 1, b = 2, c = 1, ans; cin >> N; for (int i = 1; i <= N; i++) { a *= 10; b *= 9; c *= 8; a %= 1000000007; ...
[["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 13]]
1
101
#include <bits/stdc++.h> #ifdef LOCAL #include "prabh.hpp" #endif #define int long long #define pb push_back #define range(v) v.begin(), v.end() #define rrange(v) v.rbegin(), v.rend() #define mod (int)(1e9 + 7) #define inf (int)(5e18) #define N (int)(2e5 + 10) using namespace std; void solve() { int n; cin >> n...
#include <bits/stdc++.h> #ifdef LOCAL #include "prabh.hpp" #endif #define int long long #define pb push_back #define range(v) v.begin(), v.end() #define rrange(v) v.rbegin(), v.rend() #define mod (int)(1e9 + 7) #define inf (int)(5e18) #define N (int)(2e5 + 10) using namespace std; void solve() { int n; cin >> n...
[["+", 31, 23, 0, 16, 31, 16, 12, 23, 0, 24], ["+", 31, 16, 12, 23, 0, 16, 31, 23, 0, 24], ["+", 31, 16, 12, 23, 0, 16, 31, 23, 0, 25], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 17, 109], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 12, 22], ["+", 31, 23, 0, 16, 31, 16, 12, 23, 0, 25]]
1
190
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long long int a = 1, b = 1, c = 1; for (int i = 0; i < n; i++) { a *= 10; b *= 9; c *= 8; a = a % 1000000007; b = b % 1000000007; c = c % 1000000007; } if ((a - 2 * b + c) >= 0) { cout << (a - 2 * b + c)...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long long int a = 1, b = 1, c = 1; for (int i = 0; i < n; i++) { a *= 10; b *= 9; c *= 8; a = a % 1000000007; b = b % 1000000007; c = c % 1000000007; } if ((a - 2 * b + c) >= 0) { cout << (a - 2 * b + c)...
[["-", 31, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 13]]
1
133
#include <bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<LL, LL> PII; // chmax, chmin template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } retur...
#include <bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<LL, LL> PII; // chmax, chmin template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } retur...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 14, 8, 9, 0, 43, 39, 344, 141, 78], ["+", 8, 9, 0, 43, 39, 344, 3, 347, 0, 18], ["+", 8, 9, 0, 43, 39, 344, 3, 347, 0, 47]]
1
1,700
N = int(input()) a = 10**9 + 7 tmp1 = 10**N %a tmp2 = 2*9**N %a tmp3 = 8**N %a answer = tmp1-tmp2+tmp3 %a print(answer)
N = int(input()) a = 10**9 + 7 tmp1 = 10**N %a tmp2 = 2*9**N %a tmp3 = 8**N %a answer = (tmp1-tmp2+tmp3) %a print(answer)
[["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 25]]
5
51
// tanzim bin nasir #include <bits/stdc++.h> typedef long long ll; #define ff first #define ss second using namespace std; void fast() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } int gcd(int a, int b) { if (b == 0) return a; else gcd(b, a % b); } ll lcd(ll a, ll b) { return (a * b)...
// tanzim bin nasir #include <bits/stdc++.h> typedef long long ll; #define ff first #define ss second using namespace std; void fast() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } int gcd(int a, int b) { if (b == 0) return a; else gcd(b, a % b); } ll lcd(ll a, ll b) { return (a * b)...
[["+", 31, 23, 0, 16, 31, 16, 12, 16, 31, 13], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 17, 48]]
1
222
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; long N10 = 1, N9 = 1, N8 = 1; for (int i = 0; i < N; i++) { N10 = (10 * N10) % 1000000007; N9 = (9 * N9) % 1000000007; N8 = (8 * N8) % 1000000007; } // M = 10^N - 2*9^N + 8^N // cout << M << endl; cout << (100000000...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; long N10 = 1, N9 = 1, N8 = 1; for (int i = 0; i < N; i++) { N10 = (10 * N10) % 1000000007; N9 = (9 * N9) % 1000000007; N8 = (8 * N8) % 1000000007; } // M = 10^N - 2*9^N + 8^N // cout << M << endl; cout << (2 * 10000...
[["+", 0, 16, 31, 16, 31, 16, 31, 16, 31, 13], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 17, 48]]
1
98
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; using ll = long long; using P = pair<int, int>; ll mod = 1e9 + 7; int nmod(int n, int k) { ll a = 1; for (int i = 0; i < n; i++) { a = (a * k) % mod; } return a; } int main() { ll n; cin >> n; ll ans; // a...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; using ll = long long; using P = pair<int, int>; ll mod = 1e9 + 7; int nmod(int n, int k) { ll a = 1; for (int i = 0; i < n; i++) { a = (a * k) % mod; } return a; } int main() { ll n; cin >> n; ll ans; // a...
[["+", 0, 11, 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
137
#include <stdio.h> int main() { long long a, x = 1, y = 1, z = 1; scanf("%lld", &a); for (int i = 0; i < a; i++) { x = (x * 10) % 1000000007; y = (y * 9) % 1000000007; z = (z * 8) % 1000000007; } long long ans = x % 1000000007; ans = (ans + 1000000007 - (2 * y)) % 1000000007; ans = (ans + z) ...
#include <stdio.h> int main() { long long a, x = 1, y = 1, z = 1; scanf("%lld", &a); for (int i = 0; i < a; i++) { x = (x * 10) % 1000000007; y = (y * 9) % 1000000007; z = (z * 8) % 1000000007; } long long ans = x % 1000000007; ans = (ans + 1000000007 - ((2 * y) % 1000000007)) % 1000000007; a...
[["+", 0, 16, 12, 23, 0, 16, 31, 23, 0, 24], ["+", 0, 16, 12, 23, 0, 16, 31, 23, 0, 25], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 17, 109], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 12, 13]]
1
126
#include <bits/stdc++.h> #define arep(a, i, n) for (ll i = (a); i < (n); i++) #define rep(i, n) for (ll i = 0; i < (n); i++) #define cinf(x, n) \ for (ll i = 0; i < (n); i++) \ cin >> x[i]; #define coutf(x,...
#include <bits/stdc++.h> #define arep(a, i, n) for (ll i = (a); i < (n); i++) #define rep(i, n) for (ll i = 0; i < (n); i++) #define cinf(x, n) \ for (ll i = 0; i < (n); i++) \ cin >> x[i]; #define coutf(x,...
[["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 12, 22], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72]]
1
148
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define ll long long int #define INF 1000000007 #define llINF 1000000000000000007 #define v(i) vector<i> #define vv(i) vector<vector<i>> #define Yes cout << "Yes" << endl; #define No cout << "No" << endl; #define YES cout << "Y...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define ll long long int #define INF 1000000007 #define llINF 1000000000000000007 #define v(i) vector<i> #define vv(i) vector<vector<i>> #define Yes cout << "Yes" << endl; #define No cout << "No" << endl; #define YES cout << "Y...
[["+", 0, 43, 49, 50, 51, 16, 31, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 12, 22], ["+", 49, 50, 51, 16, 12, 16, 31, 23, 0, 24], ["+", 49, 50, 51, 16, 12, 16, 31, 23, 0, 25], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 17, 109], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 12, 22]]
1
201
#include <bits/stdc++.h> #define M_PI 3.14159265358979323846 #define Speed_UP \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL)...
#include <bits/stdc++.h> #define M_PI 3.14159265358979323846 #define Speed_UP \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL)...
[["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 16, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 25], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 12, 22]]
1
191
a = 1000000007 n = input() not0 = 1 not0and9 = 1 all = 1 for i in range(n): not0and9 = (not0and9 * 8) % a not0 = (not0 * 9) % a all = (all * 10) % a; print((all + not0and9 - 2 * not9) % a)
a = 1000000007 n = int(input()) not0 = 1 not0and9 = 1 all = 1 for i in range(n): not0and9 = (not0and9 * 8) % a not0 = (not0 * 9) % a all = (all * 10) % a; print((all + not0and9 - 2 * not0) % a)
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25], ["-", 0, 657, 31, 23, 0, 657, 12, 657, 12, 22], ["+", 0, 657, 31, 23, 0, 657, 12, 657, 12, 22]]
5
67
#include <bits/stdc++.h> using namespace std; typedef long long ll; using pint = pair<int, int>; ll mod = 1000000007, mod2 = 998244353; int dx[4] = {-1, 0, 1, 0}; int dy[4] = {0, -1, 0, 1}; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; using pint = pair<int, int>; ll mod = 1000000007, mod2 = 998244353; int dx[4] = {-1, 0, 1, 0}; int dy[4] = {0, -1, 0, 1}; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> i...
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95]]
1
496
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
52
#include <algorithm> #include <iostream> #include <vector> using namespace std; #define ll long long int main() { ll n, ans = 1, nasi = 1, nasiz = 1; cin >> n; if (n == 1) cout << 0; else if (n == 2) cout << 2; else { for (ll i = 0; i < n; i++) { ans = ((ans * 10) % 1000000007); } fo...
#include <algorithm> #include <iostream> #include <vector> using namespace std; #define ll long long int main() { ll n, ans = 1, nasi = 1, nasiz = 1; cin >> n; if (n == 1) cout << 0; else if (n == 2) cout << 2; else { for (ll i = 0; i < n; i++) { ans = ((ans * 10) % 1000000007); } fo...
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
163
# region header import sys, bisect, math, itertools, heapq, collections from operator import itemgetter # a.sort(key=itemgetter(i)) # i番目要素でsort from functools import lru_cache import copy # @lru_cache(maxsize=None) # sys.setrecursionlimit(10**8) input = sys.stdin.readline INF = float('inf') mod = 10**9 + 7 eps = 10**-...
# region header import sys, bisect, math, itertools, heapq, collections from operator import itemgetter # a.sort(key=itemgetter(i)) # i番目要素でsort from functools import lru_cache import copy # @lru_cache(maxsize=None) # sys.setrecursionlimit(10**8) input = sys.stdin.readline INF = float('inf') mod = 10**9 + 7 eps = 10**-...
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 72]]
5
158
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author Mayank */ #include "bits/stdc++.h" #define ll long long #define rep(i, a, b) for (ll i = (a); i < (b); i++) using namespace std; const ll MOD = 1e9 + 7; ll modExp(ll a, ll b) { ll ret = 1; ll idx = 0; while (b ...
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author Mayank */ #include "bits/stdc++.h" #define ll long long #define rep(i, a, b) for (ll i = (a); i < (b); i++) using namespace std; const ll MOD = 1e9 + 7; ll modExp(ll a, ll b) { ll ret = 1; ll idx = 0; while (b ...
[["+", 0, 16, 31, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 16, 31, 16, 31, 16, 12, 16, 12, 22]]
1
265
#include <stdio.h> int main() { int n, i; scanf("%d", &n); long long int x10 = 1, x9 = 1, x8 = 1; for (i = 0; i < n; i++) { x10 = (10 * x10) % 1000000007; x9 = (9 * x9) % 1000000007; x8 = (8 * x8) % 1000000007; } printf("%lld", (x10 - 2 * x9 + x8) % 1000000007); return 0; }
#include <stdio.h> int main() { int n, i; scanf("%d", &n); long long int x10 = 1, x9 = 1, x8 = 1; for (i = 0; i < n; i++) { x10 = (10 * x10) % 1000000007; x9 = (9 * x9) % 1000000007; x8 = (8 * x8) % 1000000007; } printf("%lld", (x10 - 2 * x9 + x8 + 2 * 1000000007) % 1000000007); return 0; }
[["+", 3, 4, 0, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 0, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 0, 16, 31, 23, 0, 16, 12, 16, 12, 13]]
0
105
N = int(input()) if N == 1: print(0) elif N == 2: print(1) else: a = 10 ** 2 b = 2 * 9 ** 2 c = 8 ** 2 mod = 10 ** 9 + 7 ans = 0 for i in range(N-2): a = a * 10 % mod b = b * 9 % mod c = c * 8 % mod ans = a - b + c ans %= mod print(ans)
N = int(input()) if N == 1: print(0) elif N == 2: print(2) else: a = 10 ** 2 b = 2 * 9 ** 2 c = 8 ** 2 mod = 10 ** 9 + 7 ans = 0 for i in range(N-2): a = a * 10 % mod b = b * 9 % mod c = c * 8 % mod ans = a - b + c ans %= mod print(ans)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
100
#define _USE_MATH_DEFINES #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #i...
#define _USE_MATH_DEFINES #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #i...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 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]]
1
367
import java.io.*; import java.math.*; import java.util.*; public class Main { static long mod = (long)(1e9 + 7); public static void main(String[] args) { // Ball out /* * */ FastScanner I = new FastScanner(); // Input OutPut O = new OutPut(); // Output long N = I.nextLong(); long ...
import java.io.*; import java.math.*; import java.util.*; public class Main { static long mod = (long)(1e9 + 7); public static void main(String[] args) { // Ball out /* * */ FastScanner I = new FastScanner(); // Input OutPut O = new OutPut(); // Output long N = I.nextLong(); long ...
[["+", 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
1,017
#include <bits/stdc++.h> using namespace std; #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define test ...
#include <bits/stdc++.h> using namespace std; #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define test ...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
445
#include <algorithm> #include <cstdint> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> #define INF 1000000000 #define LLINF 2000000000000000000 #define MOD 1000000007 using namespace std; #define FOR(i, a, b) for (int i = a; i < b; i++) #define ...
#include <algorithm> #include <cstdint> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> #define INF 1000000000 #define LLINF 2000000000000000000 #define MOD 1000000007 using namespace std; #define FOR(i, a, b) for (int i = a; i < b; i++) #define ...
[["+", 0, 43, 49, 50, 51, 16, 12, 16, 31, 13], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 17, 48]]
1
217
package main import ( "fmt" ) func main() { var n int fmt.Scan(&n) if n == 1 { fmt.Println(0) return } totalComb := Pow(10, n%Mod) % Mod onlyOne := Pow(9, n%Mod) % Mod excludeBoth := onlyOne - Pow(8, n%Mod) % Mod ans := totalComb - onlyOne - excludeBoth if ans < 0 { ans += Mod } fmt.Println(ans) } ...
package main import ( "fmt" ) func main() { var n int fmt.Scan(&n) if n == 1 { fmt.Println(0) return } totalComb := Pow(10, n%Mod) % Mod onlyOne := Pow(9, n%Mod) % Mod excludeBoth := onlyOne - Pow(8, n%Mod)%Mod ans := (totalComb - onlyOne - excludeBoth) % Mod if ans < 0 { ans += Mod } fmt.Println(an...
[["+", 0, 431, 12, 432, 0, 16, 31, 23, 0, 24], ["+", 0, 431, 12, 432, 0, 16, 31, 23, 0, 25], ["+", 8, 196, 0, 431, 12, 432, 0, 16, 17, 109], ["+", 8, 196, 0, 431, 12, 432, 0, 16, 12, 22]]
7
193
// https://ei1333.github.io/luzhiled/ // http://beet-aizu.hatenablog.com/entry/2017/01/04/113233 // http://www.prefield.com/algorithm/ #include <bits/stdc++.h> constexpr char bn = '\n'; using namespace std; using ll = long long; using ld = long double; using vl = vector<ll>; using vd = vector<ld>; using vs = vector<str...
// https://ei1333.github.io/luzhiled/ // http://beet-aizu.hatenablog.com/entry/2017/01/04/113233 // http://www.prefield.com/algorithm/ #include <bits/stdc++.h> constexpr char bn = '\n'; using namespace std; using ll = long long; using ld = long double; using vl = vector<ll>; using vd = vector<ld>; using vs = vector<str...
[["+", 31, 23, 0, 16, 31, 16, 31, 16, 17, 72], ["+", 31, 23, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 12, 22]]
1
893
n=int(input()) c=10**9+7 def pow_c(x,n,c): if n == 0: return 1 K = 1 while n > 1: if n % 2 != 0: K= (K%c)*(x%c)%c x = ((x%c)**2)%c n //= 2 return (K%c) * (x%c) %c k10=pow_c(10,n,c) k9=pow_c(9,n,c) k8=pow_c(8,n,c) ans=(k10-2*k9+k8)%c
n=int(input()) c=10**9+7 def pow_c(x,n,c): if n == 0: return 1 K = 1 while n > 1: if n % 2 != 0: K= (K%c)*(x%c)%c x = ((x%c)**2)%c n //= 2 return (K%c) * (x%c) %c k10=pow_c(10,n,c) k9=pow_c(9,n,c) k8=pow_c(8,n,c) ans=(k10-2*k9+k8)%c print(ans)
[["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
135
#include <bits/stdc++.h> using namespace std; int n; typedef long long ll; #define MOD 1000000007 ll powr(ll x, ll p) { ll ans = 1; for (int i = 0; i < p; ++i) { ans *= x; ans %= MOD; } return ans; } int main() { scanf("%d", &n); ll ans = powr(10, n); ans -= powr(9, n); ans %= MOD; ans -= p...
#include <bits/stdc++.h> using namespace std; int n; typedef long long ll; #define MOD 1000000007 ll powr(ll x, ll p) { ll ans = 1; for (int i = 0; i < p; ++i) { ans *= x; ans %= MOD; } return ans; } int main() { scanf("%d", &n); ll ans = powr(10, n); ans += MOD - powr(9, n); ans %= MOD; an...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 110], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33]]
1
135
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mod = 1e9 + 7; ll modexp(ll x, ll n) { if (n == 0) { return 1; } ll tmp = modexp(x, n / 2); if (n % 2 == 0) { return (tmp * tmp) % mod; } else { return (((tmp * tmp) % mod) * x) % mod; } } int main() { ll n; ci...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mod = 1e9 + 7; ll modexp(ll x, ll n) { if (n == 0) { return 1; } ll tmp = modexp(x, n / 2); if (n % 2 == 0) { return (tmp * tmp) % mod; } else { return (((tmp * tmp) % mod) * x) % mod; } } int main() { ll n; ci...
[["+", 31, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 25], ["+", 0, 16, 31, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 16, 31, 16, 31, 16, 12, 16, 12, 22]]
1
143
#include "bits/stdc++.h" using namespace std; using ll = long long; using P = pair<int, int>; #define PI acos(-1) #define Mod (int)1000000007 #define INFTY (int)INT_MAX #define Rep(i, n) for (int i = 0; i < (int)(n); i++) #define BitRep(i, n) for (int i = 0; i < (int)(1 << n); i++) #define All(vec) vec.begin(), vec.end...
#include "bits/stdc++.h" using namespace std; using ll = long long; using P = pair<int, int>; #define PI acos(-1) #define Mod (int)1000000007 #define INFTY (int)INT_MAX #define Rep(i, n) for (int i = 0; i < (int)(n); i++) #define BitRep(i, n) for (int i = 0; i < (int)(1 << n); i++) #define All(vec) vec.begin(), vec.end...
[["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 25], ["+", 0, 9, 0, 43, 49, 50, 51, 16, 17, 109], ["+", 0, 9, 0, 43, 49, 50, 51, 16, 12, 22]]
1
317
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define eb emplace_back #define mp make_pair #define fi first #define se second const ll mod = 1e9 + 7; ll powmod(ll a, ll b) { ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1) res = res * a % ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define eb emplace_back #define mp make_pair #define fi first #define se second const ll mod = 1e9 + 7; ll powmod(ll a, ll b) { ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1) res = res * a % ...
[["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22]]
1
362
#include <iomanip> #include <iostream> using namespace std; void Main() { // input u_int64_t N; cin >> N; int64_t ans = 1; int64_t mod = 1000000000 + 7; // process int64_t tmp1 = 2; int64_t tmp2 = 1; for (u_int64_t i = 0; i < N; i++) { ans *= 10; ans %= mod; tmp1 *= 9; tmp1 %= mod;...
#include <iomanip> #include <iostream> using namespace std; void Main() { // input u_int64_t N; cin >> N; int64_t ans = 1; int64_t mod = 1000000000 + 7; // process int64_t tmp1 = 2; int64_t tmp2 = 1; for (u_int64_t i = 0; i < N; i++) { ans *= 10; ans %= mod; tmp1 *= 9; tmp1 %= mod;...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 108], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 107]]
1
154
#include <bits/stdc++.h> using namespace std; #define rep(i, a, n) for (int i = a; i < n; i++) // iをaからn #define per(i, a, n) for (int i = a - 1; i >= n; i--) // iをnからa #define db(x) cout << #x << " = " << x << endl #define db2(x, y) \ cout << "(" << #...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, n) for (int i = a; i < n; i++) // iをaからn #define per(i, a, n) for (int i = a - 1; i >= n; i--) // iをnからa #define db(x) cout << #x << " = " << x << endl #define db2(x, y) \ cout << "(" << #...
[["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 22]]
1
170