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 <iostream>
using namespace std;
long int mod = 1000000007;
int main() {
long int N;
cin >> N;
long int ans = 1, k = 1;
for (int i = 0; i < N; i++) {
k = k * 10 % mod;
}
ans = k;
k = 1;
for (int i = 0; i < N; i++) {
k = k * 9 % mod;
}
ans = (ans - k) % mod;
ans = (ans - k) % mod;... | #include <iostream>
using namespace std;
long int mod = 1000000007;
int main() {
long int N;
cin >> N;
long int ans = 1, k = 1;
for (int i = 0; i < N; i++) {
k = k * 10 % mod;
}
ans = k;
k = 1;
for (int i = 0; i < N; i++) {
k = k * 9 % mod;
}
ans = (ans - k) % mod;
ans = (ans - k) % mod;... | [["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]] | 1 | 156 |
N = int(input())
x = 10**9 + 7
a = 10**N % x
b = 2 * 9**N % x
c = 8**N % x
ans = a-b+c
print(ans) | N = int(input())
x = 10**9 + 7
a = 10**N % x
b = 2 * 9**N % x
c = 8**N % x
ans = (a-b+c)%x
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 | 49 |
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
#define rep(i, N) for (int i = 0; i < N; i++) // 0から
#define REP(i, N) for (int j = i; j < N; j++) // iから
typedef long long ll;
ll binary_search(vector<ll> a, ll n, ll key) {
ll right = n, left = -1... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
#define rep(i, N) for (int i = 0; i < N; i++) // 0から
#define REP(i, N) for (int j = i; j < N; j++) // iから
typedef long long ll;
ll binary_search(vector<ll> a, ll n, ll key) {
ll right = n, left = -1... | [["+", 0, 16, 31, 16, 31, 16, 31, 16, 31, 13], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 17, 48]] | 1 | 354 |
#include <bits/stdc++.h>
using namespace std;
#define JAM(x) cout << #x << " = " << x << "\n"
#define II() \
({ \
int a; ... | #include <bits/stdc++.h>
using namespace std;
#define JAM(x) cout << #x << " = " << x << "\n"
#define II() \
({ \
int a; ... | [["+", 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 | 576 |
import sys
sys.setrecursionlimit(2000)
N = int(input())
mod = 1000000007
def power(x, y):
if y == 0 : return 1
elif y == 1 : return x % mod
elif y % 2 == 0 : return power(x, y//2)**2 % mod
else : return power(x, y//2)**2 * x % mod
a = power(10, N)
b = power(9, N)
c = power(8, N... | import sys
sys.setrecursionlimit(2000)
N = int(input())
mod = 1000000007
def power(x, y):
if y == 0 : return 1
elif y == 1 : return x % mod
elif y % 2 == 0 : return power(x, y//2)**2 % mod
else : return power(x, y//2)**2 * x % mod
a = power(10, N)
b = power(9, N)
c = power(8, N... | [["+", 0, 657, 31, 657, 31, 657, 31, 23, 0, 24], ["+", 0, 657, 31, 23, 0, 657, 12, 23, 0, 25], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]] | 5 | 130 |
a = int(input())
b = 9**a - 2*(8**a) + 7**a
c = (10**9) + 7
print(b%c) | a = int(input())
b = 10**a - 2*(9**a) + 8**a
c = 10**9 + 7
print(b%c) | [["-", 0, 662, 12, 657, 31, 657, 31, 657, 31, 612], ["+", 0, 662, 12, 657, 31, 657, 31, 657, 31, 612], ["-", 31, 657, 12, 657, 12, 23, 0, 657, 31, 612], ["+", 31, 657, 12, 657, 12, 23, 0, 657, 31, 612], ["-", 0, 1, 0, 662, 12, 657, 12, 657, 31, 612], ["+", 0, 1, 0, 662, 12, 657, 12, 657, 31, 612], ["-", 0, 1, 0, 662, 1... | 5 | 40 |
from tqdm import tqdm
N = int(input())
if N == 1:
print(0)
exit()
Z = 10 ** 9 + 7
a = 1
b = 1
c = 1
for n in range(N):
a *= 10
b *= 9
c *= 8
a = a % Z
b = b % Z
c = c % Z
print((a - 2 * b + c) % Z) |
N = int(input())
if N == 1:
print(0)
exit()
Z = 10 ** 9 + 7
a = 1
b = 1
c = 1
for n in range(N):
a *= 10
b *= 9
c *= 8
a = a % Z
b = b % Z
c = c % Z
print((a - 2 * b + c) % Z) | [["-", 36, 36, 36, 36, 0, 656, 0, 686, 0, 314], ["-", 36, 36, 0, 656, 0, 686, 687, 673, 0, 22], ["-", 36, 36, 36, 36, 0, 656, 0, 686, 0, 487], ["-", 36, 36, 0, 656, 0, 686, 141, 673, 0, 22]] | 5 | 86 |
//設定言語check
#include <algorithm>
#include <bits/stdc++.h>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <queue>
#include <string>
using namespace std;
long long int power(long long int x, long long int y, long long int z) {
if (y == 1)
return (z * x) % 1000000007;
else i... | //設定言語check
#include <algorithm>
#include <bits/stdc++.h>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <queue>
#include <string>
using namespace std;
long long int power(long long int x, long long int y, long long int z) {
if (y == 1)
return (z * x) % 1000000007;
else i... | [["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]] | 1 | 224 |
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int MAX = 510000;
const ll mod = 1000000007;
int main() {
ll n;
cin >> n;
ll cn;
ll res;
if (n == 1) {
cout << 0;
} else {
ll total = 1;
ll znai = 1;
ll knai = 1;
ll rnai = 1;
for (int i = 0... | #include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int MAX = 510000;
const ll mod = 1000000007;
int main() {
ll n;
cin >> n;
ll cn;
ll res;
if (n == 1) {
cout << 0;
} else {
ll total = 1;
ll znai = 1;
ll knai = 1;
ll rnai = 1;
for (int i = 0... | [["+", 12, 16, 31, 16, 31, 16, 31, 16, 17, 72], ["+", 12, 16, 31, 16, 31, 16, 31, 16, 12, 22]] | 1 | 146 |
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define ll long long int
#define mod 1000000007
#define vec vector<long long int>
#define fi first
#define se second
#define pb push_back
int main() {
ll n;
cin >> n;
ll ans = 1;
ll a = 1;
ll c = 1;
for (ll i = 0; i < n; i++) {
ans = ((a... | #include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define ll long long int
#define mod 1000000007
#define vec vector<long long int>
#define fi first
#define se second
#define pb push_back
int main() {
ll n;
cin >> n;
ll ans = 1;
ll a = 1;
ll c = 1;
for (ll i = 0; i < n; i++) {
ans = ((a... | [["+", 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 | 170 |
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws FileNotFoundException {
// File file = new File("src/in.txt");
// Scanner sc = new Scanner(file);
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
... | import java.io.FileNotFoundException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws FileNotFoundException {
// File file = new File("src/in.txt");
// Scanner sc = new Scanner(file);
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
... | [["+", 31, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 31, 16, 31, 16, 31, 16, 31, 16, 17, 72], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 17, 72]] | 3 | 185 |
#define _GLIBCXX_DEBUG
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define r... | #define _GLIBCXX_DEBUG
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define r... | [["-", 8, 9, 0, 57, 64, 1, 0, 11, 31, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 31, 22]] | 1 | 171 |
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
#define int long long
using namespace std;
const int M = 1000000007;
int ksm(int a, int b) {
int res = 1;
while (b) {
if (b & 1)
res = res * a % M;
b >>= 1, a = a * a % M;
}
return res;
}
signed mai... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
#define int long long
using namespace std;
const int M = 1000000007;
int ksm(int a, int b) {
int res = 1;
while (b) {
if (b & 1)
res = res * a % M;
b >>= 1, a = a * a % M;
}
return res;
}
signed mai... | [["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 25], ["+", 0, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 0, 16, 31, 23, 0, 16, 31, 16, 12, 22]] | 1 | 133 |
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%mod - 2*9**N%mod + 8**N%mod)%mod) | [["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 0, 657, 31, 23, 0, 657, 12, 657, 17, 109], ["+", 0, 657, 31, 23, 0, 657, 12, 657, 12, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 25]] | 5 | 37 |
import java.io.*;
import java.math.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
PrintWriter ou = new PrintWriter(System.out);
int n = Integer.parseInt(sc.next());
sc.close();
long a = 1;
long b = 2;
long c = 1;
... | import java.io.*;
import java.math.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
PrintWriter ou = new PrintWriter(System.out);
int n = Integer.parseInt(sc.next());
sc.close();
long a = 1;
long b = 2;
long c = 1;
... | [["-", 8, 196, 0, 52, 15, 15, 0, 16, 17, 19], ["+", 8, 196, 0, 52, 15, 15, 0, 16, 17, 18]] | 3 | 236 |
#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int MAXN = 1e6 + 5;
long long n;
long long a, b, c;
int main() {
cin >> n;
a = 1;
b = 1;
c = 1;
for (int i = 1; i <= n; i++) {
a = (a * 10) % MOD;
b = (b * 9) % MOD;
c = (c * 8) % MOD;
}
cout << (a - 2 * b + c... | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int MAXN = 1e6 + 5;
long long n;
long long a, b, c;
int main() {
cin >> n;
a = 1;
b = 1;
c = 1;
for (int i = 1; i <= n; i++) {
a = (a * 10) % MOD;
b = (b * 9) % MOD;
c = (c * 8) % MOD;
}
cout << (a - 2 * b + c... | [["+", 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 | 122 |
// xenowitz -- Jai Shree Ram
#include <bits/stdc++.h>
using namespace std;
#define fori(i, a, b) for (long int i = a; i <= b; ++i)
#define ford(i, a, b) for (long int i = a; i >= b; --i)
#define mk make_pair
#define mod 1000000007
#define pb push_back
#define eb emplace_back
#define vec vector<long long int>
#define l... | // xenowitz -- Jai Shree Ram
#include <bits/stdc++.h>
using namespace std;
#define fori(i, a, b) for (long int i = a; i <= b; ++i)
#define ford(i, a, b) for (long int i = a; i >= b; --i)
#define mk make_pair
#define mod 1000000007
#define pb push_back
#define eb emplace_back
#define vec vector<long long int>
#define l... | [["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 72], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 22]] | 1 | 218 |
# -*- coding: utf-8 -*-
MOD=1000000007
x = int(input())
n1 = (10**x)%MOD
n2 = 2*9**x%MOD
n3 = 8**x%MOD
n = n1-n2+n3
print(int(n)) | # -*- coding: utf-8 -*-
MOD=1000000007
x = int(input())
n1 = (10**x)%MOD
n2 = 2*9**x%MOD
n3 = 8**x%MOD
n = (n1-n2+n3+MOD)%MOD
print(int(n)) | [["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 17, 72], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 12, 22], ["+", 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 | 51 |
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
#define mk make_pair
#define pk push_back
using namespace std;
typedef long long LL;
typedef pair<int, int> pi;
const int mod = 1e9 + 7;
int kpow(int a, int k) {
int res = 1;
for (; k; k >>= 1, a = 1ll * a * a % mod)
if (k & 1)
r... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
#define mk make_pair
#define pk push_back
using namespace std;
typedef long long LL;
typedef pair<int, int> pi;
const int mod = 1e9 + 7;
int kpow(int a, int k) {
int res = 1;
for (; k; k >>= 1, a = 1ll * a * a % mod)
if (k & 1)
r... | [["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13]] | 1 | 193 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 13;
const ll mod = 1e9 + 7;
ll a[maxn];
ll b[maxn];
ll c[maxn];
int main() {
ll n;
a[0] = b[0] = c[0] = 1ll;
for (int i = 1; i <= maxn; i++)
a[i] = 1ll * a[i - 1] * 10 % mod;
for (int i = 1; i <= maxn; i++)
b[i] =... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 13;
const ll mod = 1e9 + 7;
ll a[maxn];
ll b[maxn];
ll c[maxn];
int main() {
ll n;
a[0] = b[0] = c[0] = 1ll;
for (int i = 1; i <= maxn; i++)
a[i] = 1ll * a[i - 1] * 10 % mod;
for (int i = 1; i <= maxn; i++)
b[i] =... | [["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]] | 1 | 238 |
def power_func(a,n,p):
bi = str(format(n,"b"))#2進表現に
res = 1
for i in range(len(bi)):
res = (res*res) %p
if bi[i] == "1":
res = (res*a) %p
return res
p=10**9+7
n=int(input())
print(power_func(10,n,p)-power_func(9,n,p)-power_func(9,n,p)+power_func(8,n,p)) | def power_func(a,n,p):
bi = str(format(n,"b"))#2進表現に
res = 1
for i in range(len(bi)):
res = (res*res) %p
if bi[i] == "1":
res = (res*a) %p
return res
p=10**9+7
n=int(input())
print((power_func(10,n,p)-power_func(9,n,p)-power_func(9,n,p)+power_func(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 | 121 |
#include <bits/stdc++.h>
using namespace std;
long long m = 1e9 + 7;
typedef long long ll;
ll power(ll a, ll b) {
if (b == 0)
return 1;
ll temp = power(a, b / 2) % m;
if (b % 2 == 0)
return (temp * temp) % m;
else
return (((a * temp) % m) * temp) % m;
}
int main() {
ll n;
cin >> n;
ll x = (pow... | #include <bits/stdc++.h>
using namespace std;
long long m = 1e9 + 7;
typedef long long ll;
ll power(ll a, ll b) {
if (b == 0)
return 1;
ll temp = power(a, b / 2) % m;
if (b % 2 == 0)
return (temp * temp) % m;
else
return (((a * temp) % m) * temp) % m;
}
int main() {
ll n;
cin >> n;
ll x = (pow... | [["+", 31, 23, 0, 16, 31, 16, 12, 16, 31, 13], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 17, 48]] | 1 | 138 |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
private static class FastScanner {
private BufferedReader reader = null;
private StringTokenizer tokenizer = null;
public FastSca... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
private static class FastScanner {
private BufferedReader reader = null;
private StringTokenizer tokenizer = null;
public FastSca... | [["+", 0, 503, 49, 200, 51, 16, 31, 23, 0, 24], ["+", 0, 503, 49, 200, 51, 16, 31, 23, 0, 25], ["+", 8, 196, 0, 503, 49, 200, 51, 16, 17, 109], ["+", 8, 196, 0, 503, 49, 200, 51, 16, 12, 22]] | 3 | 465 |
N = int(input())
p = 10**9+7
ans = pow(10,N,p) + pow(8,N,p)-2*pow(9,N,p)
print(ans) | N = int(input())
p = 10**9+7
ans = pow(10,N,p) + pow(8,N,p)-2*pow(9,N,p)
ans %= p
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 | 49 |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
#define IO \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
#define IO \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | [["-", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89]] | 1 | 155 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
long long ans = 1, a = 1, b = 1, c = 1;
for (int i = 0; i < N; i++) {
a *= 10;
b *= 9;
c *= 8;
a %= 1000000007;
b %= 1000000007;
c %= 1000000007;
}
ans = a - 2 * b + c;
ans %= 1000000007;
if (ans > 0)
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
long long ans = 1, a = 1, b = 1, c = 1;
for (int i = 0; i < N; i++) {
a *= 10;
b *= 9;
c *= 8;
a %= 1000000007;
b %= 1000000007;
c %= 1000000007;
}
ans = a - 2 * b + c;
ans %= 1000000007;
if (ans >= 0)... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 48], ["-", 0, 16, 31, 16, 12, 16, 12, 23, 0, 24], ["-", 0, 16, 31, 16, 12, 16, 12, 23, 0, 13], ["-", 0, 16, 31, 16, 12, 16, 12, 23, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", ... | 1 | 114 |
// By Vasu Agrawal
#include <bits/stdc++.h>
#include <iostream>
typedef long long int ll;
#define pb push_back
#define pob pop_back
#define mk make_pair
#define fr first
#define sc second
#define pu push
#define ins insert
#define mod 1000000007
#define mem(a, val) memset(a, val, sizeof(a))
#define V(a) vector<a>
#defi... | // By Vasu Agrawal
#include <bits/stdc++.h>
#include <iostream>
typedef long long int ll;
#define pb push_back
#define pob pop_back
#define mk make_pair
#define fr first
#define sc second
#define pu push
#define ins insert
#define mod 1000000007
#define mem(a, val) memset(a, val, sizeof(a))
#define V(a) vector<a>
#defi... | [["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 72], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 22]] | 1 | 538 |
#include <bits/stdc++.h>
using namespace std;
// a^n mod を計算する
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 long n;
cin >> n;
cout << modpow(10... | #include <bits/stdc++.h>
using namespace std;
// a^n mod を計算する
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 long n;
cin >> n;
cout << (20000000... | [["+", 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], ["+", 31, 23, 0, 16, 12, 16, 31, 23, 0, 25], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13]] | 1 | 119 |
n = int(input())
a = 10**9+7
if n==1:
print(0)
else:
ans = 1
b = 1
c = 1
for _ in range(n):
b *= 9
c *= 8
b %= a
c %= a
ans *= 10
ans %= a
ans = ans-2*b+c
if ans<=0:
ans += a
print(ans) | n = int(input())
a = 10**9+7
if n==1:
print(0)
else:
ans = 1
b = 1
c = 1
for _ in range(n):
b *= 9
c *= 8
b %= a
c %= a
ans *= 10
ans %= a
ans = (ans-2*b+c)%a
if ans< 0:
ans += a
print(ans) | [["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 25], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 109], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 22], ["-", 75, 76, 8, 196, 0, 57, 15, 666, 667, 19], ["+", 75, 76, 8, 196, 0, 57, 15, 666, 667, 18]] | 5 | 82 |
#!/usr/bin/env python3
import sys
MOD = 1000000007 # type: int
def solve(N: int):
t = pow(10,N,MOD)- pow(8,N,MOD)
m = pow(10,N,MOD)- pow(9,N,MOD)
print(2*m-t)
return
# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this ... | #!/usr/bin/env python3
import sys
MOD = 1000000007 # type: int
def solve(N: int):
t = pow(10,N,MOD)- pow(8,N,MOD)
m = pow(10,N,MOD)- pow(9,N,MOD)
print((2*m-t)%MOD)
return
# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove... | [["+", 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 | 120 |
#include <bits/stdc++.h>
using namespace std;
long long pow(long long x, long long n, long long mod) {
long long res = 1;
while (n > 0) {
if (n & 1)
res = res * x % mod;
x = x * x % mod;
n >>= 1;
}
return res % mod;
}
int main() {
long long N;
cin >> N;
long long M = 1000000000 + 7;
l... | #include <bits/stdc++.h>
using namespace std;
long long pow(long long x, long long n, long long mod) {
long long res = 1;
while (n > 0) {
if (n & 1)
res = res * x % mod;
x = x * x % mod;
n >>= 1;
}
return res % mod;
}
int main() {
long long N;
cin >> N;
long long M = 1000000000 + 7;
l... | [["+", 0, 1, 0, 11, 12, 16, 12, 16, 31, 13], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 17, 48]] | 1 | 140 |
#include <cstdio>
#include <iostream>
using namespace std;
const int mod = 1e9 + 7;
int fpow(int x, int y) {
if (y < 0)
return 0;
int res = 1;
for (; y; y >>= 1, x = 1ll * x * x % mod)
if (y & 1)
res = 1ll * res * x % mod;
return res;
}
int main() {
int n;
cin >> n;
cout << ((1ll * fpow(10, ... | #include <cstdio>
#include <iostream>
using namespace std;
const int mod = 1e9 + 7;
int fpow(int x, int y) {
if (y < 0)
return 0;
int res = 1;
for (; y; y >>= 1, x = 1ll * x * x % mod)
if (y & 1)
res = 1ll * res * x % mod;
return res;
}
int main() {
int n;
cin >> n;
cout << (((1ll * fpow(10,... | [["+", 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], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 22]] | 1 | 134 |
package main
import (
"fmt"
)
var MOD = 1000000000 + 7
func main() {
var n int
fmt.Scan(&n)
ans := 1
for i := 0; i < n; i++ {
ans *= 10
ans %= MOD
}
tmp := 1
for i := 0; i < n; i++ {
tmp *= 9
tmp %= MOD
}
tmp *= 2
tmp %= MOD
ans -= tmp
tmp %= MOD
if 0 > tmp {
ans += MOD
}
tmp = 1
for i := ... | package main
import (
"fmt"
)
var MOD = 1000000000 + 7
func main() {
var n int
fmt.Scan(&n)
ans := 1
for i := 0; i < n; i++ {
ans *= 10
ans %= MOD
}
tmp := 1
for i := 0; i < n; i++ {
tmp *= 9
tmp %= MOD
}
tmp *= 2
tmp %= MOD
ans -= tmp
ans %= MOD
if 0 > ans {
ans += MOD
}
tmp = 1
for i := ... | [["-", 0, 435, 8, 196, 0, 436, 31, 432, 0, 22], ["+", 0, 435, 8, 196, 0, 436, 31, 432, 0, 22], ["-", 0, 435, 8, 196, 0, 57, 15, 16, 12, 22], ["+", 0, 435, 8, 196, 0, 57, 15, 16, 12, 22]] | 7 | 157 |
#include <algorithm>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <vector>
typedef long long ll;
typedef std::map<char, int> string_type;
typedef std::unordered_map<int, int> type_occu... | #include <algorithm>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <vector>
typedef long long ll;
typedef std::map<char, int> string_type;
typedef std::unordered_map<int, int> type_occu... | [["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 72], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 22]] | 1 | 353 |
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
int n;
cin >> n;
long long tot8 = 1;
long long tot9 = 1;
long long tot10 = 1;
for (int i = 0; i < n; i++) {
tot8 = (tot8 * 8) % mod;
tot9 = (tot9 * 9) % mod;
tot10 = (tot10 * 10) % mod;
}
tot9 = tot9 - tot8... | #include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
int n;
cin >> n;
long long tot8 = 1;
long long tot9 = 1;
long long tot10 = 1;
for (int i = 0; i < n; i++) {
tot8 = (tot8 * 8) % mod;
tot9 = (tot9 * 9) % mod;
tot10 = (tot10 * 10) % mod;
}
tot9 = tot9 - tot8... | [["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 72], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 22]] | 1 | 122 |
#include <iostream>
using namespace std;
using ll = long long;
ll modperm(ll n, ll r, ll d) {
return r == 0 ? 1 : n * modperm(n - 1, r - 1, d) % d;
}
ll modpow(ll a, ll p, ll d) {
return p == 0 ? 1
: p == 1 ? a % d
: p % 2 == 0 ? modpow(a, p / 2, d) * modpow(a, p / 2, d) % d
... | #include <iostream>
using namespace std;
using ll = long long;
ll modperm(ll n, ll r, ll d) {
return r == 0 ? 1 : n * modperm(n - 1, r - 1, d) % d;
}
ll modpow(ll a, ll p, ll d) {
return p == 0 ? 1
: p == 1 ? a % d
: p % 2 == 0 ? modpow(a, p / 2, d) * modpow(a, p / 2, d) % d
... | [["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13]] | 1 | 220 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define FOR(i, start, end) for (int i = start; i <= end; i++)
const int INF = 1001001001;
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
type... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define FOR(i, start, end) for (int i = start; i <= end; i++)
const int INF = 1001001001;
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
type... | [["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72]] | 1 | 669 |
/* Great things never come from comfort zones,
"whatever the mind of a man can conceive and believe,it can achieve." */
#include <bits/stdc++.h>
#define ll long long
#define scf(n) scanf("%d", &n)
#define lscf(n) scanf("%lld", &n)
#define lpri(n) printf("%lld ", n)
#define pri(n) printf("%d ", (int)n)
#define prin(n) ... | /* Great things never come from comfort zones,
"whatever the mind of a man can conceive and believe,it can achieve." */
#include <bits/stdc++.h>
#define ll long long
#define scf(n) scanf("%d", &n)
#define lscf(n) scanf("%lld", &n)
#define lpri(n) printf("%lld ", n)
#define pri(n) printf("%d ", (int)n)
#define prin(n) ... | [["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 17, 72], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 25]] | 1 | 498 |
#include <cmath>
#include <iostream>
using namespace std;
int main(void) {
// Your code here!
long long N, numA = 1, numB = 1, numC = 1;
long long ans = 0;
cin >> N;
if (N != 1) {
for (int n = 0; n < N; n++) {
numA = numA * 8;
numB = numB * 9;
numC = numC * 10;
if (numA > 1000000... | #include <cmath>
#include <iostream>
using namespace std;
int main(void) {
// Your code here!
long long N, numA = 1, numB = 1, numC = 1;
long long ans = 0;
cin >> N;
if (N != 1) {
for (int n = 0; n < N; n++) {
numA = numA * 8;
numB = numB * 9;
numC = numC * 10;
if (numA > 1000000... | [["+", 12, 16, 31, 16, 31, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 16, 31, 16, 12, 16, 17, 48]] | 1 | 159 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pi;
typedef vector<ll> vi;
typedef vector<pi> vpi;
typedef long double ld;
const int inf = 1e9 + 7;
const int mod = 1e9 + 7;
const int maxn = 1e6 + 3;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#de... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pi;
typedef vector<ll> vi;
typedef vector<pi> vpi;
typedef long double ld;
const int inf = 1e9 + 7;
const int mod = 1e9 + 7;
const int maxn = 1e6 + 3;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#de... | [["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22]] | 1 | 639 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll power(ll a, ll p) {
int m = 1e9 + 7;
ll res = 1;
for (int i = 0; i < p; i++) {
res = ((res % m) * (a % m)) % m;
}
return res % m;
}
int main() {
// #ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
// freopen("output.t... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
ll power(ll a, ll p) {
int m = 1e9 + 7;
ll res = 1;
for (int i = 0; i < p; i++) {
res = ((res % m) * (a % m)) % m;
}
return res % m;
}
int main() {
// #ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
// freopen("output.t... | [["+", 0, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 16, 12, 16, 31, 23, 0, 16, 12, 22]] | 1 | 160 |
import math
MOD = 10**9 + 7
def mod_pow(x, mod):
xx = [1, x]
def _pow(y, x=x):
nonlocal xx
if y == 0:
return 1
while len(xx) <= math.log(y, 2)+1:
v = xx[-1] * xx[-1]
v %= mod
xx.append(v)
i = 1
result = 1
while y > ... | import math
MOD = 10**9 + 7
def mod_pow(x, mod):
xx = [1, x]
def _pow(y, x=x):
nonlocal xx
if y == 0:
return 1
while len(xx) <= math.log(y, 2)+1:
v = xx[-1] * xx[-1]
v %= mod
xx.append(v)
i = 1
result = 1
while y > ... | [["+", 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 | 206 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
if (n < 2) {
cout << 0 << '\n';
} else if (n == 2) {
cout << 2 << '\n';
} else {
int mod = 1e9 + 7;
int x = 1, y = 1, z = 1;
for (int i = 0... | #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
if (n < 2) {
cout << 0 << '\n';
} else if (n == 2) {
cout << 2 << '\n';
} else {
int mod = 1e9 + 7;
int x = 1, y = 1, z = 1;
for (int i = 0... | [["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13]] | 1 | 182 |
package main
import "fmt"
const MOD = 1000000007
func pow(x, n int64) int64 {
ret := int64(1)
for i := int64(0); i < n; i++ {
ret *= x
ret %= MOD
}
return ret
}
func main() {
var n int64
fmt.Scan(&n)
ans := (pow(10, n) - 2*pow(9, n) + pow(8, n) + MOD) % MOD
fmt.Println(ans)
}
| package main
import "fmt"
const MOD = 1000000007
func pow(x, n int64) int64 {
ret := int64(1)
for i := int64(0); i < n; i++ {
ret *= x
ret %= MOD
}
return ret
}
func main() {
var n int64
fmt.Scan(&n)
ans := (pow(10, n) - 2*pow(9, n)%MOD + pow(8, n) + MOD) % MOD
fmt.Println(ans)
}
| [["+", 0, 16, 31, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 16, 31, 16, 31, 16, 12, 16, 12, 22]] | 7 | 117 |
#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
const long long Mo = 1000000007;
long long gcn(long long x, long long y) {
if (x % y == 0) {
return y;
} else {
return gcn(y, x % y);
}
}
long long modpow(long long a, long long n, long long mod) {
long long res = 1;
whil... | #include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
const long long Mo = 1000000007;
long long gcn(long long x, long long y) {
if (x % y == 0) {
return y;
} else {
return gcn(y, x % y);
}
}
long long modpow(long long a, long long n, long long mod) {
long long res = 1;
whil... | [["+", 0, 1, 0, 11, 12, 16, 12, 16, 31, 13], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 17, 48]] | 1 | 244 |
MOD=10**9+7
lim=200000
inv_t = [-1 for i in range(lim+1)]
factrial = [-1 for i in range(lim+1)]
factrial_inv = [-1 for i in range(lim+1)]
def mod_inv(x, mod=MOD):
y, u, v, _x = mod, 1, 0, x
while y:
t = _x//y
_x -= t*y
_x, y = y, _x
u -= t*v
u, v = v, u
u %= mod
... | MOD=10**9+7
lim=200000
inv_t = [-1 for i in range(lim+1)]
factrial = [-1 for i in range(lim+1)]
factrial_inv = [-1 for i in range(lim+1)]
def mod_inv(x, mod=MOD):
y, u, v, _x = mod, 1, 0, x
while y:
t = _x//y
_x -= t*y
_x, y = y, _x
u -= t*v
u, v = v, u
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 | 373 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
long long x, y, z;
long long M = 1000000007;
cin >> N;
x = 1, y = 1, z = 2;
for (int i = 0; i < N; ++i) {
x = ((x % M) * 10) % M;
y = ((y % M) * 8) % M;
z = ((z % M) * 9) % M;
}
cout << (x - z + y) % M << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
long long x, y, z;
long long M = 1000000007;
cin >> N;
x = 1, y = 1, z = 2;
for (int i = 0; i < N; ++i) {
x = ((x % M) * 10) % M;
y = ((y % M) * 8) % M;
z = ((z % M) * 9) % M;
}
cout << (x - z + y + M) % M << endl;
}
| [["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 22]] | 1 | 117 |
#include <bits/stdc++.h>
#define ll unsigned long long int
using namespace std;
int main() {
ll n, i, a = 1, b = 1, c = 1, ans = 0, mod = 1e9 + 7;
cin >> n;
for (i = 1; i <= n; i++) {
a = ((a * 10) + mod) % mod;
b = ((b * 9) + mod) % mod;
c = ((c * 8) + mod) % mod;
}
ans = (a + c - b - b + mod) % ... | #include <bits/stdc++.h>
#define ll unsigned long long int
using namespace std;
int main() {
ll n, i, a = 1, b = 1, c = 1, ans = 0, mod = 1e9 + 7;
cin >> n;
for (i = 1; i <= n; i++) {
a = ((a * 10) + mod) % mod;
b = ((b * 9) + mod) % mod;
c = ((c * 8) + mod) % mod;
}
ans = (a + c - b - b + 5 * mod... | [["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]] | 1 | 126 |
#include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
using ll = long long;
int main() {
ll n, c1, c2, c3;
int mod = 1000000007;
cin >> n;
if (n < 2) {
cout << 0 << endl;
return 0;
}
c1 = 2;
c2 = 36;
c3 = 64;
for (int i = 2; i < n; i++) {
c1 = c1 * 10 + c2... | #include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
using ll = long long;
int main() {
ll n, c1, c2, c3;
int mod = 1000000007;
cin >> n;
if (n < 2) {
cout << 0 << endl;
return 0;
}
c1 = 2;
c2 = 34;
c3 = 64;
for (int i = 2; i < n; i++) {
c1 = c1 * 10 + c2... | [["-", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13]] | 1 | 145 |
// Problem : C - Ubiquity
// Contest : AtCoder - AtCoder Beginner Contest 178
// URL : https://atcoder.jp/contests/abc178/tasks/abc178_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
/*ヽ`、ヽ``、ヽ`ヽ`、、ヽ `ヽ 、ヽ`🌙`ヽヽ`ヽ、ヽ`
ヽ`、ヽ``、ヽ 、``、 `、ヽ` 、` ヽ`ヽ、ヽ `、ヽ``、... |
// Problem : C - Ubiquity
// Contest : AtCoder - AtCoder Beginner Contest 178
// URL : https://atcoder.jp/contests/abc178/tasks/abc178_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
/*ヽ`、ヽ``、ヽ`ヽ`、、ヽ `ヽ 、ヽ`🌙`ヽヽ`ヽ、ヽ`
ヽ`、ヽ``、ヽ 、``、 `、ヽ` 、` ヽ`ヽ、ヽ `、ヽ``、... | [["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 13], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 48], ["+", 0, 1, 0, 11, 12, 16, 12, 74, 0, 24], ["+", 0, 11, 12, 16, 12, 74, 39, 77, 39, 78], ["+", 0, 1, 0, 11, 12, 16, 12, 74, 0, 25]] | 1 | 506 |
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const ll mod = 1000000000 + 7;
int main() {
ll N;
cin >> N;
ll a = 1;
ll b = 1;
ll c = 1;
ll ans = 0;
for (ll i = 0; i < N; ++i) {
a = (a * 10) % mod;
// cout<<a<<endl;
b = (b * 9) % mod;
// cout<<b<<endl;
c = (c... | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const ll mod = 1000000000 + 7;
int main() {
ll N;
cin >> N;
ll a = 1;
ll b = 1;
ll c = 1;
ll ans = 0;
for (ll i = 0; i < N; ++i) {
a = (a * 10) % mod;
// cout<<a<<endl;
b = (b * 9) % mod;
// cout<<b<<endl;
c = (c... | [["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]] | 1 | 123 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (uint64_t i = 0; i < n; i++)
int main() {
uint64_t n;
cin >> n;
int64_t r10 = 1;
int64_t r8 = 1;
int64_t r9 = -2;
rep(i, n) {
r10 = (r10 * 10) % 1000000007;
r8 = (r8 * 8) % 1000000007;
r9 = (r9 * 9) % 1000000007;
}
cout << ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (uint64_t i = 0; i < n; i++)
int main() {
uint64_t n;
cin >> n;
uint64_t r10 = 1;
uint64_t r8 = 1;
uint64_t r9 = 1000000005;
rep(i, n) {
r10 = (r10 * 10) % 1000000007;
r8 = (r8 * 8) % 1000000007;
r9 = (r9 * 9) % 1000000007;
}... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]] | 1 | 94 |
#include <bits/stdc++.h>
using namespace std;
// c++ templte for
// help............................................................................................................................................
typedef long long ll;
template <typename... T> void print1(T... t) { ((cout << t << " "), ...); }
temp... | #include <bits/stdc++.h>
using namespace std;
// c++ templte for
// help............................................................................................................................................
typedef long long ll;
template <typename... T> void print1(T... t) { ((cout << t << " "), ...); }
temp... | [["+", 0, 16, 31, 16, 31, 16, 31, 16, 17, 109], ["+", 0, 16, 31, 16, 31, 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]] | 1 | 651 |
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSe... |
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSe... | [["-", 0, 195, 8, 196, 0, 503, 49, 200, 51, 499], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 500, 22], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 0, 131], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 0, 503, 49, 200, 51, 492, 3, 4, 0, 24], ["+", 0, 503, 49, 200, 51, 492, 3, 4, 0, 25]] | 3 | 722 |
#include <bits/stdc++.h>
using namespace std;
#define fio() \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define md 1000000007
#define mem(arr, x) memset(arr, x, sizeof(arr))
#define pb push_back
#d... | #include <bits/stdc++.h>
using namespace std;
#define fio() \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define md 1000000007
#define mem(arr, x) memset(arr, x, sizeof(arr))
#define pb push_back
#d... | [["+", 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], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 22]] | 1 | 228 |
n = int(input())
if n == 1:
print(0)
mod = 10 ** 9 + 7
ans = pow(10, n, mod) - 2 * pow(9, n, mod) + pow(8, n, mod)
ans %= mod
print(ans)
| n = int(input())
if n == 1:
print(0)
exit(0)
mod = 10 ** 9 + 7
ans = pow(10, n, mod) - 2 * pow(9, n, mod) + pow(8, n, mod)
ans %= mod
print(ans)
| [["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 61 |
#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long pot(long long a, long long b) {
if (b <= 0)
return 1;
if (b % 2 == 0) {
long long cur = pot(a, b / 2);
return (cur * cur) % mod;
} else
return (pot(a, b - 1) * a) % mod;
}
int main() {
long long wyn = 2;
long... | #include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long pot(long long a, long long b) {
if (b <= 0)
return 1;
if (b % 2 == 0) {
long long cur = pot(a, b / 2);
return (cur * cur) % mod;
} else
return (pot(a, b - 1) * a) % mod;
}
int main() {
long long wyn = 2;
long... | [["+", 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 | 158 |
#include <iostream>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
int n;
cin >> n;
long long a, b, t, s;
a = 1;
b = 1;
t = 1;
s = 1;
for (int i = 0; i < n; i++) {
a = a * 9 % mod;
b = b * 9 % mod;
t = t * 10 % mod;
s = s * 8 % mod;
}
long long ans;
ans = (t + ... | #include <iostream>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
int n;
cin >> n;
long long a, b, t, s;
a = 1;
b = 1;
t = 1;
s = 1;
for (int i = 0; i < n; i++) {
a = a * 9 % mod;
b = b * 9 % mod;
t = t * 10 % mod;
s = s * 8 % mod;
}
long long ans;
ans = (t + ... | [["+", 12, 16, 31, 23, 0, 16, 12, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 17, 48], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 12, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 23, 0, 25]] | 1 | 126 |
#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>;
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) {
... | #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>;
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) {
... | [["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 12, 23, 0, 25]] | 1 | 628 |
#include <iostream>
long long int const mod = 1e9 + 7;
using namespace std;
int main() {
int n;
cin >> n;
long long int first = 1;
long long int second = 1;
long long int third = 1;
for (int i = 0; i < n; i++) {
first *= 10;
second *= 9;
third *= 8;
first %= mod;
second %= mod;
third... | #include <iostream>
long long int const mod = 1e9 + 7;
using namespace std;
int main() {
int n;
cin >> n;
long long int first = 1;
long long int second = 1;
long long int third = 1;
for (int i = 0; i < n; i++) {
first *= 10;
second *= 9;
third *= 8;
first %= mod;
second %= mod;
third... | [["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 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>
using namespace std;
#define int long long
#define forn(i, a, n) for (int i = a; i < n; i++)
const int mod = 1e9 + 7;
int n;
int x = 1, y = 1, z = 1;
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define forn(i, a, n) for (int i = a; i < n; i++)
const int mod = 1e9 + 7;
int n;
int x = 1, y = 1, z = 1;
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
... | [["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22]] | 1 | 134 |
#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 9999999999999999;
using ll = long long;
int main() {
ll N;
cin >> N;
ll ans = 10;
ll ans2 = 8;
ll ans3 = 9;
for (ll i = 1; i < N; i++) {
ans *= 10;
ans = ans % MOD;
ans2 *= 8;
ans2 = ans2 % ... | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 9999999999999999;
using ll = long long;
int main() {
ll N;
cin >> N;
ll ans = 10;
ll ans2 = 8;
ll ans3 = 9;
for (ll i = 1; i < N; i++) {
ans *= 10;
ans = ans % MOD;
ans2 *= 8;
ans2 = ans2 % ... | [["+", 31, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 16, 17, 72]] | 1 | 164 |
n = int(869121)
ans = 10**n - 9**n - 9**n + 8**n
print(ans % (10**9 + 7)) | n = int(input())
ans = 10**n - 9**n - 9**n + 8**n
print(ans % (10**9 + 7)) | [["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 612], ["+", 0, 662, 12, 652, 3, 4, 0, 652, 63, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 35 |
#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y, long long int p) {
long long int res = 1;
x = x % p;
if (x == 0)
return 0;
while (y > 0) {
if (y & 1)
res = (res * x) % p;
y = y >> 1;
x = (x * x) % p;
}
return res;
}
int main() {
cin... | #include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y, long long int p) {
long long int res = 1;
x = x % p;
if (x == 0)
return 0;
while (y > 0) {
if (y & 1)
res = (res * x) % p;
y = y >> 1;
x = (x * x) % p;
}
return res;
}
int main() {
cin... | [["+", 0, 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 | 174 |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
ll n;
cin >> n;
ll e = 1000000007, f0 = 1, f9 = 1, f8 = 1;
while (n) {
f0 *= 10;
f0 %= e;
f9 *= 9;
f9 %= e;
f8 *= 8;
f8 %= e;
n--;
}
cout << (f0 - f9 - f9 + f8) % e << endl;
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
ll n;
cin >> n;
ll e = 1000000007, f0 = 1, f9 = 1, f8 = 1;
while (n) {
f0 *= 10;
f0 %= e;
f9 *= 9;
f9 %= e;
f8 *= 8;
f8 %= e;
n--;
}
cout << (f0 - f9 - f9 + f8 + e + e) % e << endl;
}
| [["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 72], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 22]] | 1 | 91 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < int(n); i++)
using namespace std;
typedef long long ll;
int main() {
int n;
cin >> n;
ll mod = 1000000007;
ll a = 1, b = 1, c = 1, ans = 0;
rep(i, n) {
a = (a * 10) % mod;
b = (b * 8) % mod;
c = (c * 9) % mod;
}
c = (c * 2) % mod... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < int(n); i++)
using namespace std;
typedef long long ll;
int main() {
int n;
cin >> n;
ll mod = 1000000007;
ll a = 1, b = 1, c = 1, ans = 0;
rep(i, n) {
a = (a * 10) % mod;
b = (b * 8) % mod;
c = (c * 9) % mod;
}
c = (c * 2) % mod... | [["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22]] | 1 | 124 |
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define min_3(a, b, c) min(a, min(b, c))
#define max_3(a, b, c) max(a, max(b, c))
#define nout(ans) cout << (ans) << "\n"
#define sout(ans) cout << (ans) << " "
using namespace std;
const double pi = 3.1415926... | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define min_3(a, b, c) min(a, min(b, c))
#define max_3(a, b, c) max(a, max(b, c))
#define nout(ans) cout << (ans) << "\n"
#define sout(ans) cout << (ans) << " "
using namespace std;
const double pi = 3.1415926... | [["+", 0, 11, 12, 23, 0, 16, 12, 16, 17, 109], ["+", 0, 11, 12, 23, 0, 16, 12, 16, 12, 22]] | 1 | 360 |
n = int(input())
MOD = 10**9 + 7
if n == 1:
print(0)
elif n == 2:
print(1)
else:
ans = pow(10, n, MOD) + pow(8, n, MOD) - 2 * pow(9, n, MOD)
print(ans % MOD) | n = int(input())
MOD = 10**9 + 7
if n == 1:
print(0)
elif n == 2:
print(2)
else:
ans = pow(10, n, MOD) + pow(8, n, MOD) - 2 * pow(9, n, MOD)
print(ans % MOD) | [["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]] | 5 | 71 |
N = int(input())
MOD = 10 ** 9 + 7
MAX = 10 ** 6 + 1000
fact = [0] * MAX
invfact = [0] * MAX
fact[0] = 1
for i in range(1, MAX):
fact[i] = fact[i - 1] * i % MOD
invfact[MAX - 1] = pow(fact[MAX - 1], MOD-2, MOD)
for i in range(MAX - 2, -1, -1):
invfact[i] = invfact[i+1] * (i+1) % MOD
def nCk(n, k):
if k < 0... | N = int(input())
MOD = 10 ** 9 + 7
MAX = 10 ** 6 + 1000
fact = [0] * MAX
invfact = [0] * MAX
fact[0] = 1
for i in range(1, MAX):
fact[i] = fact[i - 1] * i % MOD
invfact[MAX - 1] = pow(fact[MAX - 1], MOD-2, MOD)
for i in range(MAX - 2, -1, -1):
invfact[i] = invfact[i+1] * (i+1) % MOD
def nCk(n, k):
if k < 0... | [["+", 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 | 271 |
#include <bits/stdc++.h>
using namespace std;
long long n, ans, ans1, mod = 1000000007;
long long qpow(int p, int a) {
if (p == 0)
return 1ll;
long long k = qpow(p / 2, a);
if (p & 1)
return ((k * k) % mod * a) % mod;
return (k * k) % mod;
}
int main() {
cin >> n;
if (n == 1 || n == 2) {
cout <<... | #include <bits/stdc++.h>
using namespace std;
long long n, ans, ans1, mod = 1000000007;
long long qpow(int p, int a) {
if (p == 0)
return 1ll;
long long k = qpow(p / 2, a);
if (p & 1)
return ((k * k) % mod * a) % mod;
return (k * k) % mod;
}
int main() {
cin >> n;
if (n == 1 || n == 2) {
cout <<... | [["+", 31, 23, 0, 16, 31, 16, 12, 16, 17, 48], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 12, 13]] | 1 | 153 |
#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
typedef long long ll;
ll mod_pow(ll x, ll n, ll mod) {
ll res = 1;
while (n > 0) {
if (n & 1)
res = res * x % mod; // 最下位ビットが立っているときに x^(2^i) を掛ける
x = x * x % mod; // x を順次二乗していく
n >>= 1;
}
return res;
}
void ... | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
typedef long long ll;
ll mod_pow(ll x, ll n, ll mod) {
ll res = 1;
while (n > 0) {
if (n & 1)
res = res * x % mod; // 最下位ビットが立っているときに x^(2^i) を掛ける
x = x * x % mod; // x を順次二乗していく
n >>= 1;
}
return res;
}
void ... | [["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13]] | 1 | 160 |
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <queue>
#include <vector>
using namespace std;
int main() {
long long int n, a = 1, b = 1, c = 1;
cin >> n;
for (long long int i = 0; i < n; i++) {
a *= 10;
c *= 9;
b *= 8;
a %= 1000000007;
b %= 1000000007;... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <queue>
#include <vector>
using namespace std;
int main() {
long long int n, a = 1, b = 1, c = 1;
cin >> n;
for (long long int i = 0; i < n; i++) {
a *= 10;
c *= 9;
b *= 8;
a %= 1000000007;
b %= 1000000007;... | [["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13]] | 1 | 106 |
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
const long long P = 1000000007;
int main() {
long long n;
cin >> n;
long long a = 1, b = 1, c = 1;
for (int i = 0; i < n; i++) {
a *= 10;
a %= P;
b *= 8;
b %= P;
c *= 9;
c %= P;
}
long long ans = a + b... | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
const long long P = 1000000007;
int main() {
long long n;
cin >> n;
long long a = 1, b = 1, c = 1;
for (int i = 0; i < n; i++) {
a *= 10;
a %= P;
b *= 8;
b %= P;
c *= 9;
c %= P;
}
long long ans = 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 | 116 |
def main():
INF = int(1e9+7)
N = int(input())
ans_total = 1
ans1 = 1
ans2 = 1
if N <= 1:
print(0)
return
for i in range(N):
ans_total = ans_total * 10
ans1 = ans1 * 9
ans2 = ans2 * 8
ans_total = ans_total % INF
ans1 = ans1 % INF
... | def main():
INF = int(1e9+7)
N = int(input())
ans_total = 1
ans1 = 1
ans2 = 1
if N <= 1:
print(0)
return
for i in range(N):
ans_total = ans_total * 10
ans1 = ans1 * 9
ans2 = ans2 * 8
ans_total = ans_total % INF
ans1 = ans1 % INF
... | [["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["-", 0, 657, 12, 657, 31, 23, 0, 657, 17, 109], ["-", 0, 657, 12, 657, 31, 23, 0, 657, 12, 22], ["+", 0, 657, 31, 23, 0, 657, 12, 23, 0, 25]] | 5 | 106 |
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#define _USE_MATH_DEFINES
#include <math.h>
using namespace std;
#define rep(i, n) for (i = 0; i < n; i++)
#define repl(k, n) for (k = 0; k < n; ++k)
int main() {
long long int N;
cin >> N;
int i;
... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#define _USE_MATH_DEFINES
#include <math.h>
using namespace std;
#define rep(i, n) for (i = 0; i < n; i++)
#define repl(k, n) for (k = 0; k < n; ++k)
int main() {
long long int N;
cin >> N;
int i;
... | [["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 13], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 48], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 174 |
N = int(input())
num, num2,num3 = 1, 1, 1
for _ in range(N):
num = num * 10 % 1000000007
num2 = num2 * 9 % 1000000007
num3 = num3 * 8 % 1000000007
print(num - num2 * 2 + num3 % 1000000007)
|
N = int(input())
num, num2,num3 = 1, 1, 1
for _ in range(N):
num = num * 10 % 1000000007
num2 = num2 * 9 % 1000000007
num3 = num3 * 8 % 1000000007
print((num - num2 * 2 + num3) % 1000000007)
| [["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 25]] | 5 | 60 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
ll ksm(ll a, ll b) {
ll rul = 1;
while (b) {
if (b & 1)
rul = rul * a % mod;
b >>= 1;
a = a * a % mod;
}
return rul;
}
int main() {
ll n;
cin >> n;
ll ans = (ksm(10, n) - 2 * ksm(9, n) + ksm... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
ll ksm(ll a, ll b) {
ll rul = 1;
while (b) {
if (b & 1)
rul = rul * a % mod;
b >>= 1;
a = a * a % mod;
}
return rul;
}
int main() {
ll n;
cin >> n;
ll ans = ((ksm(10, n) - 2 * ksm(9, n) + ks... | [["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 25], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 12, 22], ["+", 51, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 51, 16, 31, 23, 0, 16, 31, 16, 12, 22]] | 1 | 122 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
const int M = 1e5 + 10;
const int INF = 0x3f3f3f3f;
#defin... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
const int M = 1e5 + 10;
const int INF = 0x3f3f3f3f;
#defin... | [["+", 31, 23, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 12, 22]] | 1 | 316 |
#include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#define ll long long
using namespace std;
typedef pair<int, int> P;
ll mod = 1000000007;
int main() {
ll n;
cin >> n;
if (n == 1) {
cout << 0 << endl;
return 0;
} else {
ll a = 1, b = 1, c = 1;
for ... | #include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#define ll long long
using namespace std;
typedef pair<int, int> P;
ll mod = 1000000007;
int main() {
ll n;
cin >> n;
if (n == 1) {
cout << 0 << endl;
return 0;
} else {
ll a = 1, b = 1, c = 1;
for ... | [["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 33], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72]] | 1 | 173 |
#include <iostream>
constexpr static long long MOD = 1e9 + 7;
constexpr long long fastpow_mod(long long base, unsigned long long exp,
long long mod) {
base %= mod;
if (exp == 0)
return 1LL;
if (exp == 1)
return base;
long long pow = 1;
while (exp > 0) {
if (exp &... | #include <iostream>
constexpr static long long MOD = 1e9 + 7;
constexpr long long fastpow_mod(long long base, unsigned long long exp,
long long mod) {
base %= mod;
if (exp == 0)
return 1LL;
if (exp == 1)
return base;
long long pow = 1;
while (exp > 0) {
if (exp &... | [["+", 51, 23, 0, 16, 31, 16, 31, 16, 17, 72], ["+", 51, 23, 0, 16, 31, 16, 31, 16, 12, 22]] | 1 | 234 |
#include <bits/stdc++.h>
#define S second
#define F first
#define FASTIO \
ios_base::sync_with_stdio(false); \
cin.tie(false); \
cout.tie(0)
#defi... | #include <bits/stdc++.h>
#define S second
#define F first
#define FASTIO \
ios_base::sync_with_stdio(false); \
cin.tie(false); \
cout.tie(0)
#defi... | [["+", 0, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 16, 12, 16, 31, 23, 0, 16, 12, 22]] | 1 | 187 |
#include <bits/stdc++.h>
using namespace std;
long long tmp = 1e9 + 7;
int main() {
int N;
cin >> N;
long long amari_10 = 1;
long long amari_9 = 1;
long long amari_8 = 1;
for (int i = 0; i < N; i++) {
amari_10 = (amari_10 * 10) % tmp;
amari_9 = (amari_9 * 9) % tmp;
amari_8 = (amari_8 * 8) % tm... | #include <bits/stdc++.h>
using namespace std;
long long tmp = 1e9 + 7;
int main() {
int N;
cin >> N;
long long amari_10 = 1;
long long amari_9 = 1;
long long amari_8 = 1;
for (int i = 0; i < N; i++) {
amari_10 = (amari_10 * 10) % tmp;
amari_9 = (amari_9 * 9) % tmp;
amari_8 = (amari_8 * 8) % tm... | [["+", 51, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 51, 16, 31, 23, 0, 16, 12, 16, 17, 48]] | 1 | 116 |
#include <bits/stdc++.h>
#include <stdio.h>
#include <string.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define pii pair<ll, ll>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define rep(i, t, n) for (int i = ... | #include <bits/stdc++.h>
#include <stdio.h>
#include <string.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define pii pair<ll, ll>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define rep(i, t, n) for (int i = ... | [["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]] | 1 | 196 |
import java.util.*;
import java.util.Map.Entry;
class Main {
static int mod = (int)(Math.pow(10, 9) + 7);
// static int mod = (int) 998244353;
static List<ArrayList<Integer>> list = new ArrayList<ArrayList<Integer>>();
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
lo... | import java.util.*;
import java.util.Map.Entry;
class Main {
static int mod = (int)(Math.pow(10, 9) + 7);
// static int mod = (int) 998244353;
static List<ArrayList<Integer>> list = new ArrayList<ArrayList<Integer>>();
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
lo... | [["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22]] | 3 | 208 |
// fuck rating
// experience matters
#include <bits/stdc++.h>
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0)... | // fuck rating
// experience matters
#include <bits/stdc++.h>
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0)... | [["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 25], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 12, 22], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22]] | 1 | 803 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 1000000007;
int ksm(int b, int p) {
int ans = 1;
for (; p; p >>= 1) {
if (p & 1)
ans = ans * b % mod;
b = b * b % mod;
}
return ans;
}
signed main() {
int n, i;
cin >> n;
if (n == 1)
cout << 0;
else
... | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 1000000007;
int ksm(int b, int p) {
int ans = 1;
for (; p; p >>= 1) {
if (p & 1)
ans = ans * b % mod;
b = b * b % mod;
}
return ans;
}
signed main() {
int n, i;
cin >> n;
if (n == 1)
cout << 0;
else
... | [["+", 31, 23, 0, 16, 31, 16, 31, 16, 17, 72], ["+", 31, 23, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 31, 16, 31, 23, 0, 16, 31, 16, 17, 72], ["+", 31, 16, 31, 23, 0, 16, 31, 16, 12, 22]] | 1 | 131 |
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
ll n;
cin >> n;
ll mod = 1e9 + 7;
ll a... | #include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
ll n;
cin >> n;
ll mod = 1e9 + 7;
ll a... | [["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48]] | 1 | 152 |
(N,) = [int(x) for x in input().split()]
MOD = 10 ** 9 + 7
if N <= 1:
print(1)
exit()
else:
total = pow(10, N, MOD)
noZeroes = pow(9, N, MOD)
noNines = pow(9, N, MOD)
noZeroOrNines = pow(8, N, MOD)
print((total - noZeroes - noNines + noZeroOrNines) % MOD)
| (N,) = [int(x) for x in input().split()]
MOD = 10 ** 9 + 7
if N <= 1:
print(0)
exit()
else:
total = pow(10, N, MOD)
noZeroes = pow(9, N, MOD)
noNines = pow(9, N, MOD)
noZeroOrNines = pow(8, N, MOD)
print((total - noZeroes - noNines + noZeroOrNines) % MOD)
| [["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]] | 5 | 96 |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
#define endl '\n'
#define pb push_back
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
typedef long long ll;
typedef long... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
#define endl '\n'
#define pb push_back
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
typedef long long ll;
typedef long... | [["+", 31, 23, 0, 16, 31, 16, 12, 23, 0, 24], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 22], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 25], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 17, 109]] | 1 | 373 |
#include <bits/stdc++.h>
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
#define repm(i, a, b) for (ll i = (ll)(a); i > (ll)(b); i--)
#define all(v) v.begin(), v.end()
#define rall(x) (x).rbegin(), (x).rend()
#define pll pair<long long... | #include <bits/stdc++.h>
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
#define repm(i, a, b) for (ll i = (ll)(a); i > (ll)(b); i--)
#define all(v) v.begin(), v.end()
#define rall(x) (x).rbegin(), (x).rend()
#define pll pair<long long... | [["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13]] | 1 | 357 |
N = int(input())
M = 10**9+7
print(pow(10, N, M)-pow(9, N, M)*2+pow(8, N, M))
| N = int(input())
M = 10**9+7
print((pow(10, N, M)-pow(9, N, M)*2+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 | 46 |
// Problem : C - Ubiquity
// Contest : AtCoder - AtCoder Beginner Contest 178
// URL : https://atcoder.jp/contests/abc178/tasks/abc178_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
// 私に忍び寄るのをやめてください、ありがとう
#include <bits/stdc++.h>
using namespace s... |
// Problem : C - Ubiquity
// Contest : AtCoder - AtCoder Beginner Contest 178
// URL : https://atcoder.jp/contests/abc178/tasks/abc178_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
// 私に忍び寄るのをやめてください、ありがとう
#include <bits/stdc++.h>
using namespace s... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 1,035 |
N = int(input())
mod = 10 ** 9 + 7
#10 ** N - 2 * (9 ** N) + (8 ** N)
ten = 1
nine = 1
eight = 1
for i in range(N):
ten *= 10
ten %= mod
nine *= 9
nine %= mod
eight *= 8
eight %= mod
ans = ten - 2 * nine + eight
print(ans)
| N = int(input())
mod = 10 ** 9 + 7
#10 ** N - 2 * (9 ** N) + (8 ** N)
ten = 1
nine = 1
eight = 1
for i in range(N):
ten *= 10
ten %= mod
nine *= 9
nine %= mod
eight *= 8
eight %= mod
ans = ten - 2 * nine + eight
print(ans % mod)
| [["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]] | 5 | 64 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int MOD = 1e9 + 7;
int main() {
int n;
cin >> n;
ll r8 = 1, r9 = 1, r10 = 1;
for (int i = 0; i < n; i++) {
(r8 *= 8) %= MOD;
(r9 *= 9) %= MOD;
(r10 *= 10) %= MOD;
}
cout << (r10 - 2 * r9 + r8) % MOD << endl;
}
| #include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int MOD = 1e9 + 7;
int main() {
int n;
cin >> n;
ll r8 = 1, r9 = 1, r10 = 1;
for (int i = 0; i < n; i++) {
(r8 *= 8) %= MOD;
(r9 *= 9) %= MOD;
(r10 *= 10) %= MOD;
}
cout << (r10 + 2 * (MOD - r9) + r8) % MOD << endl;
... | [["-", 12, 16, 31, 23, 0, 16, 31, 16, 17, 33], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 72], ["+", 0, 16, 31, 16, 12, 16, 12, 23, 0, 24], ["+", 31, 16, 12, 16, 12, 23, 0, 16, 31, 22], ["+", 31, 16, 12, 16, 12, 23, 0, 16, 17, 33], ["+", 0, 16, 31, 16, 12, 16, 12, 23, 0, 25]] | 1 | 102 |
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
// #pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define fast \
ios_base::sync_with_stdio(false); ... | // #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
// #pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define fast \
ios_base::sync_with_stdio(false); ... | [["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 109], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 132]] | 1 | 202 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define p_ary(ary, a, b) \
do { \
cout << "["; ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define p_ary(ary, a, b) \
do { \
cout << "["; ... | [["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13]] | 1 | 447 |
#!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
from bisect import bisect_left, bisect_right
from functools import reduce, lru_cache
from heapq import heappush, heappop, heapify
import itertools
import math, fractions
import sys, copy
def L(): return sys.stdin.readline().split()... | #!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
from bisect import bisect_left, bisect_right
from functools import reduce, lru_cache
from heapq import heappush, heappop, heapify
import itertools
import math, fractions
import sys, copy
def L(): return sys.stdin.readline().split()... | [["+", 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 | 597 |
#include <bits/stdc++.h>
#define itn int
#define REP(i, n) for (ll i = 0; i < n; i++)
#define IREP(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define all(v) v.begin(), v.end()
#define SENTINEL 2000000000
#define NIL -1
using namespace std;
typedef long long ll;
const ll MAX =... | #include <bits/stdc++.h>
#define itn int
#define REP(i, n) for (ll i = 0; i < n; i++)
#define IREP(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define all(v) v.begin(), v.end()
#define SENTINEL 2000000000
#define NIL -1
using namespace std;
typedef long long ll;
const ll MAX =... | [["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 72], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22]] | 1 | 234 |
N=int(input())
pr=10**9+7
print((pow(10,N,pr)-2*pow(9,N,pr)+pow(8,N,pr)%pr)) | N=int(input())
pr=10**9+7
print((pow(10,N,pr)-2*pow(9,N,pr)+pow(8,N,pr))%pr) | [["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 25], ["-", 0, 1, 0, 652, 3, 4, 0, 23, 0, 25]] | 5 | 50 |
#include <bits/stdc++.h>
#define x first
#define y second
#pragma gcc optimize("O3")
#pragma gcc optimize("Ofast")
#pragma gcc optimize("unroll-loops")
using namespace std;
const long long INF = 1e18;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<int> v... | #include <bits/stdc++.h>
#define x first
#define y second
#pragma gcc optimize("O3")
#pragma gcc optimize("Ofast")
#pragma gcc optimize("unroll-loops")
using namespace std;
const long long INF = 1e18;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<int> v... | [["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13]] | 1 | 198 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.