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
#include <bits/stdc++.h> // #include <atcoder/all> using namespace std; // using namespace atcoder; #define rp(i, k, n) for (int i = k; i < n; i++) using ll = long long; using ld = double; template <class T> inline bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <clas...
#include <bits/stdc++.h> // #include <atcoder/all> using namespace std; // using namespace atcoder; #define rp(i, k, n) for (int i = k; i < n; i++) using ll = long long; using ld = double; template <class T> inline bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <clas...
[["+", 0, 16, 31, 23, 0, 16, 31, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25]]
1
257
n = gets.to_i M = 1_000_000_007 if n == 1 p 0 else p 10.pow(n, M) - 2 * 9.pow(n, M) + 8.pow(n, M) end
n = gets.to_i M = 1_000_000_007 if n == 1 p 0 else p (10.pow(n, M) - 2 * 9.pow(n, M) + 8.pow(n, M)) % M end
[["+", 0, 652, 3, 4, 0, 738, 31, 739, 0, 24], ["+", 31, 739, 0, 738, 12, 652, 3, 4, 0, 25], ["+", 75, 95, 0, 652, 3, 4, 0, 738, 17, 109], ["+", 75, 95, 0, 652, 3, 4, 0, 738, 12, 743]]
4
45
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int mod = 1e9 + 7; ll qpow(ll a, ll n) { ll res = 1; while (n) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } int n; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int mod = 1e9 + 7; ll qpow(ll a, ll n) { ll res = 1; while (n) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } int n; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(...
[["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 22], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13]]
1
155
#include <cstdio> typedef long long ll; const ll mod = 1000000007; ll pow(ll n, ll r) { // n^r % mod if (r == 0) { return 1; } if (r == 1) { return n; } if ((r % 2) == 0) { ll a = pow(n, r / 2); return (a * a) % mod; } else { ll a = pow(n, r / 2); return (((a * a) % mod) * n) % mo...
#include <cstdio> typedef long long ll; const ll mod = 1000000007; ll pow(ll n, ll r) { // n^r % mod if (r == 0) { return 1; } if (r == 1) { return n; } if ((r % 2) == 0) { ll a = pow(n, r / 2); return (a * a) % mod; } else { ll a = pow(n, r / 2); return (((a * a) % mod) * n) % mo...
[["+", 0, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 0, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
173
#!/usr/bin/env python n = int(input()) mod = 10**9+7 tot = 10**n inc0 = (tot - 9**n)%mod inc9 = (tot - 9**n)%mod inc0or9 = (tot - 8**n)%mod ans = inc0+inc9-inc0or9 print(ans)
#!/usr/bin/env python n = int(input()) mod = 10**9+7 tot = 10**n inc0 = (tot - 9**n)%mod inc9 = (tot - 9**n)%mod inc0or9 = (tot - 8**n)%mod ans = (inc0+inc9-inc0or9)%mod print(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
65
MOD = 10**9 + 7 n = int(input()) def pow(x, n): res = 1 while n > 0: if n & 1: res = res * x % MOD x = x**2 % MOD n >>= 1 return res print(pow(10,n) - pow(9,n)*2 + pow(8,n))
MOD = 10**9 + 7 n = int(input()) def pow(x, n): res = 1 while n > 0: if n & 1: res = res * x % MOD x = x**2 % MOD n >>= 1 return res print((pow(10,n) - pow(9,n)*2 + pow(8,n)) % 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
80
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time, copy sys.setrecursionlimit(10**7) inf = 10**20 mod = 10**9 + 7 stdin = sys.stdin ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) ns = lambda: stdin.readline().rstrip() # ignore trailing spaces n =...
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time, copy sys.setrecursionlimit(10**7) inf = 10**20 mod = 10**9 + 7 stdin = sys.stdin ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) ns = lambda: stdin.readline().rstrip() # ignore trailing spaces n =...
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 12, 23, 0, 657, 12, 652, 3, 4, 0, 25], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
145
#include <bits/stdc++.h> // Fast io #define io \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0) // Class shorthands #define...
#include <bits/stdc++.h> // Fast io #define io \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0) // Class shorthands #define...
[["+", 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
271
n = int(input()) p = 10 ** 9 + 7 def pow(a): ans = 1 for i in range(n): ans = (ans * a) % p return ans x = pow(10) - pow(9) * 2 + pow(8) print(x)
n = int(input()) p = 10 ** 9 + 7 def pow(a): ans = 1 for i in range(n): ans = (ans * a) % p return ans x = (pow(10) - pow(9) * 2 + pow(8)) % p print(x)
[["+", 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
65
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0); #define st first #define nd second #define endl '\n' // toggle off for interactive problems #defi...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0); #define st first #define nd second #define endl '\n' // toggle off for interactive problems #defi...
[["+", 49, 50, 51, 16, 31, 16, 31, 16, 17, 72], ["+", 51, 16, 31, 16, 31, 16, 12, 16, 31, 13], ["+", 51, 16, 31, 16, 31, 16, 12, 16, 17, 48], ["+", 51, 16, 31, 16, 31, 16, 12, 16, 12, 22]]
1
195
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<ll> vll; typedef vector<vll> vvll; typedef vector<vvll> vvvll; typedef vector<ld> vld; typedef vector<string> vstr; typedef pair<ll, ll> pll; typedef vector<pll> vpll; typedef priority_queue<ll, vector<ll>, grea...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<ll> vll; typedef vector<vll> vvll; typedef vector<vvll> vvvll; typedef vector<ld> vld; typedef vector<string> vstr; typedef pair<ll, ll> pll; typedef vector<pll> vpll; typedef priority_queue<ll, vector<ll>, grea...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 22]]
1
443
#include <bits/stdc++.h> using namespace std; typedef long long int ll; ll powr(ll a, ll b, ll mod) { if (b <= 0) return 1; else if (b % 2 == 0) return (powr(a, b / 2, mod) * powr(a, b / 2, mod)) % mod; else return (a * powr(a, b - 1, mod)) % mod; } void solve() { ll n, mod = 1e9 + 7; cin >> n; ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; ll powr(ll a, ll b, ll mod) { if (b <= 0) return 1; else if (b % 2 == 0) return (powr(a, b / 2, mod) * powr(a, b / 2, mod)) % mod; else return (a * powr(a, b - 1, mod)) % mod; } void solve() { ll n, mod = 1e9 + 7; cin >> n; ...
[["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13]]
1
215
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <stdio.h> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep2(i, n) for (int i = 1; i < (n); i++) typedef long long ll; ll gcd(ll a, ll b) { if (a < b) swap(a, b); if (a % b == ...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <stdio.h> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep2(i, n) for (int i = 1; i < (n); i++) typedef long long ll; ll gcd(ll a, ll b) { if (a < b) swap(a, b); if (a % b == ...
[["+", 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
174
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #define ll long long #define lson (rt << 1) #define rson (rt << 1 | 1) #define gmid ((l + r) >> 1) using namespace std; const int p = 1e9 + 7; int main() { long long n; cin >> n; long long ans = 10; l...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #define ll long long #define lson (rt << 1) #define rson (rt << 1 | 1) #define gmid ((l + r) >> 1) using namespace std; const int p = 1e9 + 7; int main() { long long n; cin >> n; long long ans = 10; l...
[["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22]]
1
136
import sys input = sys.stdin.readline def main(): n = int(input()) if n == 1: ans = 0 else: mod = pow(10, 9)+7 ans = pow(10, n, mod) + pow(8, n, mod) - 2*pow(9, n, mod) print(ans) if __name__ == "__main__": main()
import sys input = sys.stdin.readline def main(): n = int(input()) if n == 1: ans = 0 else: mod = pow(10, 9)+7 ans = (mod + pow(10, n, mod) + pow(8, n, mod) - 2*pow(9, n, mod)) % mod print(ans) if __name__ == "__main__": main()
[["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 31, 23, 0, 657, 31, 657, 31, 657, 31, 22], ["+", 31, 23, 0, 657, 31, 657, 31, 657, 17, 72], ["+", 0, 657, 12, 657, 12, 652, 3, 4, 0, 25], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 109], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 22]]
5
86
#include <bits/stdc++.h> using namespace std; #define int long long const int mod = 1e9 + 7; int pw(int a, int t) { int x = 1; while (t) { if (t & 1) x = x * a % mod; a = a * a % mod, t /= 2; } return x; } int32_t main() { ios::sync_with_stdio(0), cin.tie(0); int n; cin >> n; cout << (pw...
#include <bits/stdc++.h> using namespace std; #define int long long const int mod = 1e9 + 7; int pw(int a, int t) { int x = 1; while (t > 0) { if (t & 1) x = x * a % mod; a = a * a % mod, t /= 2; } return x; } int32_t main() { ios::sync_with_stdio(0), cin.tie(0); int n; cin >> n; cout <<...
[["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["+", 0, 16, 31, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 16, 31, 16, 31, 16, 12, 16, 12, 22]]
1
126
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; const int modu = 1e9 + 7; int main() { int N; cin >> N; long long ten = 1, nine = 1, eight = 1; for (int i = 0; i < N; ++i) { ten = ten * 10 % modu; nine = nine * 9 % modu; eight = eight * 8 % modu;...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; const int modu = 1e9 + 7; int main() { int N; cin >> N; long long ten = 1, nine = 1, eight = 1; for (int i = 0; i < N; ++i) { ten = ten * 10 % modu; nine = nine * 9 % modu; eight = eight * 8 % modu;...
[["+", 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
108
N = int(input()) MOD = 10**9 + 7 def f(x, y): return pow(x, y, MOD) print(f(10, N) - f(9, N) - f(9, N) + f(8, N))
N = int(input()) MOD = 10**9 + 7 def f(x, y): return pow(x, y, MOD) print((f(10, N) - f(9, N) - f(9, N) + f(8, N) + MOD) % MOD)
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 0, 657, 31, 657, 12, 652, 3, 4, 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
62
n = int(input()) mod = 10**9+7 a = pow(10, n, mod) b = pow(9, n, mod) c = pow(8,n,mod) ans = a-2*b+c print(ans)
n = int(input()) mod = 10**9+7 a = pow(10, n, mod) b = pow(9, n, mod) c = pow(8,n,mod) ans = a-2*b+c 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
58
// #pragma GCC optimize("O3") // #pragma comment(linker, "/stack:200000000") // #pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> using namespace ::std; // clang-format off template<typename T...
// #pragma GCC optimize("O3") // #pragma comment(linker, "/stack:200000000") // #pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> using namespace ::std; // clang-format off template<typename T...
[["+", 31, 16, 31, 23, 0, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 12, 22], ["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 25], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 72]]
1
368
#include <deque> #include <iostream> #include <list> #include <random> #include <set> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; using ll = long long; const int BIG = 1000000007; int main() { ll n; cin >> n; ll a = 1; ll b = 1; ll c = 1; for (ll i = 0; i < n; ...
#include <deque> #include <iostream> #include <list> #include <random> #include <set> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; using ll = long long; const int BIG = 1000000007; int main() { ll n; cin >> n; ll a = 1; ll b = 1; ll c = 1; for (ll i = 0; i < n; ...
[["+", 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
135
#include <bits/stdc++.h> #define zton(i, n) for (int i = 0; i <= n; i++) #define oneton(i, n) for (int i = 1; i <= n; i++) #define fo(i, n) for (int i = 0; i < n; i++) #define fab(i, a, b) for (int i = a; i < b; i++) #define loop(i, b, a) for (int i = a; i >= b; i--) #define dsort(arr, n) sort(arr, arr + n, greater<in...
#include <bits/stdc++.h> #define zton(i, n) for (int i = 0; i <= n; i++) #define oneton(i, n) for (int i = 1; i <= n; i++) #define fo(i, n) for (int i = 0; i < n; i++) #define fab(i, a, b) for (int i = a; i < b; i++) #define loop(i, b, a) for (int i = a; i >= b; i--) #define dsort(arr, n) sort(arr, arr + n, greater<in...
[["+", 0, 57, 64, 9, 0, 1, 0, 42, 0, 22], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
1
530
#include <bits/stdc++.h> //#define DEBUG #define REP(i, nn) for (int i = 0; i < (int)nn; i++) #define deb(x) std::cout << #x << " " << x << endl; using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; template <typename... T> void read(T &...a) { ((cin >> a), ...); } template <typenam...
#include <bits/stdc++.h> //#define DEBUG #define REP(i, nn) for (int i = 0; i < (int)nn; i++) #define deb(x) std::cout << #x << " " << x << endl; using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; template <typename... T> void read(T &...a) { ((cin >> a), ...); } template <typenam...
[["+", 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
392
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define ll long long #define int long long int #define setbits(x) __builtin_popcountll(x) #define mod 1000000007 #define modp 998244353 #define inf (ll)1e18 #define ps(x, y) fixed << setprecision(y) << x ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define ll long long #define int long long int #define setbits(x) __builtin_popcountll(x) #define mod 1000000007 #define modp 998244353 #define inf (ll)1e18 #define ps(x, y) fixed << setprecision(y) << x ...
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95]]
1
292
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; using namespace std; #define pb push_back #define mp make_pair #define mt make_tuple #define ff first #define ss second #define null 0 #define pi 3.14159265358979323846 #define all...
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; using namespace std; #define pb push_back #define mp make_pair #define mt make_tuple #define ff first #define ss second #define null 0 #define pi 3.14159265358979323846 #define all...
[["+", 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
461
MOD = int(1e9+7) N = int(input()) answer = pow(10, N, MOD) answer -= pow(9, N, MOD) * 2 answer += pow(8, N, MOD) print(answer)
MOD = int(1e9+7) N = int(input()) answer = pow(10, N, MOD) answer -= pow(9, N, MOD) * 2 answer += pow(8, N, MOD) answer %= MOD print(answer)
[["+", 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
52
n = int(input()) mod = (10 ** 9 + 7) s = 10 ** n % mod t = 9 ** n % mod u = 8 ** n % mod print(s - t * 2 + u)
n = int(input()) mod = (10 ** 9 + 7) s = 10 ** n % mod t = 9 ** n % mod u = 8 ** n % mod print((s - t * 2 + u) % 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
48
mod = 10 ** 9 + 7 n = int(input()) all = pow(10, n, mod) each = pow(9, n, mod) non = pow(8, n, mod) print(all - 2 * each + non)
mod = 10 ** 9 + 7 n = int(input()) all = pow(10, n, mod) each = pow(9, n, mod) non = pow(8, n, mod) print((all - 2 * each + non) % 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
55
n = int(input()) MOD = 10**9 + 7 allp = pow(10,n,MOD) not09 = 2*pow(9,n,MOD) closs = pow(8,n,MOD) print(allp - not09 + closs)
n = int(input()) MOD = 10**9 + 7 allp = pow(10,n,MOD) not09 = 2*pow(9,n,MOD) closs = pow(8,n,MOD) print((allp - not09 + closs)%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
55
p = 10**9+7 N = int(input()) print(pow(10, N, p) - pow(9, N, p) * 2 + pow(8, N, p))
p = 10**9+7 N = int(input()) print((pow(10, N, p) - pow(9, N, p) * 2 + pow(8, N, p)) % p)
[["+", 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
46
import sys import itertools # import numpy as np import time import math from heapq import heappop, heappush from collections import defaultdict from collections import Counter from collections import deque from itertools import permutations sys.setrecursionlimit(10 ** 7) INF = 10 ** 18 MOD = 10 ** 9 + 7 read = sys.s...
import sys import itertools # import numpy as np import time import math from heapq import heappop, heappush from collections import defaultdict from collections import Counter from collections import deque from itertools import permutations sys.setrecursionlimit(10 ** 7) INF = 10 ** 18 MOD = 10 ** 9 + 7 read = sys.s...
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
118
#!/usr/bin/env python3 import sys input = sys.stdin.readline MOD = 10**9 + 7 n = int(input()) ret = pow(10, n, MOD) ret -= pow(9, n, MOD) ret -= pow(9, n, MOD) ret += pow(8, n, MOD) print(ret)
#!/usr/bin/env python3 import sys input = sys.stdin.readline MOD = 10**9 + 7 n = int(input()) ret = pow(10, n, MOD) ret -= pow(9, n, MOD) ret -= pow(9, n, MOD) ret += pow(8, n, MOD) print(ret % MOD)
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
69
#include <bits/stdc++.h> #define IOS \ { \ ios::sync_with_stdio(0); \ cin.tie(0); ...
#include <bits/stdc++.h> #define IOS \ { \ ios::sync_with_stdio(0); \ cin.tie(0); ...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
258
mod = 10**9+7 N = int(input()) p = pow(10, N, mod) q = pow( 9, N, mod) r = pow( 8, N, mod) print(p-q*2+r)
mod = 10**9+7 N = int(input()) p = pow(10, N, mod) q = pow( 9, N, mod) r = pow( 8, N, mod) print((p-q*2+r)%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
55
#include "bits/stdc++.h" // #pragma GCC optimize("Ofast") // #pragma GCC optimize ("unroll-loops") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") using namespace std; using ll = long long int; int main() { ios::sync_with_stdio(0); cin.tie(0); mt19937 rng(chrono::steady_clock::no...
#include "bits/stdc++.h" // #pragma GCC optimize("Ofast") // #pragma GCC optimize ("unroll-loops") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") using namespace std; using ll = long long int; int main() { ios::sync_with_stdio(0); cin.tie(0); mt19937 rng(chrono::steady_clock::no...
[["+", 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
185
MOD = 10**9 + 7 import sys input = sys.stdin.readline N = int(input()) ans = pow(10,N,MOD) ans -= 2*pow(9,N,MOD) ans += pow(8,N,MOD) print(ans)
MOD = 10**9 + 7 import sys input = sys.stdin.readline N = int(input()) ans = pow(10,N,MOD) ans -= 2*pow(9,N,MOD) ans += pow(8,N,MOD) print(ans % MOD)
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
60
#!/usr/bin/env python3 ''' Author: andyli Time: 2020-09-13 19:58:05 ''' import os from io import BytesIO, IOBase import sys MOD = 10**9+7 def main(): n = int(input()) print(pow(10,n,MOD)-pow(9,n,MOD)*2+pow(8,n,MOD)) return # region fastio BUFSIZE = 1048576 class FastIO(IOBase): newlines = 0 ...
#!/usr/bin/env python3 ''' Author: andyli Time: 2020-09-13 19:58:05 ''' import os from io import BytesIO, IOBase import sys MOD = 10**9+7 def main(): n = int(input()) print((pow(10,n,MOD)-pow(9,n,MOD)*2+pow(8,n,MOD))%MOD) return # region fastio BUFSIZE = 1048576 class FastIO(IOBase): newlines = ...
[["+", 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
533
# -*- coding: utf-8 -*- ############# # Libraries # ############# import sys input = sys.stdin.readline import math #from math import gcd import bisect import heapq from collections import defaultdict from collections import deque from collections import Counter from functools import lru_cache ############# # Const...
# -*- coding: utf-8 -*- ############# # Libraries # ############# import sys input = sys.stdin.readline import math #from math import gcd import bisect import heapq from collections import defaultdict from collections import deque from collections import Counter from functools import lru_cache ############# # Const...
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
994
S = int(input()) if S < 3: print(0) exit() ans = [0 for _ in range(S+1)] ans[3] = 1 ans[4] = 1 ans[5] = 1 for i in range(6, S+1): ans[i] = ans[i-3] + ans[i-1] print(ans[S] % 1000000007)
S = int(input()) if S < 3: print(0) exit() ans = [0 for _ in range(2001)] ans[3] = 1 ans[4] = 1 ans[5] = 1 for i in range(6, S+1): ans[i] = ans[i-3] + ans[i-1] print(ans[S] % 1000000007)
[["-", 0, 659, 12, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 12, 658, 0, 659, 12, 652, 3, 4, 0, 612]]
5
91
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define ll long ...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define ll long ...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 12, 13], ["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13]]
1
328
n = int(input()) mod = 10**9 + 7 per = [1] * (n+1) for i in range(1, n+1): per[i] = per[i-1] * i per[i] %= mod inv = [1] * (n+1) inv[-1] = pow(per[-1], mod-2, mod) for j in range(2, n+1): inv[-j] = inv[-j+1] * (n-j+1) inv[-j] %= mod def C(n, k): cmb = per[n] * inv[k] * inv[n-k] cmb %= mod return cmb t...
n = int(input()) mod = 10**9 + 7 per = [1] * (n+1) for i in range(1, n+1): per[i] = per[i-1] * i per[i] %= mod inv = [1] * (n+1) inv[-1] = pow(per[-1], mod-2, mod) for j in range(2, n+2): inv[-j] = inv[-j+1] * (n-j+2) inv[-j] %= mod def C(n, k): cmb = per[n] * inv[k] * inv[n-k] cmb %= mod return cmb t...
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["-", 0, 662, 12, 657, 12, 23, 0, 657, 12, 612], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 12, 612]]
5
205
MOD = 10**9 + 7 dp = {0: 1} S = int(input()) for s in range(3, S+1): for term in range(3, s+1): if s - term < 0: break else: dp[s] = dp.get(s-term, 0) + dp.get(s, 0) % MOD print(dp[S])
MOD = 10**9 + 7 dp = {0: 1} S = int(input()) for s in range(3, S+1): for term in range(3, s+1): if s - term < 0: break else: dp[s] = dp.get(s-term, 0) + dp.get(s, 0) % MOD print(dp.get(S, 0))
[["-", 0, 1, 0, 652, 3, 4, 0, 206, 0, 70], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 0, 1, 0, 652, 3, 4, 0, 206, 0, 73], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 612], ["+", 0, 652, 3...
5
89
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 1e5 + 10; const int mod = 1e9 + 7; ll c[2010][2010]; void init(int n) { for (int i = 0; i < n; i++) { for (int j = 0; j <= i; j++) { if (!j) c[i][j] = 1; else c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 1e5 + 10; const int mod = 1e9 + 7; ll c[2010][2010]; void init(int n) { for (int i = 0; i < n; i++) { for (int j = 0; j <= i; j++) { if (!j) c[i][j] = 1; else c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
221
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, a, b) for (ll i = (a); i < (b); i++) #define REP(i, n) rep(i, 0, n) #define mod (1000000007) ll power(ll a, ll b) { return b ? power(a * a % mod, b / 2) * (b % 2 ? a : 1) % mod : 1; } void solve() { int n; cin >> n; ll ans = (p...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, a, b) for (ll i = (a); i < (b); i++) #define REP(i, n) rep(i, 0, n) #define mod (1000000007) ll power(ll a, ll b) { return b ? power(a * a % mod, b / 2) * (b % 2 ? a : 1) % mod : 1; } void solve() { int n; cin >> n; ll ans = ((...
[["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 0, 16, 12, 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
159
#include <iostream> #define int long long using namespace std; int bigmod(int b, int p, int m) { if (p == 0) return 1 % m; int r = bigmod(b, p / 2, m); if (p % 2 == 1) { return (((r * r) % m) * b) % m; } else { return (r * r) % m; } } signed main() { int n; cin >> n; int ans = (1000000007 * ...
#include <iostream> #define int long long using namespace std; int bigmod(int b, int p, int m) { if (p == 0) return 1 % m; int r = bigmod(b, p / 2, m); if (p % 2 == 1) { return (((r * r) % m) * b) % m; } else { return (r * r) % m; } } signed main() { int n; cin >> n; int ans = (10000000070ll...
[["-", 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, 13], ["+", 31, 23, 0, 16, 31, 16, 31, 16, 31, 13]]
1
144
# -*- coding: utf-8 -*- # C import sys from collections import defaultdict, deque from heapq import heappush, heappop import math import bisect input = sys.stdin.readline # 再起回数上限変更 # sys.setrecursionlimit(1000000) mod = 10**9 + 7 n = int(input()) ans = pow(10,n,mod) ans -= pow(9,n,mod) ans -= pow(9,n,mod) ans += p...
# -*- coding: utf-8 -*- # C import sys from collections import defaultdict, deque from heapq import heappush, heappop import math import bisect input = sys.stdin.readline # 再起回数上限変更 # sys.setrecursionlimit(1000000) mod = 10**9 + 7 n = int(input()) ans = pow(10,n,mod) ans -= pow(9,n,mod) ans -= pow(9,n,mod) ans += p...
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
88
#include <bits/stdc++.h> #include <cmath> #include <string> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<pii> vpii; typedef vector<pll> vpll; typedef vector<ll> vll; #define all(v) v.begin(), v.end() #de...
#include <bits/stdc++.h> #include <cmath> #include <string> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<pii> vpii; typedef vector<pll> vpll; typedef vector<ll> vll; #define all(v) v.begin(), v.end() #de...
[["+", 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
230
#include <bits/stdc++.h> using namespace std; using ll = long long; // -------------------------------------------------------- #define FOR(i, l, r) for (int i = (l); i < (r); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(c) (c).begin(), (c).end() #define RALL(c) (c).rbegin(), (c).rend() #define SORT(c) sort(ALL(c)) ...
#include <bits/stdc++.h> using namespace std; using ll = long long; // -------------------------------------------------------- #define FOR(i, l, r) for (int i = (l); i < (r); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(c) (c).begin(), (c).end() #define RALL(c) (c).rbegin(), (c).rend() #define SORT(c) sort(ALL(c)) ...
[["+", 51, 16, 31, 23, 0, 16, 31, 16, 31, 22], ["+", 51, 16, 31, 23, 0, 16, 31, 16, 17, 72], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 31, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 17, 72]]
1
411
#include <bits/stdc++.h> #define pb push_back #define ss second #define ff first #define all(x) x.begin(), x.end() #define INF 3000000000000001 // 3e15 #define ll_max 9000000000000000000 #define PI 3.14159265358979323846L #define fill(a, n, x) \ for (int i = 0;...
#include <bits/stdc++.h> #define pb push_back #define ss second #define ff first #define all(x) x.begin(), x.end() #define INF 3000000000000001 // 3e15 #define ll_max 9000000000000000000 #define PI 3.14159265358979323846L #define fill(a, n, x) \ for (int i = 0;...
[["+", 31, 23, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 12, 22]]
1
606
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; typedef long long int lli; typedef unsigned long long int ulli; typedef long double ld; #define vec(s) vector<s> #define vvec(s) vector<vector<s>> typedef vector<lli> vi; typedef vector<vi> vvi; typedef pair<lli, lli> pii; #define rep(i, n) for (int i...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; typedef long long int lli; typedef unsigned long long int ulli; typedef long double ld; #define vec(s) vector<s> #define vvec(s) vector<vector<s>> typedef vector<lli> vi; typedef vector<vi> vvi; typedef pair<lli, lli> pii; #define rep(i, n) for (int i...
[["+", 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
280
## for use in beginner level questions where speed is key ## and also for single test case code ## mastercopy for x,y,z import sys import heapq, functools, collections import random from collections import Counter, defaultdict # read line as a string # strr = input() # read line as an integer k = int(input()) # rea...
## for use in beginner level questions where speed is key ## and also for single test case code ## mastercopy for x,y,z import sys import heapq, functools, collections import random from collections import Counter, defaultdict # read line as a string # strr = input() # read line as an integer k = int(input()) # rea...
[["+", 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
111
#include <bits/stdc++.h> #define ff first #define ss second #define pb push_back #define eb emplace_back #define mp make_pair #define mset(x, y) memset((x), (y), sizeof(x)) #define sz(x) ((int)(x).size()) #define rep(i, a, b) for (i = a; i < b; i++) #define per(i, a, b) for (i = a; i >= b; i--) #define all(x) (x).begin...
#include <bits/stdc++.h> #define ff first #define ss second #define pb push_back #define eb emplace_back #define mp make_pair #define mset(x, y) memset((x), (y), sizeof(x)) #define sz(x) ((int)(x).size()) #define rep(i, a, b) for (i = a; i < b; i++) #define per(i, a, b) for (i = a; i >= b; i--) #define all(x) (x).begin...
[["+", 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
553
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set \ tree<pairs, null_type, greater<pairs>, rb_tree_tag, \ ...
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set \ tree<pairs, null_type, greater<pairs>, rb_tree_tag, \ ...
[["+", 31, 23, 0, 23, 0, 16, 12, 16, 31, 13], ["+", 31, 23, 0, 23, 0, 16, 12, 16, 17, 48]]
1
204
N = int(input()) mod = 10**9+7 a = pow(10,N,mod) b = pow(8,N,mod) c = pow(9,N,mod) ans = a-2*c+b if ans<0: ans += mod else: ans %= mod print(ans)
N = int(input()) mod = 10**9+7 a = pow(10,N,mod) b = pow(8,N,mod) c = pow(9,N,mod) ans = a-2*c+b while ans<0: ans += mod ans %= mod print(ans)
[["-", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["+", 36, 36, 36, 36, 0, 656, 0, 52, 0, 89], ["-", 36, 36, 0, 656, 0, 57, 75, 76, 0, 95], ["-", 36, 36, 0, 656, 0, 57, 75, 76, 0, 102]]
5
71
n = int(input()) mod = 10**9+7 def pow(x, n): res = 1 while n > 0: if n & 1 == 1: res *= x x *= x n >>= 1 return res print((pow(10, n)%mod -2*pow(9, n)%mod + pow(8, n)%mod))
n = int(input()) mod = 10**9+7 def pow(x, n): res = 1 while n > 0: if n & 1 == 1: res *= x x *= x n >>= 1 return res print((pow(10, n)%mod -2*pow(9, n)%mod + pow(8, n)%mod)%mod)
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
82
#include <bits/stdc++.h> using namespace std; int main() { int64_t n; cin >> n; int64_t ten = 1; for (int i = 0; i < n; i++) { ten *= 10; ten %= 1000000007; } int64_t nine = 1; for (int i = 0; i < n; i++) { nine *= 9; nine %= 1000000007; } int64_t eight = 1; for (int i = 0; i < n; i+...
#include <bits/stdc++.h> using namespace std; int main() { int64_t n; cin >> n; int64_t ten = 1; for (int i = 0; i < n; i++) { ten *= 10; ten %= 1000000007; } int64_t nine = 1; for (int i = 0; i < n; i++) { nine *= 9; nine %= 1000000007; } int64_t eight = 1; for (int i = 0; i < n; i+...
[["-", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89]]
1
137
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; int main() { int n; cin >> n; ll a = 1, b = 1, c = 1; rep(i, n) { a *= 10; a %= 1000000007; b *= 9; b %= 1000000007; c *= 8; c %= 1000000007; } cout << ((a - (b * ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; int main() { int n; cin >> n; ll a = 1, b = 1, c = 1; rep(i, n) { a *= 10; a %= 1000000007; b *= 9; b %= 1000000007; c *= 8; c %= 1000000007; } cout << ((a + 10000...
[["+", 31, 16, 31, 23, 0, 16, 31, 16, 17, 72], ["+", 31, 16, 31, 23, 0, 16, 31, 16, 12, 13]]
1
102
#include <bits/stdc++.h> #define mod 1000000007 #define djfs first #define akdk second #define N 100000000 #define fo(i, m, n) for (int i = m; i < n; i++) #define M 7 #define fast_io \ ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> #define mod 1000000007 #define djfs first #define akdk second #define N 100000000 #define fo(i, m, n) for (int i = m; i < n; i++) #define M 7 #define fast_io \ ios_base::sync_with_stdio(false); ...
[["+", 31, 16, 12, 16, 31, 23, 0, 16, 31, 22], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 23, 0, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 25], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 22]]
1
797
#include <iostream> using namespace std; int main() { const long m = 1000000000 + 7; int N; cin >> N; long long 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) % m; return 0; }
#include <iostream> using namespace std; int main() { const long m = 1000000000 + 7; int N; cin >> N; long long 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 + m) % m; return 0; }
[["+", 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
106
#include <bits/stdc++.h> using namespace std; #define IO \ { \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; #define IO \ { \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
131
n = int(input()) mod = 10 ** 9 + 7 factorials = [1] for i in range(1, n + 1): factorials.append((factorials[-1]) * i % mod) print(pow(10, n, mod) - pow(9, n, mod) - pow(9, n, mod) + pow(8, n, mod))
n = int(input()) mod = 10 ** 9 + 7 factorials = [1] for i in range(1, n + 1): factorials.append((factorials[-1]) * i % mod) 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
86
#include <iostream> using namespace std; int main(void) { long long int N, n10 = 1, n9 = 1, n8 = 1, div = 1000000007; cin >> N; for (int i = 0; i < N; i++) { n10 = (n10 * 10) % div; n9 = (n9 * 9) % div; n8 = (n8 * 8) % div; } cout << (n10 - 2 * n9 + n8 + div) % div << endl; return 0; }
#include <iostream> using namespace std; int main(void) { long long int N, n10 = 1, n9 = 1, n8 = 1, div = 1000000007; cin >> N; for (int i = 0; i < N; i++) { n10 = (n10 * 10) % div; n9 = (n9 * 9) % div; n8 = (n8 * 8) % div; } cout << (n10 - 2 * n9 + n8 + div * 5) % div << endl; return 0; }
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13]]
1
105
import sys MOD = 10 ** 9 + 7 def main(): input = sys.stdin.buffer.readline n = int(input()) print(pow(10, n, MOD) - (pow(9, n, MOD) * 2 - pow(8, n, MOD)) % MOD) if __name__ == "__main__": main()
import sys MOD = 10 ** 9 + 7 def main(): input = sys.stdin.buffer.readline n = int(input()) print((pow(10, n, MOD) - (pow(9, n, MOD) * 2 - pow(8, n, MOD))) % MOD) if __name__ == "__main__": main()
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 12, 23, 0, 657, 12, 652, 3, 4, 0, 25]]
5
76
p=10**9+7 def pow(x, n): res = 1 while n > 0: if n & 1 == 1: res *= x x *= x res = res%p n >>= 1 return res n=int(input()) print(pow(10,n)-2*pow(9,n)+pow(8,n))
p=10**9+7 def pow(x, n): res = 1 while n > 0: if n & 1 == 1: res *= x x *= x res = res%p n >>= 1 return res n=int(input()) print((pow(10,n)-2*pow(9,n)+pow(8,n))%p)
[["+", 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
79
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long long mod = 1000000007; long long 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 << (mod + a - 2 * b + c) % mod << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long long mod = 1000000007; long long 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 << (2 * mod + a - 2 * b + c) % mod << endl; return 0; }
[["+", 0, 16, 31, 16, 31, 16, 31, 16, 31, 13], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 17, 48]]
1
106
#pragma GCC target("sse4.2") #include <bits/stdc++.h> using namespace std; #define F first #define S second #define PB push_back #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; i++) #define rforn(i, e) for (ll i = e; i >= 0; i--) #define rforsn(i, e, s) for (...
#pragma GCC target("sse4.2") #include <bits/stdc++.h> using namespace std; #define F first #define S second #define PB push_back #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; i++) #define rforn(i, e) for (ll i = e; i >= 0; i--) #define rforsn(i, e, s) for (...
[["-", 8, 9, 0, 43, 49, 50, 51, 91, 17, 33], ["-", 28, 23, 0, 16, 31, 16, 31, 16, 31, 13], ["+", 31, 23, 0, 16, 31, 16, 31, 16, 31, 13], ["-", 51, 91, 28, 23, 0, 16, 31, 16, 17, 33], ["+", 51, 16, 31, 23, 0, 16, 31, 16, 17, 72], ["-", 49, 50, 51, 91, 28, 23, 0, 16, 17, 33], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 72],...
1
2,875
N = int(input()) mod = 10**9 + 7 a = ((10**(N))%mod - 2*(9**(N))%mod + (8**N)%mod) print(a)
N = int(input()) mod = 10**9 + 7 a = ((10**(N)) - 2*(9**(N)) + (8**N))%mod print(a)
[["-", 12, 23, 0, 657, 31, 657, 31, 657, 17, 109], ["-", 12, 23, 0, 657, 31, 657, 31, 657, 12, 22], ["-", 12, 23, 0, 657, 31, 657, 12, 657, 17, 109], ["-", 12, 23, 0, 657, 31, 657, 12, 657, 12, 22], ["+", 12, 657, 31, 23, 0, 657, 12, 23, 0, 25], ["-", 0, 656, 0, 1, 0, 662, 12, 23, 0, 25]]
5
52
#include <bits/stdc++.h> using namespace std; #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define int lon...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define int lon...
[["+", 0, 1, 0, 16, 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, 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]]
1
240
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy sys.setrecursionlimit(10**7) inf=10**20 mod=10**9+7 dd=[(-1,0),(0,1),(1,0),(0,-1)] ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] def LI(): return [int(x) for x in sys.stdin.readline().split()] # def LF(): return [float(x) for x in s...
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy sys.setrecursionlimit(10**7) inf=10**20 mod=10**9+7 dd=[(-1,0),(0,1),(1,0),(0,-1)] ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] def LI(): return [int(x) for x in sys.stdin.readline().split()] # def LF(): return [float(x) for x in s...
[["+", 8, 196, 0, 37, 0, 657, 31, 23, 0, 24], ["+", 0, 657, 31, 23, 0, 657, 12, 23, 0, 25], ["+", 0, 14, 8, 196, 0, 37, 0, 657, 17, 109], ["+", 0, 14, 8, 196, 0, 37, 0, 657, 12, 22]]
5
289
#include <bits/stdc++.h> using namespace std; typedef long long lol; //マクロ // forループ関係 //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (lol i = 0; i < lol(n); i++) #define REPD(i, n) for (lol i = n - 1; i >= 0; i--) #define FOR(i, a, b) fo...
#include <bits/stdc++.h> using namespace std; typedef long long lol; //マクロ // forループ関係 //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる #define REP(i, n) for (lol i = 0; i < lol(n); i++) #define REPD(i, n) for (lol i = n - 1; i >= 0; i--) #define FOR(i, a, b) fo...
[["+", 12, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 25], ["+", 0, 16, 12, 23, 0, 16, 31, 16, 17, 109], ["+", 0, 16, 12, 23, 0, 16, 31, 16, 12, 22]]
1
346
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll INF = 1LL << 60; ll MOD = 1e9 + 7; int main() { int n; cin >> n; ll ten = 1, nine = 1, eight = 1; for (int i = 0; i < n; i++) { ten = (ten * 10) % MOD; nine = (nine * 9) % MOD; eight = (eight * 8) % MOD; } cout << (ten...
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll INF = 1LL << 60; ll MOD = 1000000000 + 7; int main() { int n; cin >> n; ll ten = 1, nine = 1, eight = 1; for (int i = 0; i < n; i++) { ten = (ten * 10) % MOD; nine = (nine * 9) % MOD; eight = (eight * 8) % MOD; } cout ...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13]]
1
120
#include <bits/stdc++.h> using namespace std; using ll = int64_t; int main() { ll n, x = 1, y = 1, z = 1, i, mod = 1e9 + 7; cin >> n; for (i = 0; i < n; i++) { x = x * 10 % mod; y = y * 9 % mod; z = z * 8 % mod; } cout << (x - 2 * y + z) % mod << endl; }
#include <bits/stdc++.h> using namespace std; using ll = int64_t; int main() { ll n, x = 1, y = 1, z = 1, i, mod = 1e9 + 7; cin >> n; for (i = 0; i < n; i++) { x = x * 10 % mod; y = y * 9 % mod; z = z * 8 % mod; } cout << (x - 2 * y + z + 2 * mod) % mod << 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
99
#pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> //#include <atcoder/all> #define rep(i, n) for (int i = 0; i < (n); ++i) typedef int64_t lint; using namespace std; using ll = long long; using P = pair<ll, ll>; using lb = long double; //マクロ // forループ関係 /...
#pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> //#include <atcoder/all> #define rep(i, n) for (int i = 0; i < (n); ++i) typedef int64_t lint; using namespace std; using ll = long long; using P = pair<ll, ll>; using lb = long double; //マクロ // forループ関係 /...
[["+", 0, 2, 3, 4, 0, 16, 31, 16, 17, 109], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 12, 22]]
1
513
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define in(x) \ int x; \ cin >> x; #define ln(x) ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define in(x) \ int x; \ cin >> x; #define ln(x) ...
[["+", 8, 9, 0, 1, 0, 11, 12, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 23, 0, 16, 31, 13], ["+", 0, 1, 0, 11, 12, 23, 0, 16, 17, 48], ["+", 8, 9, 0, 1, 0, 11, 12, 23, 0, 25]]
1
234
import sys ## io ## def IS(): return sys.stdin.readline().rstrip() def II(): return int(IS()) def MII(): return list(map(int, IS().split())) def MIIZ(): return list(map(lambda x: x-1, MII())) MOD=10**9+7 #======================================================# def main(): n = II() sumv10 = 1 for _ in range(...
import sys ## io ## def IS(): return sys.stdin.readline().rstrip() def II(): return int(IS()) def MII(): return list(map(int, IS().split())) def MIIZ(): return list(map(lambda x: x-1, MII())) MOD=10**9+7 #======================================================# def main(): n = II() sumv10 = 1 for _ in range(...
[["+", 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
165
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAX = 2e9; typedef pair<int, int> pi; const ll MOD = (ll)1e9 + 7; ll mypow(ll a, ll b) { ll res = 1; while (b) { if (b & 1) res = (res * a) % MOD; a = (a * a) % MOD; b >>= 1; } return res; } int main() { ios::sync_...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAX = 2e9; typedef pair<int, int> pi; const ll MOD = (ll)1e9 + 7; ll mypow(ll a, ll b) { ll res = 1; while (b) { if (b & 1) res = (res * a) % MOD; a = (a * a) % MOD; b >>= 1; } return res; } int main() { ios::sync_...
[["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22]]
1
195
#include <bits/stdc++.h> #define endl '\n' using namespace std; typedef long long ll; typedef pair<int, int> pii; const int MOD = 1E9 + 7; ll power(ll a, ll n) { if (n == 0) return 1; if (n % 2 == 0) return power(a, n / 2) * power(a, n / 2) % MOD; else return (power(a, n / 2) * power(a, n / 2) % MO...
#include <bits/stdc++.h> #define endl '\n' using namespace std; typedef long long ll; typedef pair<int, int> pii; const ll MOD = 1E9 + 7; ll power(ll a, ll n) { if (n == 0) return 1; if (n % 2 == 0) return power(a, n / 2) * power(a, n / 2) % MOD; else return (power(a, n / 2) * power(a, n / 2) % MOD...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78], ["+", 51, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 51, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
177
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long MOD = 1_000_000_007; long a = 1, b = 1, c = 1; for (int i = 0; i < N; i++) { a = a * 8 % MOD; b = b * 9 % MOD; c = c * 10 % MOD; }...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long MOD = 1_000_000_007; long a = 1, b = 1, c = 1; for (int i = 0; i < N; i++) { a = a * 8 % MOD; b = b * 9 % MOD; c = c * 10 % MOD; }...
[["+", 0, 16, 31, 23, 0, 16, 12, 16, 31, 499], ["+", 0, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
3
123
N = int(input()) INF = 10**9+7 t = 1 e = 1 n = 1 for i in range(N): t = (t*10)%INF e = (e*8)%INF n = (n*9)%INF print(t-2*n+e)
N = int(input()) INF = 10**9+7 t = 1 e = 1 n = 1 for i in range(N): t = (t*10)%INF e = (e*8)%INF n = (n*9)%INF print((t-2*n+e)%INF)
[["+", 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
69
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vector<int>>; using pii = pair<int, int>; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define pb push_back int main() { ll N; cin >> N; ll MOD = 1e9 + 7; ll a = 1, b = 1, c = 1; rep(i, N) ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vector<int>>; using pii = pair<int, int>; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define pb push_back int main() { ll N; cin >> N; ll MOD = 1e9 + 7; ll a = 1, b = 1, c = 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
150
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define all(a) (a).begin(), (a).end() #define overload4(_1, _2, _3, _4, name, ...) name #define rep1(n) for (ll i = 0; i < (n); i++) #define rep2(i, n) for (ll i = 0; i < (n); i++) #define rep3(i, a, b) for (ll i = (a); i < (b); i++) #define rep4(i, a,...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define all(a) (a).begin(), (a).end() #define overload4(_1, _2, _3, _4, name, ...) name #define rep1(n) for (ll i = 0; i < (n); i++) #define rep2(i, n) for (ll i = 0; i < (n); i++) #define rep3(i, a, b) for (ll i = (a); i < (b); i++) #define rep4(i, a,...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13]]
1
242
// #pragma GCC optimize(2) // #pragma G++ optimize(2) // #pragma comment(linker,"/STACK:102400000,102400000") #include <bits/stdc++.h> using namespace std; typedef long long int64; typedef unsigned int ui; typedef unsigned long long ull; typedef float fl; typedef double dl; typedef pair<int, int> pii; #if (WIN32) || ...
// #pragma GCC optimize(2) // #pragma G++ optimize(2) // #pragma comment(linker,"/STACK:102400000,102400000") #include <bits/stdc++.h> using namespace std; typedef long long int64; typedef unsigned int ui; typedef unsigned long long ull; typedef float fl; typedef double dl; typedef pair<int, int> pii; #if (WIN32) || ...
[["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 25], ["-", 8, 9, 0, 1, 0, 16, 12, 23, 0, 25]]
1
479
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr ll MOD = 1e9 + 7; // dp[i][j] = 和が i 以下になる j 項の数列の数 ll dp[2001][668] = {}; int main() { int s; cin >> s; for (int i = 3; i <= s; ++i) { dp[i][1] = i - 2; } for (int j = 2; j * 3 <= s; ++j) { for (int i = 3; i <= s; ++i) { ...
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr ll MOD = 1e9 + 7; // dp[i][j] = 和が i 以下になる j 項の数列の数 ll dp[2001][668] = {}; int main() { int s; cin >> s; for (int i = 3; i <= s; ++i) { dp[i][1] = i - 2; } for (int j = 2; j * 3 <= s; ++j) { for (int i = 3; i <= s; ++i) { ...
[["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 12, 22]]
1
196
import math def main(): s = int(input()) quo = int(s/3) count = 0 for i in range(1, quo+1): a = math.factorial((s-3*i)+(i-1)) b = math.factorial(s-3*i) c = math.factorial(i-1) add = int(a/(b*c)) count += add return count % (10**9+7) if __name__ == "__mai...
import math def main(): s = int(input()) quo = int(s/3) count = 0 for i in range(1, quo+1): a = math.factorial((s-3*i)+(i-1)) b = math.factorial(s-3*i) c = math.factorial(i-1) add = a//(b*c) count += add return count % (10**9+7) if __name__ == "__main__"...
[["-", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 0, 662, 12, 652, 3, 4, 0, 657, 17, 85], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 676], ["-", 12, 652, 3, 4, 0, 657, 12, 23, 0, 25]]
5
118
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define Rep(i, s, n) for (int i = s; i < n; i++) #define per(i, s, n) for (int i = n - 1; i >= s; i--) #define fi first #define se second #define all(c) c.begin(), c.end() typedef long long int ll; typedef pair<int, int> ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define Rep(i, s, n) for (int i = s; i < n; i++) #define per(i, s, n) for (int i = n - 1; i >= s; i--) #define fi first #define se second #define all(c) c.begin(), c.end() typedef long long int ll; typedef pair<int, int> ...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13]]
1
505
package main import ( "fmt" ) func main() { mod := 1000000007 var s int fmt.Scan(&s) dp := make([]int , s+1) dp[0] = 1 for i := 1; i < s+1; i++{ for j := 0; j < (i-3)+1; j++ { dp[i] += dp[j] dp[i] = dp[i]%mod } } println(dp[s]) }
package main import ( "fmt" ) func main() { mod := 1000000007 var s int fmt.Scan(&s) dp := make([]int , s+1) dp[0] = 1 for i := 1; i < s+1; i++{ for j := 0; j < (i-3)+1; j++ { dp[i] += dp[j] dp[i] = dp[i]%mod } } fmt.Println(dp[s]) }
[["-", 0, 435, 8, 196, 0, 1, 0, 2, 63, 22], ["+", 8, 196, 0, 1, 0, 2, 63, 438, 439, 22], ["+", 8, 196, 0, 1, 0, 2, 63, 438, 0, 131], ["+", 8, 196, 0, 1, 0, 2, 63, 438, 119, 120], ["-", 36, 36, 36, 36, 36, 36, 0, 434, 0, 165]]
7
120
#include <bits/stdc++.h> #include <functional> #include <stdio.h> using namespace std; #define ll long long int #define dd long double #define pb push_back #define pf push_front #define pi pair<ll, ll> #define vi vector<ll> #define vpi vector<pi> #define mi map<ll, ll> #define vvi vector<vector<ll>> #define mpi map<pi,...
#include <bits/stdc++.h> #include <functional> #include <stdio.h> using namespace std; #define ll long long int #define dd long double #define pb push_back #define pf push_front #define pi pair<ll, ll> #define vi vector<ll> #define vpi vector<pi> #define mi map<ll, ll> #define vvi vector<vector<ll>> #define mpi map<pi,...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
423
N=int(input()) MOD=10**9+7 DP1=[0 for _ in range(N+2)] DP2=[0 for _ in range(N+2)] DP1[3]=1 DP2[3]=1 for i in range(4,N+1): DP1[i]=(DP2[i-3]+1)%MOD DP2[i]=(DP1[i]+DP2[i-1])%MOD print(DP1[N])
N=int(input()) MOD=10**9+7 DP1=[0 for _ in range(N+3)] DP2=[0 for _ in range(N+3)] DP1[3]=1 DP2[3]=1 for i in range(4,N+1): DP1[i]=(DP2[i-3]+1)%MOD DP2[i]=(DP1[i]+DP2[i-1])%MOD print(DP1[N])
[["-", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612]]
5
111
package main import ( "fmt" "math" ) func main() { var s, a int a = int(math.Pow(10, 9)) + 7 fmt.Scan(&s) A := make([]int, 2001) A[0] = 1 A[1] = 0 A[2] = 0 var i = 3 for ; i <= s; i++ { A[i] = A[i-1] + A[i-3] } i-- var ans = A[i] % a fmt.Println(ans) }
package main import ( "fmt" "math" ) func main() { var s, a int a = int(math.Pow(10, 9)) + 7 fmt.Scan(&s) A := make([]int, 2001) A[0] = 1 A[1] = 0 A[2] = 0 var i = 3 for ; i <= s; i++ { A[i] = (A[i-1] + A[i-3]) % a } i-- var ans = A[i] % a fmt.Println(ans) }
[["+", 0, 436, 12, 432, 0, 16, 31, 23, 0, 24], ["+", 0, 436, 12, 432, 0, 16, 31, 23, 0, 25], ["+", 8, 196, 0, 436, 12, 432, 0, 16, 17, 109], ["+", 8, 196, 0, 436, 12, 432, 0, 16, 12, 22]]
7
139
#include <bits/stdc++.h> using namespace std; constexpr int MOD = 1e9 + 7; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int s; cin >> s; vector<int> dp(2020); dp[0] = 1; for (int i = 3; i <= s; i++) dp[i] = dp[i - 1] + dp[i - 3]; cout << dp[s] << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; constexpr int MOD = 1e9 + 7; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int s; cin >> s; vector<int> dp(2020); dp[0] = 1; for (int i = 3; i <= s; i++) dp[i] = (dp[i - 1] + dp[i - 3]) % MOD; cout << dp[s] << "\n"; return 0; }
[["+", 8, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 8, 1, 0, 11, 12, 16, 31, 23, 0, 25], ["+", 0, 7, 8, 1, 0, 11, 12, 16, 17, 109], ["+", 0, 7, 8, 1, 0, 11, 12, 16, 12, 22]]
1
104
#include <stdio.h> #include <stdlib.h> int main(void) { int n; scanf("%d", &n); long int a[n + 1]; if (n == 1 || n == 2) { printf("0\n"); } else { a[0] = 1; a[1] = 0; a[2] = 0; for (int i = 3; i <= n; i++) { a[i] = a[i - 1] + a[i - 3]; if (a[i] >= 1000000007) { a[i] %...
#include <stdio.h> #include <stdlib.h> int main(void) { int n; scanf("%d", &n); long int a[n + 1]; if (n == 1 || n == 2) { printf("0\n"); } else { a[0] = 1; a[1] = 0; a[2] = 0; for (int i = 3; i <= n; i++) { a[i] = a[i - 1] + a[i - 3]; if (a[i] >= 1000000007) { a[i] %...
[["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
0
146
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int s; const int MOD = 1e9 + 7; cin >> s; vector<int> dp(s, 0); dp[0] = 1; for (int i = 3; i <= s; i++) for (int j = 3; j <= i; j++) dp[i] = (dp[i] + dp[i - j]) % MOD; cout << dp[...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int s; const int MOD = 1e9 + 7; cin >> s; vector<int> dp(s + 1, 0); dp[0] = 1; for (int i = 3; i <= s; i++) for (int j = 3; j <= i; j++) dp[i] = (dp[i] + dp[i - j]) % MOD; cout <<...
[["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13]]
1
120
#include <bits/stdc++.h> using namespace std; #define int long long #define forn(i, a, n) for (int i = a; i < n; i++) int cnt[2001]; signed main() { ios::sync_with_stdio(false); cin.tie(0); // freopen("input.txt","r",stdin); // freopen("output.txt","w",stdout); int n; cin >> n; cnt[1] = cnt[2] = cnt[...
#include <bits/stdc++.h> using namespace std; #define int long long #define forn(i, a, n) for (int i = a; i < n; i++) int cnt[2001]; signed main() { ios::sync_with_stdio(false); cin.tie(0); // freopen("input.txt","r",stdin); // freopen("output.txt","w",stdout); int n; cin >> n; cnt[1] = cnt[2] = 0; ...
[["+", 8, 9, 0, 1, 0, 11, 12, 11, 12, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
133
#include <bits/stdc++.h> using namespace std; const int mod = 1000000007; int main() { int n; cin >> n; vector<long long> dp(2001); dp[0] = 1; for (int i = 0; i <= 2000; i++) for (int j = 0; j <= i - 3; j++) { dp[i] += dp[j]; dp[i] % mod; } cout << dp[n]; return 0; }
#include <bits/stdc++.h> using namespace std; const int mod = 1000000007; int main() { int n; cin >> n; vector<long long> dp(2001); dp[0] = 1; for (int i = 0; i <= 2000; i++) for (int j = 0; j <= i - 3; j++) { dp[i] += dp[j]; dp[i] = dp[i] % mod; } cout << dp[n]; return 0; }
[["+", 8, 7, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 1, 0, 11, 12, 16, 31, 69, 28, 22], ["+", 0, 11, 12, 16, 31, 69, 341, 342, 0, 70], ["+", 0, 11, 12, 16, 31, 69, 341, 342, 0, 22], ["+", 0, 11, 12, 16, 31, 69, 341, 342, 0, 73]]
1
101
#include <bits/stdc++.h> using namespace std; template <typename A, typename B> string to_string(pair<A, B> p); template <typename A, typename B, typename C> string to_string(tuple<A, B, C> p); template <typename A, typename B, typename C, typename D> string to_string(tuple<A, B, C, D> p); string to_string(const st...
#include <bits/stdc++.h> using namespace std; template <typename A, typename B> string to_string(pair<A, B> p); template <typename A, typename B, typename C> string to_string(tuple<A, B, C> p); template <typename A, typename B, typename C, typename D> string to_string(tuple<A, B, C, D> p); string to_string(const st...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
1,001
/* When you are not practicing someone else is, and the day u meet them u will Lose. So, all you need is Practice, Practice and Practice. */ #include <bits/stdc++.h> using namespace std; #define int long long #define ld long double #define mp make_pair #define ff first #define ss second #define pb push_ba...
/* When you are not practicing someone else is, and the day u meet them u will Lose. So, all you need is Practice, Practice and Practice. */ #include <bits/stdc++.h> using namespace std; #define int long long #define ld long double #define mp make_pair #define ff first #define ss second #define pb push_ba...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20]]
1
860
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (ll i = 0; i < (ll)n; ++i) using P = pair<ll, ll>; const ll dv = 1000000007; // n^s mod dv ll pow2(ll n, ll s) { if (s == 0) return 1; if (s == 1) return n; ll tmp = pow2(n, s / 2); if (s % 2 == 0) { return t...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (ll i = 0; i < (ll)n; ++i) using P = pair<ll, ll>; const ll dv = 1000000007; // n^s mod dv ll pow2(ll n, ll s) { if (s == 0) return 1; if (s == 1) return n; ll tmp = pow2(n, s / 2); if (s % 2 == 0) { return t...
[["+", 0, 37, 0, 16, 31, 16, 31, 16, 17, 109], ["+", 0, 37, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 31, 2, 3, 4, 0, 16, 31, 16, 12, 22], ["+", 12, 16, 31, 2, 3, 4, 0, 16, 17, 33]]
1
279
#include <iostream> #define ll long long using namespace std; ll sum[2005]; // ll f[2005]; constexpr auto mod = 1000000000 + 7; int main() { int n; cin >> n; // f[1]=f[2]=0; // f[3]=f[4]=f[5]=1; sum[3] = 1, sum[4] = 2; sum[5] = 3; for (int i = 6; i <= n; i++) { sum[i] = (sum[i - 1] + sum[i - 3] + 1 + ...
#include <iostream> #define ll long long using namespace std; ll sum[2005]; // ll f[2005]; constexpr auto mod = 1000000000 + 7; int main() { int n; cin >> n; // f[1]=f[2]=0; // f[3]=f[4]=f[5]=1; sum[3] = 1, sum[4] = 2; sum[5] = 3; for (int i = 6; i <= n; i++) { sum[i] = (sum[i - 1] + sum[i - 3] + 1 + ...
[["+", 0, 16, 31, 16, 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, 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
124
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll s = 0; cin >> s; vector<ll> dp(s + 1, 0); dp[3] = 1; for (int i = 4; i <= s; i++) dp[i] = (dp[i - 1] + dp[i - 3]) % 1000000007; cout << dp[s] << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll s = 0; cin >> s; vector<ll> dp(2001, 0); dp[3] = 1; for (int i = 4; i <= s; i++) dp[i] = (dp[i - 1] + dp[i - 3]) % 1000000007; cout << dp[s] << endl; return 0; }
[["-", 0, 43, 49, 50, 51, 4, 0, 16, 31, 22], ["-", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["-", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13]]
1
95
s = int(input()) a = [0]*2001 a[3] = 1 for i in range(4,n+1): a[i] = a[i-3] + a[i-1] mod = 10**9+7 print(a[s]%mod)
s = int(input()) a = [0]*2001 a[3] = 1 for i in range(4,s+1): a[i] = a[i-3] + a[i-1] mod = 10**9+7 print(a[s]%mod)
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 31, 22]]
5
67