problem_id stringlengths 6 6 | language stringclasses 2
values | original_status stringclasses 3
values | original_src stringlengths 19 243k | changed_src stringlengths 19 243k | change stringclasses 3
values | i1 int64 0 8.44k | i2 int64 0 8.44k | j1 int64 0 8.44k | j2 int64 0 8.44k | error stringclasses 270
values | stderr stringlengths 0 226k |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
typedef long double ld;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
#define REP(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define F first
#define S second
const int mx = 2000... | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
typedef long double ld;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
#define REP(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define F first
#define S second
const int mx = 2000... | replace | 12 | 13 | 12 | 13 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i <= n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end()... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i <= n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end()... | replace | 31 | 33 | 31 | 33 | 0 | |
p02782 | C++ | Runtime Error | // #undef _DEBUG
// #pragma GCC optimize("Ofast")
// 不動小数点の計算高速化
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace std::chrono;
#define int long long... | // #undef _DEBUG
// #pragma GCC optimize("Ofast")
// 不動小数点の計算高速化
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace std::chrono;
#define int long long... | replace | 5,482 | 5,483 | 5,482 | 5,483 | 0 | |
p02782 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef priority_queue<int> PQ_DESC;
typedef priority_queue<int, vector<int>, greater<int>> PQ_ASC;
typedef priority_queu... | #include "bits/stdc++.h"
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef priority_queue<int> PQ_DESC;
typedef priority_queue<int, vector<int>, greater<int>> PQ_ASC;
typedef priority_queu... | replace | 76 | 77 | 76 | 77 | 0 | |
p02782 | C++ | Runtime Error | /*
confirm 0LL and 1LL
confirm cornercases such as 0
confirm times of cin < 10^6
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector... | /*
confirm 0LL and 1LL
confirm cornercases such as 0
confirm times of cin < 10^6
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector... | replace | 103 | 104 | 103 | 104 | 0 | |
p02782 | Python | Runtime Error | r1, c1, r2, c2 = map(int, input().split())
MAX = 10**6 + 1
MOD = 10**9 + 7
# Factorial
fac = [0] * (MAX + 1)
fac[0] = 1
fac[1] = 1
# Inverse
inv = [0] * (MAX + 1)
inv[1] = 1
# Inverse factorial
finv = [0] * (MAX + 1)
finv[0] = 1
finv[1] = 1
for i in range(2, MAX + 1):
fac[i] = fac[i - 1] * i % MOD
inv[i] =... | r1, c1, r2, c2 = map(int, input().split())
MAX = 2 * 10**6 + 1
MOD = 10**9 + 7
# Factorial
fac = [0] * (MAX + 1)
fac[0] = 1
fac[1] = 1
# Inverse
inv = [0] * (MAX + 1)
inv[1] = 1
# Inverse factorial
finv = [0] * (MAX + 1)
finv[0] = 1
finv[1] = 1
for i in range(2, MAX + 1):
fac[i] = fac[i - 1] * i % MOD
inv[... | replace | 2 | 3 | 2 | 3 | 1 | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02782/Python/s077310525.py", line 22, in <module>
fac[i] = fac[i - 1] * i % MOD
MemoryError
|
p02782 | C++ | Runtime Error | #include <iostream>
constexpr int MAX = 1000001;
constexpr int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
static bool init = false;
if (init) {
return;
}
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] ... | #include <iostream>
constexpr int MAX = 2000002;
constexpr int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
static bool init = false;
if (init) {
return;
}
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] ... | replace | 2 | 3 | 2 | 3 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < b; ++i)
#define all(c) c.begin(), c.end()
#define gmax(x, y) x = max(x, y)
#define gmin(x, y) x = min(x, y)
#define gadd(x, y) x = add(x, y)
#define gmul(x, y) x = mul(x, y)
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
const i... | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < b; ++i)
#define all(c) c.begin(), c.end()
#define gmax(x, y) x = max(x, y)
#define gmin(x, y) x = min(x, y)
#define gadd(x, y) x = add(x, y)
#define gmul(x, y) x = mul(x, y)
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
const i... | replace | 36 | 37 | 36 | 37 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// #include <boost/multiprecision/cpp_int.hpp>
// using multiInt = boost::multiprecision::cpp_int;
using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <typename Q_temp>
using smaller_queue = priority_queue<Q_temp... | #include <bits/stdc++.h>
using namespace std;
// #include <boost/multiprecision/cpp_int.hpp>
// using multiInt = boost::multiprecision::cpp_int;
using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <typename Q_temp>
using smaller_queue = priority_queue<Q_temp... | replace | 164 | 165 | 164 | 165 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
template <class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i, a, n) for (int(i) = (a); (i) < (n); ++(i))
#define eFOR(i, a, n) for (int(i) = (a); (i) <= (n)... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
template <class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i, a, n) for (int(i) = (a); (i) < (n); ++(i))
#define eFOR(i, a, n) for (int(i) = (a); (i) <= (n)... | replace | 66 | 67 | 66 | 67 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(a) (a).begin(), (a).end()
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(a) (a).begin(), (a).end()
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = ... | replace | 169 | 170 | 169 | 170 | 0 | |
p02782 | C++ | Runtime Error | #include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define N (1000000000 + 7)
#define INF 1e16
typedef long long ll;
typedef pair<int, int> P;
#define SIZE 1000010
ll... | #include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define N (1000000000 + 7)
#define INF 1e16
typedef long long ll;
typedef pair<int, int> P;
#define SIZE 2000010
ll... | replace | 16 | 17 | 16 | 17 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define ll long long
using namespace std;
const int MAX = 1000001;
const int MOD = 1000000007;
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
rep(i, MAX) {
if (i == 0 || i ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define ll long long
using namespace std;
const int MAX = 2020202;
const int MOD = 1000000007;
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
rep(i, MAX) {
if (i == 0 || i ... | replace | 5 | 6 | 5 | 6 | 0 | |
p02782 | C++ | Runtime Error | /*
AuThOr GaRyMr
*/
#include <bits/stdc++.h>
#define rb(a, b, c) for (int a = b; a <= c; ++a)
#define rl(a, b, c) for (int a = b; a >= c; --a)
#define LL long long
#define IT iterator
#define PB push_back
#define II(a, b) make_pair(a, b)
#define FIR first
#define SEC second
#define FREO freopen("check.out", "w", stdout... | /*
AuThOr GaRyMr
*/
#include <bits/stdc++.h>
#define rb(a, b, c) for (int a = b; a <= c; ++a)
#define rl(a, b, c) for (int a = b; a >= c; --a)
#define LL long long
#define IT iterator
#define PB push_back
#define II(a, b) make_pair(a, b)
#define FIR first
#define SEC second
#define FREO freopen("check.out", "w", stdout... | replace | 26 | 27 | 26 | 27 | 0 | |
p02782 | C++ | Runtime Error | #pragma region
#include "bits/stdc++.h"
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define _rep3(i, begin, end) \
for (register int i = (begin), i##_end = (end); i < i##_end; i++)
#define _irep3(i, begin, end) ... | #pragma region
#include "bits/stdc++.h"
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define _rep3(i, begin, end) \
for (register int i = (begin), i##_end = (end); i < i##_end; i++)
#define _irep3(i, begin, end) ... | replace | 69 | 70 | 69 | 70 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define vcout(v) \
rep(i, v.size()) cout << v[i] << " "; \
cout << endl
#def... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define vcout(v) \
rep(i, v.size()) cout << v[i] << " "; \
cout << endl
#def... | replace | 12 | 13 | 12 | 13 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if (!(p))
#define until(p) while (!(p))
using ll = std::int64_t;
using P = std::tuple<int, int>;
template <typename T> std::tuple<T, T, T> extgcd(T a, T b) {
T s1 = 1, t1 = 0, s2 = 0... | #include <bits/stdc++.h>
#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if (!(p))
#define until(p) while (!(p))
using ll = std::int64_t;
using P = std::tuple<int, int>;
template <typename T> std::tuple<T, T, T> extgcd(T a, T b) {
T s1 = 1, t1 = 0, s2 = 0... | replace | 70 | 71 | 70 | 71 | 0 | |
p02782 | C++ | Runtime Error | #include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include ... | #include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include ... | replace | 38 | 39 | 38 | 39 | 0 | |
p02782 | C++ | Runtime Error | #include <algorithm>
#include <bits/stdc++.h>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#includ... | #include <algorithm>
#include <bits/stdc++.h>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#includ... | replace | 1,435 | 1,436 | 1,435 | 1,436 | 0 | |
p02782 | C++ | Runtime Error | #include <algorithm>
#include <bits/stdc++.h>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#includ... | #include <algorithm>
#include <bits/stdc++.h>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#includ... | replace | 1,470 | 1,471 | 1,470 | 1,471 | 0 | |
p02782 | C++ | Runtime Error | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i, a, b) ((a) <= (i) && (i) < (b))
#defin... | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i, a, b) ((a) <= (i) && (i) < (b))
#defin... | replace | 157 | 158 | 157 | 158 | 0 | |
p02782 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <typename T> void out(T x) {
cout << x << endl;
exit(0);
}
#define watch(x) cout << (#x) << " is " << (x) << endl
const int maxn = 2e6 + 5;
const ll mod = 1e9 + 7;
ll fac[maxn], ifac[maxn];
ll modpow(ll, ll);
ll inv(ll);
ll nck(ll, ll... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <typename T> void out(T x) {
cout << x << endl;
exit(0);
}
#define watch(x) cout << (#x) << " is " << (x) << endl
const int maxn = 2e6 + 5;
const ll mod = 1e9 + 7;
ll fac[maxn], ifac[maxn];
ll modpow(ll, ll);
ll inv(ll);
ll nck(ll, ll... | replace | 36 | 42 | 36 | 44 | TLE | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
template <typename T> T inverse(T a, T m) {
T u = 0, v = 1;
while (a != 0) {
T t = m / a;
m -= t * a;
u -= t * v;
std::swap(a, m);
std::swap(u, v);
}
assert(m == 1);
return u;
}
template <typename T> class Modular {
public:
using Type = ty... | #include <bits/stdc++.h>
using namespace std;
template <typename T> T inverse(T a, T m) {
T u = 0, v = 1;
while (a != 0) {
T t = m / a;
m -= t * a;
u -= t * v;
std::swap(a, m);
std::swap(u, v);
}
assert(m == 1);
return u;
}
template <typename T> class Modular {
public:
using Type = ty... | replace | 259 | 260 | 259 | 260 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less
using namespace std;
#define int long long
#define double long double
#define pb push_back
#define mp make_pair
#define st(arr, a) memset(arr, a, sizeof arr)
#define nl... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less
using namespace std;
#define int long long
#define double long double
#define pb push_back
#define mp make_pair
#define st(arr, a) memset(arr, a, sizeof arr)
#define nl... | replace | 19 | 20 | 19 | 20 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define ld long double
#define eb emplace_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define int long long
using namespace std;
const int INF = 2e18;
const int MOD = 1e9 + 7;
const int MB = 20;
const int maxN = 1e6 + 1;
int fact[maxN], re... | #include <bits/stdc++.h>
#define ll long long
#define ld long double
#define eb emplace_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define int long long
using namespace std;
const int INF = 2e18;
const int MOD = 1e9 + 7;
const int MB = 20;
const int maxN = 4e6 + 1;
int fact[maxN], re... | replace | 13 | 14 | 13 | 14 | 0 | |
p02782 | C++ | Runtime Error | /*
∫ ∫ ∫
ノヽ
(_ )
(_ )
(______ )
ヽ(´・ω・)ノ
| /
UU
*/
#pragma region macro
#include <bits/stdc++.h>
typedef long long int64;
using namespace std;
using P = pair<int64, int64>;
typedef vector<int> vi;
const int MOD = (int)1e9 + 7;
const int64 INF = 1LL << 62;
const int inf = 1 << 30;
template <class T... | /*
∫ ∫ ∫
ノヽ
(_ )
(_ )
(______ )
ヽ(´・ω・)ノ
| /
UU
*/
#pragma region macro
#include <bits/stdc++.h>
typedef long long int64;
using namespace std;
using P = pair<int64, int64>;
typedef vector<int> vi;
const int MOD = (int)1e9 + 7;
const int64 INF = 1LL << 62;
const int inf = 1 << 30;
template <class T... | replace | 154 | 156 | 154 | 156 | 0 | |
p02782 | C++ | Runtime Error | #include <iostream>
using namespace std;
const int MAX = 1000000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD - i... | #include <iostream>
using namespace std;
const int MAX = 2000005;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD - i... | replace | 3 | 4 | 3 | 4 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int add(int a, int b) { return a + b >= mod ? a + b - mod : a + b; }
int mul(int a, int b) { return int(1LL * a * b % mod); }
int fexp(int b, int e = mod - 2) {
int ans = 1;
while (e) {
if (e & 1)
ans = mul(ans, b);
b = mul(b, b)... | #include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int add(int a, int b) { return a + b >= mod ? a + b - mod : a + b; }
int mul(int a, int b) { return int(1LL * a * b % mod); }
int fexp(int b, int e = mod - 2) {
int ans = 1;
while (e) {
if (e & 1)
ans = mul(ans, b);
b = mul(b, b)... | replace | 18 | 19 | 18 | 19 | 0 | |
p02782 | C++ | Runtime Error | #pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PII = pair<int, int>;
using PLL = pair<LL, LL>;
const int INF = 1e9;
const int MXN = 1e6 + 5;
const int MXV = 0;
const int MOD = 1e9 + 7;
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define F... | #pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PII = pair<int, int>;
using PLL = pair<LL, LL>;
const int INF = 1e9;
const int MXN = 2e6 + 5;
const int MXV = 0;
const int MOD = 1e9 + 7;
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define F... | replace | 7 | 8 | 7 | 8 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
// const ll MOD = ;
ll mod(ll A, ll M) { return (A % M + M) % M; }
const ll INF = 1LL << 60;
template <class T> bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
// const ll MOD = ;
ll mod(ll A, ll M) { return (A % M + M) % M; }
const ll INF = 1LL << 60;
template <class T> bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
... | replace | 69 | 70 | 69 | 70 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i, n, k) for (ll i = (n); i < (k); i++)
#define ALL(a) (a).begin(), (a).end()
ll ans = 0;
const ll MAX = 1200000;
const ll MOD = 1000000007;
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i, n, k) for (ll i = (n); i < (k); i++)
#define ALL(a) (a).begin(), (a).end()
ll ans = 0;
const ll MAX = 2400000;
const ll MOD = 1000000007;
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;... | replace | 6 | 7 | 6 | 7 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long int
#define M 1000000007
#define mod 998244353
#define mp(x, y) make_pair(x, y)
#define pb(x) push_back(x)
#define pi pair<ll, ll>
using namespace std;
const ll N = 500010;
ll fac[N];
ll power(ll x, ll n) {
if (n == 0) {
return 1;
}
if (n == 1) {
return x;
... | #include <bits/stdc++.h>
#define ll long long int
#define M 1000000007
#define mod 998244353
#define mp(x, y) make_pair(x, y)
#define pb(x) push_back(x)
#define pi pair<ll, ll>
using namespace std;
const ll N = 5000010;
ll fac[N];
ll power(ll x, ll n) {
if (n == 0) {
return 1;
}
if (n == 1) {
return x;
... | replace | 8 | 9 | 8 | 9 | 0 | |
p02782 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long... | replace | 30 | 31 | 30 | 31 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
const ll MAX = 1e6 + 5;
const ll MOD = 1000000007;
ll fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
const ll MAX = 1e6 * 2 + 5;
const ll MOD = 1000000007;
ll fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i <... | replace | 5 | 6 | 5 | 6 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REP1(i, n) for (int i = 1; i <= n; i++)
#define RREP(i, n) for (int i = n - 1; i >= 0; i--)
#define RST(i, n) memset(i, n, si... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REP1(i, n) for (int i = 1; i <= n; i++)
#define RREP(i, n) for (int i = n - 1; i >= 0; i--)
#define RST(i, n) memset(i, n, si... | replace | 75 | 76 | 75 | 76 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// mod逆元を使ったnCkの計算(速)
const int64_t MAX = 510000;
const int64_t MOD = 1000000007;
int64_t fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1]... | #include <bits/stdc++.h>
using namespace std;
// mod逆元を使ったnCkの計算(速)
const int64_t MAX = 3000000;
const int64_t MOD = 1000000007;
int64_t fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1... | replace | 4 | 5 | 4 | 5 | 0 | |
p02782 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cfloat>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
... | #include <algorithm>
#include <cassert>
#include <cfloat>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
... | replace | 227 | 228 | 227 | 228 | 0 | |
p02782 | C++ | Runtime Error | #define DEBUG 1
#include <bits/stdc++.h>
#define loop(n) \
for (lint ngtkana_is_a_genius = 0; ngtkana_is_a_genius < lint(n); \
ngtkana_is_a_genius++)
#define rep(i, begin, end) for (lint i = lint(begin); (i) < lint(end); i++)
#define all... | #define DEBUG 1
#include <bits/stdc++.h>
#define loop(n) \
for (lint ngtkana_is_a_genius = 0; ngtkana_is_a_genius < lint(n); \
ngtkana_is_a_genius++)
#define rep(i, begin, end) for (lint i = lint(begin); (i) < lint(end); i++)
#define all... | replace | 269 | 270 | 269 | 270 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i, s, e) for (i64(i) = (s); (i) < (e); (i)++)
#define rev(i, s, e) for (i64(i) = (s); (i)-- > (e);)
#define all(x) x.begin(), x.end()
template <class T>
static inline std::vector<T> ndvec(size_t &&n, T val) noexcept {
return std::vector... | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i, s, e) for (i64(i) = (s); (i) < (e); (i)++)
#define rev(i, s, e) for (i64(i) = (s); (i)-- > (e);)
#define all(x) x.begin(), x.end()
template <class T>
static inline std::vector<T> ndvec(size_t &&n, T val) noexcept {
return std::vector... | replace | 116 | 117 | 116 | 117 | 0 | |
p02782 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vi2;
typedef vector<vi2> vi3;
typedef p... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vi2;
typedef vector<vi2> vi3;
typedef p... | replace | 90 | 92 | 90 | 92 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define MAX_N 200010
long long inv[MAX_N];
long long factorial[MAX_N];
long long inv_factorial[MAX_N];
void GetInv() {
for (int i = 1; i < MAX_N; i++) {
if (i == 1)
inv[i] = 1;
else {
inv[i] = (mod - (mod / i) * inv[mod % i]) %... | #include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define MAX_N 2000100
long long inv[MAX_N];
long long factorial[MAX_N];
long long inv_factorial[MAX_N];
void GetInv() {
for (int i = 1; i < MAX_N; i++) {
if (i == 1)
inv[i] = 1;
else {
inv[i] = (mod - (mod / i) * inv[mod % i]) ... | replace | 4 | 5 | 4 | 5 | 0 | |
p02782 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
#include <climits>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <... | #include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
#include <climits>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <... | replace | 263 | 264 | 263 | 264 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e6 + 10;
const int MOD = 1e9 + 7;
ll d[N];
ll qpow(ll x, ll k) {
ll r = 1;
while (k) {
if (k & 1)
r = r * x % MOD;
k >>= 1;
x = x * x % MOD;
}
return r;
}
ll C(int i, int j) {
return d[i] * qpow(d[i - j], MOD ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e6 + 10;
const int MOD = 1e9 + 7;
ll d[N];
ll qpow(ll x, ll k) {
ll r = 1;
while (k) {
if (k & 1)
r = r * x % MOD;
k >>= 1;
x = x * x % MOD;
}
return r;
}
ll C(int i, int j) {
return d[i] * qpow(d[i - j], MOD ... | replace | 3 | 4 | 3 | 4 | 0 | |
p02782 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<string> VS;
typedef vector<vector<int>... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<string> VS;
typedef vector<vector<int>... | replace | 39 | 40 | 39 | 40 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repl(i, l, r) for (ll i = (l); i < (r); i++)
#define per(i, n) for (ll i = n - 1; i >= 0; i--)
#define perl(i, r, l) for (ll i = r - 1; i >= l; i--)
#define fi first
#define se second
#define pb push_back
#define ins inse... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repl(i, l, r) for (ll i = (l); i < (r); i++)
#define per(i, n) for (ll i = n - 1; i >= 0; i--)
#define perl(i, r, l) for (ll i = r - 1; i >= l; i--)
#define fi first
#define se second
#define pb push_back
#define ins inse... | replace | 81 | 82 | 81 | 82 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL << 62
#define inf 1000000007
const int MAX = 1000000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2;... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL << 62
#define inf 1000000007
const int MAX = 5100000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2;... | replace | 6 | 7 | 6 | 7 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 1000 * 1000 + 20, mod = 1e9 + 7;
int fact[N], factRev[N];
int sum(int a, int b) { return ((1LL * a + b) % mod + mod) % mod; }
int mul(int a, int b) { return ((1LL * a * b) % mod + mod) % mod; }
int pw(int a, int b) {
int res = 1, tmp = a;
while (b) {
... | #include <bits/stdc++.h>
using namespace std;
const int N = 2000 * 1000 + 20, mod = 1e9 + 7;
int fact[N], factRev[N];
int sum(int a, int b) { return ((1LL * a + b) % mod + mod) % mod; }
int mul(int a, int b) { return ((1LL * a * b) % mod + mod) % mod; }
int pw(int a, int b) {
int res = 1, tmp = a;
while (b) {
... | replace | 3 | 4 | 3 | 4 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv... | #include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
const int MAX = 6666666;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = fin... | replace | 7 | 8 | 7 | 8 | 0 | |
p02782 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define rrep(i, n) for (int i = (n)-1; i >= 0; --i)
#define rfor(i, m, n) for (int i = (m); i >= (n); --i)
#define sz(x) ((int)(x).size(... | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define rrep(i, n) for (int i = (n)-1; i >= 0; --i)
#define rfor(i, m, n) for (int i = (m); i >= (n); --i)
#define sz(x) ((int)(x).size(... | replace | 483 | 497 | 483 | 489 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ALL(x) x.begin(), x.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = m... | #include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ALL(x) x.begin(), x.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = m... | replace | 16 | 17 | 16 | 17 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define REPR(i, n) for (int(i) = (n); (i) >= 0; --(i))
#define FOR(i, n, m) for (int(i) = (n); (i) < (m); ++(i))
constexpr int INF = 1e9;
// constexpr ll INF = 1LL<<61;
constexpr ll mod = 1e9 + 7;
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define REPR(i, n) for (int(i) = (n); (i) >= 0; --(i))
#define FOR(i, n, m) for (int(i) = (n); (i) < (m); ++(i))
constexpr int INF = 1e9;
// constexpr ll INF = 1LL<<61;
constexpr ll mod = 1e9 + 7;
... | replace | 12 | 13 | 12 | 13 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define REPR(i, n) for (int(i) = (n); (i) >= 0; --(i))
#define FOR(i, n, m) for (int(i) = (n); (i) < (m); ++(i))
constexpr int INF = 1e9;
// constexpr ll INF = 1LL<<61;
constexpr ll mod = 1e9 + 7;
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define REPR(i, n) for (int(i) = (n); (i) >= 0; --(i))
#define FOR(i, n, m) for (int(i) = (n); (i) < (m); ++(i))
constexpr int INF = 1e9;
// constexpr ll INF = 1LL<<61;
constexpr ll mod = 1e9 + 7;
... | replace | 12 | 13 | 12 | 13 | 0 | |
p02782 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
vector<long long int> inverse;
vector<long long int> f, f_inverse;
void factorial_Initialize(int max) {
vector<long long int> a(max + 1, 1);
inverse = a;
f = a;
f_inverse = a;
for (int i = 2; i <= max; i++) {
inverse[i] = ... | #include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
vector<long long int> inverse;
vector<long long int> f, f_inverse;
void factorial_Initialize(int max) {
vector<long long int> a(max + 1, 1);
inverse = a;
f = a;
f_inverse = a;
for (int i = 2; i <= max; i++) {
inverse[i] = ... | replace | 32 | 33 | 32 | 33 | TLE | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
// typedef
//-------------------------#include <bits/stdc++.h>
const double pi = 3.141592653589793238462643383279;
using namespace std;
// conversion
//------------------------------------------
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template ... | #include <bits/stdc++.h>
// typedef
//-------------------------#include <bits/stdc++.h>
const double pi = 3.141592653589793238462643383279;
using namespace std;
// conversion
//------------------------------------------
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template ... | replace | 151 | 152 | 151 | 152 | 0 | |
p02782 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "dump.hpp"
#else
#define dump(...)
#define dumpv(...)
#endif
#define rep(i, n) for (int i = 0; i < (n); i++)
#define mins(x, y) (x = min(x, y))
#define maxs(x, y) (x = max(x, y))
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
us... | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "dump.hpp"
#else
#define dump(...)
#define dumpv(...)
#endif
#define rep(i, n) for (int i = 0; i < (n); i++)
#define mins(x, y) (x = min(x, y))
#define maxs(x, y) (x = max(x, y))
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
us... | replace | 82 | 85 | 82 | 86 | TLE | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// ------------------
// Integer modulo MOD
// ------------------
const int64_t MOD = 1e9 + 7;
struct mint {
int64_t x;
mint(int64_t x = 0) : x((x % MOD + MOD) % MOD) {}
mint operator-() const { return mint(-x); }
mint &operator+=(const mint a) {
if ((x += a.x)... | #include <bits/stdc++.h>
using namespace std;
// ------------------
// Integer modulo MOD
// ------------------
const int64_t MOD = 1e9 + 7;
struct mint {
int64_t x;
mint(int64_t x = 0) : x((x % MOD + MOD) % MOD) {}
mint operator-() const { return mint(-x); }
mint &operator+=(const mint a) {
if ((x += a.x)... | replace | 78 | 79 | 78 | 79 | 0 | |
p02782 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#define ll long long
using namespace std;
const int N = 404404;
int fac[N], ifac[N];
int p = 1e9 + 7;
ll ans = 0;
ll power(int a, int b) {
int sum = 1;
for (; b; b >>= 1) {
if (b & 1)
sum = 1ll * sum * a % p;
a = 1ll * a * a % p;
}
return sum;
}
ll C(int n, i... | #include <algorithm>
#include <cstdio>
#define ll long long
using namespace std;
const int N = 2022202;
int fac[N], ifac[N];
int p = 1e9 + 7;
ll ans = 0;
ll power(int a, int b) {
int sum = 1;
for (; b; b >>= 1) {
if (b & 1)
sum = 1ll * sum * a % p;
a = 1ll * a * a % p;
}
return sum;
}
ll C(int n, ... | replace | 4 | 5 | 4 | 5 | 0 | |
p02782 | C++ | Runtime Error | // >>> TEMPLATES
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define int ll
#define double ld
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define repR(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rep1R... | // >>> TEMPLATES
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define int ll
#define double ld
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define repR(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rep1R... | replace | 210 | 211 | 210 | 211 | 0 | |
p02782 | C++ | Runtime Error | #include <algorithm>
#include <assert.h>
#include <cstring>
#include <iterator>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#pragma warning(disable : 4996)
typedef long long ll;
#define MIN(... | #include <algorithm>
#include <assert.h>
#include <cstring>
#include <iterator>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#pragma warning(disable : 4996)
typedef long long ll;
#define MIN(... | replace | 26 | 27 | 26 | 27 | 0 | |
p02782 | C++ | Runtime Error | #define __mode_debug__
/* ξ
ll
_ll_
/ ∞ \
│* A *│
│* C *│
│* 祈 *│
│* 願 *│
│* *│
 ̄ ̄ ̄ ̄ ̄ */
// C++14 (GCC 5.4.1)
#include <bits/stdc++.h>
using namespace std;
#ifdef __mode_debug__
#define DBG
#else
#define DBG if (false)
#endif
#define LLINF (1LL << 60)
using ll = long long;
#define mod 100... | #define __mode_debug__
/* ξ
ll
_ll_
/ ∞ \
│* A *│
│* C *│
│* 祈 *│
│* 願 *│
│* *│
 ̄ ̄ ̄ ̄ ̄ */
// C++14 (GCC 5.4.1)
#include <bits/stdc++.h>
using namespace std;
#ifdef __mode_debug__
#define DBG
#else
#define DBG if (false)
#endif
#define LLINF (1LL << 60)
using ll = long long;
#define mod 100... | replace | 142 | 143 | 142 | 143 | 0 | |
p02782 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctype.h>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stac... | #include <algorithm>
#include <array>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctype.h>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stac... | replace | 60 | 61 | 60 | 61 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using LL = long long;
const int Max_Num = 1e5 + 10;
const LL mod = 1e9 + 7;
LL F[Max_Num], Finv[Max_Num];
LL modpow(LL x, LL n) {
LL r = 1;
while (n) {
if (n & 1)
r = r * x % mod;
x = x * x % mod;
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using LL = long long;
const int Max_Num = 2e6 + 10;
const LL mod = 1e9 + 7;
LL F[Max_Num], Finv[Max_Num];
LL modpow(LL x, LL n) {
LL r = 1;
while (n) {
if (n & 1)
r = r * x % mod;
x = x * x % mod;
... | replace | 5 | 6 | 5 | 6 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vll = vector<ll>;
using uint = unsigned int;
using ull = unsigned long long;
template <typename T> using uset = unordered_set<T>;
template <typename T1, typename T2> ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vll = vector<ll>;
using uint = unsigned int;
using ull = unsigned long long;
template <typename T> using uset = unordered_set<T>;
template <typename T1, typename T2> ... | replace | 50 | 51 | 50 | 51 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <functional> // for less
#include <iostream>
#define ll long long
#define ull unsigned long long
#define ld long double
#define all(ar) ar.begin(), ar.end()
#define mp make_pair
#define sot(bello) bello.begin(), bello.end()
#define bitc __builtin_popcountl
#define fr(i, a, b) for (int ... | #include <bits/stdc++.h>
#include <functional> // for less
#include <iostream>
#define ll long long
#define ull unsigned long long
#define ld long double
#define all(ar) ar.begin(), ar.end()
#define mp make_pair
#define sot(bello) bello.begin(), bello.end()
#define bitc __builtin_popcountl
#define fr(i, a, b) for (int ... | replace | 335 | 337 | 335 | 337 | 0 | a1: 19
a2: 19
a3: 3
a4: 3
a5: 1
|
p02782 | C++ | Runtime Error | #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>;
const int mod = 1000000007;
struct mint {
ll x;
mint(ll x = 0) : x(x % mod) {}
mint &operator+=(const mint a) {
if ((x += a.x) >= mod)
x -= mod;
return *this;... | #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>;
const int mod = 1000000007;
struct mint {
ll x;
mint(ll x = 0) : x(x % mod) {}
mint &operator+=(const mint a) {
if ((x += a.x) >= mod)
x -= mod;
return *this;... | replace | 68 | 69 | 68 | 69 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int nmax = 2000100;
const ll mod = 1e9 + 7;
ll fac[nmax], finv[nmax], inv[nmax];
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < nmax; i++) {
fac[i] = fac[i - 1] * i % mod;
inv[i] = mo... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int nmax = 2000100;
const ll mod = 1e9 + 7;
ll fac[nmax], finv[nmax], inv[nmax];
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < nmax; i++) {
fac[i] = fac[i - 1] * i % mod;
inv[i] = mo... | replace | 27 | 47 | 27 | 29 | 0 | |
p02782 | C++ | Runtime Error | #include <cassert>
#include <iostream>
#include <string>
#include <vector>
#define repi(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, a) repi(i, 0, a)
#define all(a) (a).begin(), (a).end()
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <cl... | #include <cassert>
#include <iostream>
#include <string>
#include <vector>
#define repi(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, a) repi(i, 0, a)
#define all(a) (a).begin(), (a).end()
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <cl... | replace | 97 | 98 | 97 | 98 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// types
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<pll> vpl;
// macros
#define ALL(a) a.begin(), a.end()
#define SZ(a) ((int)... | #include <bits/stdc++.h>
using namespace std;
// types
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<pll> vpl;
// macros
#define ALL(a) a.begin(), a.end()
#define SZ(a) ((int)... | replace | 40 | 41 | 40 | 41 | 0 | |
p02782 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef priority_queue<int> PQ;
template <cl... | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef priority_queue<int> PQ;
template <cl... | replace | 50 | 52 | 50 | 52 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for (int i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for (int i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs ... | replace | 87 | 88 | 87 | 88 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long mypow(long a, long long b) {
long long c;
if (b == 0)
return 1;
else {
c = mypow(a, b / 2) * mypow(a, b / 2) % mod;
if (b % 2 == 1)
c = c * a % mod;
return c;
}
}
vector<long long> fac(200001);
vector<long ... | #include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long mypow(long a, long long b) {
long long c;
if (b == 0)
return 1;
else {
c = mypow(a, b / 2) * mypow(a, b / 2) % mod;
if (b % 2 == 1)
c = c * a % mod;
return c;
}
}
vector<long long> fac(2000003);
vector<long... | replace | 14 | 16 | 14 | 16 | TLE | |
p02782 | C++ | Runtime Error | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author tatsumack
*/
#include <fstream>
#include <iostream>
#include <bits/stdc++.h>
#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (... | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author tatsumack
*/
#include <fstream>
#include <iostream>
#include <bits/stdc++.h>
#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (... | replace | 113 | 114 | 113 | 114 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;
#define SIZE 1000005
ll r1, c1, r2, c2;
ll fact[SIZE], inv_fact[SIZE];
ll mod_pow(ll x, ll count, ... | #include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;
#define SIZE 2000005
ll r1, c1, r2, c2;
ll fact[SIZE], inv_fact[SIZE];
ll mod_pow(ll x, ll count, ... | replace | 9 | 10 | 9 | 10 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ss second
#define ff first
#define all(x) x.begin(), x.end()
#define DEBUG
using namespace std;
using ll = long long;
using pii = pair<ll, ll>;
const int oo = 1e9 + 7;
const ll mod = 1e9 + 7, maxn = (1e6) + 10, maxm = (1 << 18);
const double PI = acos(-1);
ll fat[maxn], inv[maxn];
ll... | #include <bits/stdc++.h>
#define ss second
#define ff first
#define all(x) x.begin(), x.end()
#define DEBUG
using namespace std;
using ll = long long;
using pii = pair<ll, ll>;
const int oo = 1e9 + 7;
const ll mod = 1e9 + 7, maxn = (2 * 1e6) + 10, maxm = (1 << 18);
const double PI = acos(-1);
ll fat[maxn], inv[maxn];... | replace | 11 | 12 | 11 | 12 | 0 | |
p02782 | C++ | Runtime Error | // g++ -std=c++11 a.cpp
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <typeinfo>
#incl... | // g++ -std=c++11 a.cpp
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <typeinfo>
#incl... | replace | 67 | 68 | 67 | 68 | 0 | |
p02782 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
map<pair<long long, long long>, long long> mp;
long long modpow(long long x, long long y) {
if (mp[{x, y}])
return mp[{x, y}];
if (y == 0)
return 1;
if (y % 2) {
long long res = x * modpow(x, y - 1) % mod;
mp[{x, y}] = res;
ret... | #include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
map<pair<long long, long long>, long long> mp;
long long modpow(long long x, long long y) {
if (mp[{x, y}])
return mp[{x, y}];
if (y == 0)
return 1;
if (y % 2) {
long long res = x * modpow(x, y - 1) % mod;
mp[{x, y}] = res;
ret... | replace | 31 | 38 | 31 | 47 | TLE | |
p02782 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define ll... | #include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define ll... | replace | 104 | 105 | 104 | 105 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
#define INF 2000000000000000000
#define ll long long
using namespace std;
const ll MAX = 1010010;
const ll mod = 1000000007;
vector<ll> fac(MAX), finv(MAX), inv(MAX);
bool init_called = false;
//=============modinv============================
void COMinit() {
init_called = true;
fac.at(0) ... | #include <bits/stdc++.h>
#define INF 2000000000000000000
#define ll long long
using namespace std;
const ll MAX = 2010010;
const ll mod = 1000000007;
vector<ll> fac(MAX), finv(MAX), inv(MAX);
bool init_called = false;
//=============modinv============================
void COMinit() {
init_called = true;
fac.at(0) ... | replace | 5 | 6 | 5 | 6 | 0 | |
p02782 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <queue>
#include <vector>
#include <cassert>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
// #define rep(i,n) for(int i=0;i<(n);++i)
#d... | #include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <queue>
#include <vector>
#include <cassert>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
// #define rep(i,n) for(int i=0;i<(n);++i)
#d... | replace | 74 | 75 | 74 | 75 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
#if MYDEBUG
#include "lib/cp_debug.hpp"
#else
#define DBG(...) ;
#endif
#if __cplusplus <= 201402L
template <typename T> T gcd(T a, T b) {
return ((a % b == 0) ? b : gcd(b, a % b));
}
template <typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
#endif
using LL = long long;
constexpr L... | #include <bits/stdc++.h>
#if MYDEBUG
#include "lib/cp_debug.hpp"
#else
#define DBG(...) ;
#endif
#if __cplusplus <= 201402L
template <typename T> T gcd(T a, T b) {
return ((a % b == 0) ? b : gcd(b, a % b));
}
template <typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
#endif
using LL = long long;
constexpr L... | replace | 183 | 184 | 183 | 184 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(a, n) for (ll a = 0; a < (n); ++a)
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<vector<ll>> Graph;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class ... | #include <bits/stdc++.h>
#define rep(a, n) for (ll a = 0; a < (n); ++a)
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<vector<ll>> Graph;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class ... | replace | 92 | 93 | 92 | 93 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll ANS;
const ll MAX = 1000005;
const ll MOD = 1000000007;
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (ll i = 2; i < MAX; i++) {
fac[i] = fac[i - 1]... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll ANS;
const ll MAX = 2000005;
const ll MOD = 1000000007;
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (ll i = 2; i < MAX; i++) {
fac[i] = fac[i - 1]... | replace | 5 | 6 | 5 | 6 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define F first
#define S second
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __pri... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define F first
#define S second
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __pri... | replace | 60 | 62 | 60 | 62 | -11 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int const nax = 3e5 + 10;
constexpr int mod = 1e9 + 7;
int r1, r2, c1, c2;
void plusle(int &a, int b) {
if ((a += b) >= mod)
a -= mod;
}
void minun(int &a, int b) {
if ((a -= b) < 0)
a += mod;
}
int add(int a, int b) { return ((a += b) >= mod) ? a - mod : a; }
i... | #include <bits/stdc++.h>
using namespace std;
int const nax = 3e5 + 10;
constexpr int mod = 1e9 + 7;
int r1, r2, c1, c2;
void plusle(int &a, int b) {
if ((a += b) >= mod)
a -= mod;
}
void minun(int &a, int b) {
if ((a -= b) < 0)
a += mod;
}
int add(int a, int b) { return ((a += b) >= mod) ? a - mod : a; }
i... | replace | 23 | 24 | 23 | 24 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, l, r) for (int i = (int)(l); i < (int)(r); i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)x.size())
template <class T> bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> ... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, l, r) for (int i = (int)(l); i < (int)(r); i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)x.size())
template <class T> bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> ... | replace | 74 | 75 | 74 | 75 | 0 | |
p02782 | C++ | Time Limit Exceeded | #include <algorithm>
#include <climits>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
ll mod = 1e9 + 7;
ll d[2000010];
ll go(ll x, ll y) {
if (y == 0)
return 1;
else if (y == 1)
return x... | #include <algorithm>
#include <climits>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
ll mod = 1e9 + 7;
ll d[2000010];
ll go(ll x, ll y) {
if (y == 0)
return 1;
else if (y == 1)
return x... | replace | 52 | 64 | 52 | 65 | TLE | |
p02782 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
#define all(v) (v).begin(), (v).end()
#define io ios::sync_with_stdio(0)
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define rson rt << 1 | 1, mid + 1, r
#define lson rt << 1, l, mid
#define lll __int128
#define pii pair<int, int>
#define fi first
#define se second
#d... | #include "bits/stdc++.h"
using namespace std;
#define all(v) (v).begin(), (v).end()
#define io ios::sync_with_stdio(0)
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define rson rt << 1 | 1, mid + 1, r
#define lson rt << 1, l, mid
#define lll __int128
#define pii pair<int, int>
#define fi first
#define se second
#d... | replace | 27 | 28 | 27 | 28 | 0 | |
p02782 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include ... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include ... | replace | 78 | 79 | 78 | 79 | 0 | |
p02782 | C++ | Runtime Error | /*author: hyperion_1724
date:
*/
// Optional FAST
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC
// target("sse,sse2,sse3,ssse3,sse4,popcnt,fma,abm,mmx,avx,avx2,tune=native")
// Required Libraries
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <... | /*author: hyperion_1724
date:
*/
// Optional FAST
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC
// target("sse,sse2,sse3,ssse3,sse4,popcnt,fma,abm,mmx,avx,avx2,tune=native")
// Required Libraries
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <... | replace | 65 | 66 | 65 | 66 | 0 | Time: 0.014032
|
p02782 | C++ | Runtime Error | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author Gosu_Hiroo
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef int
#define VI vector<long long>
#define V2I(v, size_1, size_2, value) \
vector<vecto... | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author Gosu_Hiroo
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef int
#define VI vector<long long>
#define V2I(v, size_1, size_2, value) \
vector<vecto... | replace | 463 | 464 | 463 | 464 | 0 | |
p02782 | C++ | Runtime Error | #ifndef LOCAL
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,mmx,tune=native")
#endif // LOCAL
#define _SCL_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/STACK:256000000")
// #define push_back pb
#define fi... | #ifndef LOCAL
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,mmx,tune=native")
#endif // LOCAL
#define _SCL_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/STACK:256000000")
// #define push_back pb
#define fi... | replace | 264 | 265 | 264 | 265 | 0 | |
p02782 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define rep3(i, m, n) for (int(i) = m; (i) <= (n); (i)++)
#define rep3rev(i, m, n) for (int(i) = m; (i) >= (n); (i)--)
#define all(a) (a.begin()), (a.end())
#define rall(a) (a.rbegin()), (a.rend())
#define fi first
#defi... | #include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define rep3(i, m, n) for (int(i) = m; (i) <= (n); (i)++)
#define rep3rev(i, m, n) for (int(i) = m; (i) >= (n); (i)--)
#define all(a) (a.begin()), (a.end())
#define rall(a) (a.rbegin()), (a.rend())
#define fi first
#defi... | replace | 22 | 23 | 22 | 23 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < int(N); ++i)
#define rep1(i, N) for (int i = 1; i < int(N); ++i)
#define all(a) (a).begin(), (a).end()
#define print(v) \
{ ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < int(N); ++i)
#define rep1(i, N) for (int i = 1; i < int(N); ++i)
#define all(a) (a).begin(), (a).end()
#define print(v) \
{ ... | replace | 119 | 120 | 119 | 120 | 0 | |
p02782 | C++ | Runtime Error | #include <iostream>
#define REP(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
// 単純に範囲内の各座標の C を足すのは 10^6まで範囲があるので、 10^12
// で全くもってNG 工夫して計算量を抑える必要がある。 ある座標での経路総数を
// f(x,y) とすると f(a+1,b) = f(a,0) + f(a,1) + f(a,2) + ... + f(a,b) らしい。
// 3 ─〇 ← (a+1, 3)
// 2 ─┤
// 1 ─┤
// 0 ─... | #include <iostream>
#define REP(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
// 単純に範囲内の各座標の C を足すのは 10^6まで範囲があるので、 10^12
// で全くもってNG 工夫して計算量を抑える必要がある。 ある座標での経路総数を
// f(x,y) とすると f(a+1,b) = f(a,0) + f(a,1) + f(a,2) + ... + f(a,b) らしい。
// 3 ─〇 ← (a+1, 3)
// 2 ─┤
// 1 ─┤
// 0 ─... | replace | 23 | 24 | 23 | 24 | 0 | |
p02782 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep1(i, n) for (int i = 1; i <= n; ++i)
using namespace std;
typedef long long ll;
const ll MOD = 1e+9 + 7;
struct mint {
ll x;
mint(ll x = 0) : x(x % MOD) {}
mint &operator+=(const mint a) {
if ((... | #include <algorithm>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep1(i, n) for (int i = 1; i <= n; ++i)
using namespace std;
typedef long long ll;
const ll MOD = 1e+9 + 7;
struct mint {
ll x;
mint(ll x = 0) : x(x % MOD) {}
mint &operator+=(const mint a) {
if ((... | replace | 55 | 56 | 55 | 56 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define repr(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
#define reprrev(i, a, b) for (int i = b - 1; i >= a; i--) // [a, b)
#define reprev(i, n) reprrev(i, 0, n)
typedef long long ll;
typedef unsigned long long ull;
template <class T>... | #include <bits/stdc++.h>
using namespace std;
#define repr(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
#define reprrev(i, a, b) for (int i = b - 1; i >= a; i--) // [a, b)
#define reprev(i, n) reprrev(i, 0, n)
typedef long long ll;
typedef unsigned long long ull;
template <class T>... | replace | 69 | 70 | 69 | 70 | 0 | |
p02782 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef vector<pii> VP;
typedef vector<strin... | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef vector<pii> VP;
typedef vector<strin... | replace | 46 | 48 | 46 | 48 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long lli;
const int N = 1000000 + 10;
const int MOD = 1000000007;
int f[N], fr[N], p[N];
int exp(int x, int n) {
int tmp;
if (n == 0)
return 1;
tmp = exp(x, n / 2);
tmp = 1LL * tmp * tmp % MOD;
if (n % 2)
tmp = 1LL * tmp * x % MOD;
retu... | #include <bits/stdc++.h>
using namespace std;
typedef long long lli;
const int N = 2000000 + 10;
const int MOD = 1000000007;
int f[N], fr[N], p[N];
int exp(int x, int n) {
int tmp;
if (n == 0)
return 1;
tmp = exp(x, n / 2);
tmp = 1LL * tmp * tmp % MOD;
if (n % 2)
tmp = 1LL * tmp * x % MOD;
retu... | replace | 6 | 7 | 6 | 7 | 0 | |
p02782 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define MOD (long long)(1e9 + 7)
#define MAX 500000
template <int mod> struct ModInt {
int x;
ModInt() : x(0) {}
ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
ModInt &operator+=(const ModInt &p) {
if ((x += p.x) >= mod)
x -= mod;
... | #include <bits/stdc++.h>
using namespace std;
#define MOD (long long)(1e9 + 7)
#define MAX 5000000
template <int mod> struct ModInt {
int x;
ModInt() : x(0) {}
ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
ModInt &operator+=(const ModInt &p) {
if ((x += p.x) >= mod)
x -= mod;... | replace | 4 | 5 | 4 | 5 | 0 | |
p02782 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define fastio \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define fastio \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(... | replace | 46 | 47 | 46 | 47 | TLE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.