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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02632 | C++ | Runtime Error | /*input
37564
whydidyoudesertme
*/
// Nihesh Anderson - knandy
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef tree<ll, null_type, less<ll>, rb_tree_tag,
... | /*input
37564
whydidyoudesertme
*/
// Nihesh Anderson - knandy
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef tree<ll, null_type, less<ll>, rb_tree_tag,
... | replace | 45 | 46 | 45 | 46 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h> // clang-format off
using Int = long long;
#define REP_(i, a_, b_, a, b, ...) for (Int i = (a), lim##i = (b); i < lim##i; i++)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
struct SetupIO { SetupIO() { std::cin.tie(nullptr), std::ios::sync_with_stdio(false), std::cout <<... | #include <bits/stdc++.h> // clang-format off
using Int = long long;
#define REP_(i, a_, b_, a, b, ...) for (Int i = (a), lim##i = (b); i < lim##i; i++)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
struct SetupIO { SetupIO() { std::cin.tie(nullptr), std::ios::sync_with_stdio(false), std::cout <<... | replace | 95 | 96 | 95 | 96 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<ll, ll> P;
const int mod =
1000000007; // 出力は (ans % mod + mod) % mod (負の剰余を正にする)
const int inf = 1e9;
const long long INF = 1LL << 60; // IN... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<ll, ll> P;
const int mod =
1000000007; // 出力は (ans % mod + mod) % mod (負の剰余を正にする)
const int inf = 1e9;
const long long INF = 1LL << 60; // IN... | replace | 13 | 14 | 13 | 14 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define finish(x) return cout << x << endl, 0
#define ll long long
const int N = 1000001;
int n, k, fact[N], inv[N], mod = 1e9 + 7;
string s;
int powlog(int a, int b) {
if (b == 0)
return 1;
int ret = powlog(a, b / 2);
if (b % 2)
return 1LL * ret * ret % mo... | #include <bits/stdc++.h>
using namespace std;
#define finish(x) return cout << x << endl, 0
#define ll long long
const int N = 2000001;
int n, k, fact[N], inv[N], mod = 1e9 + 7;
string s;
int powlog(int a, int b) {
if (b == 0)
return 1;
int ret = powlog(a, b / 2);
if (b % 2)
return 1LL * ret * ret % mo... | replace | 5 | 6 | 5 | 6 | 0 | |
p02632 | C++ | Runtime Error | // #include "bits/stdc++.h"
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#incl... | // #include "bits/stdc++.h"
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#incl... | replace | 67 | 68 | 67 | 68 | 0 | |
p02632 | C++ | Runtime Error | // 四則演算 #pragma GCC target("avx")
// 並列計算 #pragma GCC optimize("O3")
// 条件分岐を減らす #pragma GCC optimize("unroll-loops")
// 浮動小数点演算 #pragma GCC
// target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<... | // 四則演算 #pragma GCC target("avx")
// 並列計算 #pragma GCC optimize("O3")
// 条件分岐を減らす #pragma GCC optimize("unroll-loops")
// 浮動小数点演算 #pragma GCC
// target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<... | replace | 170 | 171 | 170 | 171 | 0 | |
p02632 | 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 fac[N], inv[N];
char s[N];
int k;
ll qp(ll a, ll b) {
ll res = 1;
while (b) {
if (b & 1)
res = res * a % mod;
a = a * a % mod;
b >>= 1;
}
return res;
}
void init() {
fac... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e6 + 10;
const int mod = 1e9 + 7;
ll fac[N], inv[N];
char s[N];
int k;
ll qp(ll a, ll b) {
ll res = 1;
while (b) {
if (b & 1)
res = res * a % mod;
a = a * a % mod;
b >>= 1;
}
return res;
}
void init() {
fac... | replace | 4 | 5 | 4 | 5 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
ll mod_pow(ll a, ll n) {
a %= MOD;
ll ret = 1;
while (n > 0) {
if (n ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
const int MAX = 2000010;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
ll mod_pow(ll a, ll n) {
a %= MOD;
ll ret = 1;
while (n > 0) {
if (n... | replace | 4 | 5 | 4 | 5 | 0 | |
p02632 | C++ | Runtime Error | /*================================================================
*
* 创 建 者: badcw
* 创建日期: 2020/6/21 20:51
*
================================================================*/
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn = 1e6 + 50;
const int mod = 1e9 + 7;
ll qp(ll a, ll n, ... | /*================================================================
*
* 创 建 者: badcw
* 创建日期: 2020/6/21 20:51
*
================================================================*/
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn = 2e6 + 50;
const int mod = 1e9 + 7;
ll qp(ll a, ll n, ... | replace | 11 | 12 | 11 | 12 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
//.define
// #define FILE_IN_OUT
#define RET(_x) return cout << (_x) << '\n', 0;
#define all(_obj) (_obj).begin(), (_obj).end()
#define loop(_n) for (int i = 0; i < (_n); ++i)
#define CeilDiv(_dividend, _divider) \
(((_dividend)-... | #include <bits/stdc++.h>
using namespace std;
//.define
// #define FILE_IN_OUT
#define RET(_x) return cout << (_x) << '\n', 0;
#define all(_obj) (_obj).begin(), (_obj).end()
#define loop(_n) for (int i = 0; i < (_n); ++i)
#define CeilDiv(_dividend, _divider) \
(((_dividend)-... | replace | 33 | 34 | 33 | 34 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
// #define MOD 998244353
#define INF 1000000010
#define EPS 1e-9
#define F first
#define S second
#define debug(x) cout << x << endl;
#define repi(i, x, n) for (int i = x; i < n; i++)
#define rep(i, n) repi(i, 0, n)
#define lp(i, n) repi(i, 0, n)
#de... | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
// #define MOD 998244353
#define INF 1000000010
#define EPS 1e-9
#define F first
#define S second
#define debug(x) cout << x << endl;
#define repi(i, x, n) for (int i = x; i < n; i++)
#define rep(i, n) repi(i, 0, n)
#define lp(i, n) repi(i, 0, n)
#de... | replace | 21 | 22 | 21 | 22 | 0 | |
p02632 | C++ | Runtime Error | #include <iostream>
#include <map>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
const ll MOD = 1e9 + 7;
const int M = 1e6 + 5;
ll fac[M], ifac[M];
ll inv(ll x) {
ll ans = 1;
ll p = MOD - 2;
while (p > 0) {
if (p & 1)
ans = (ans * x) % MOD;
p >>= 1;
x = ... | #include <iostream>
#include <map>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
const ll MOD = 1e9 + 7;
const int M = 2e6 + 5;
ll fac[M], ifac[M];
ll inv(ll x) {
ll ans = 1;
ll p = MOD - 2;
while (p > 0) {
if (p & 1)
ans = (ans * x) % MOD;
p >>= 1;
x = ... | replace | 8 | 9 | 8 | 9 | 0 | |
p02632 | C++ | Runtime Error | // Optimise
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "/home/shahraaz/bin/debug.h"
#else
#define db(...)
#endif
using ll = long long;
#define f first
#define s second
#define pb push_back
#define all(v) v.begin(), v.end()
const int NAX = 2e5 + 5, MOD = 1000000007;
const int _n = 2e5 + 10;
... | // Optimise
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "/home/shahraaz/bin/debug.h"
#else
#define db(...)
#endif
using ll = long long;
#define f first
#define s second
#define pb push_back
#define all(v) v.begin(), v.end()
const int NAX = 2e5 + 5, MOD = 1000000007;
const int _n = 2e6 + 10;
... | replace | 18 | 19 | 18 | 19 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const ll MOD = 1e9 + 7;
const ll MX = 1e6 + 6;
ll gcd(ll a, ll b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
ll extend_gcd(ll a, ll b, ll &x, ll &y) {
if (b == 0) {
x = 1, y =... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const ll MOD = 1e9 + 7;
const ll MX = 2e6 + 6;
ll gcd(ll a, ll b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
ll extend_gcd(ll a, ll b, ll &x, ll &y) {
if (b == 0) {
x = 1, y =... | replace | 8 | 9 | 8 | 9 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ALL(a) (a).begin(), (a).end()
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>... | #include <bits/stdc++.h>
#define ALL(a) (a).begin(), (a).end()
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>... | replace | 76 | 77 | 76 | 77 | 0 | |
p02632 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
const int MAX = 1000001;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] =... | #include <algorithm>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
const int MAX = 3000000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] =... | replace | 11 | 12 | 11 | 12 | 0 | |
p02632 | C++ | Runtime Error | /**
* author: boutarou
* created: 21.06.2020 21:30:14
**/
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); i++)
#define fcout cout << fixed << setprecision(15)
using lint = long long;
using P = pair<int, int>;
template <class T> inline bool chmax(T &a, const T &b) ... | /**
* author: boutarou
* created: 21.06.2020 21:30:14
**/
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); i++)
#define fcout cout << fixed << setprecision(15)
using lint = long long;
using P = pair<int, int>;
template <class T> inline bool chmax(T &a, const T &b) ... | replace | 43 | 44 | 43 | 44 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using Int = long long;
const Int MOD = 1000000007;
const Int MAX = 1000100;
Int fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
fac[0] = fac[1] = finv[0] = finv[1] = inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD - inv[MO... | #include <bits/stdc++.h>
using namespace std;
using Int = long long;
const Int MOD = 1000000007;
const Int MAX = 2000100;
Int fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
fac[0] = fac[1] = finv[0] = finv[1] = inv[1] = 1;
for (int i = 2; i < MAX; i++) {
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD - inv[MO... | replace | 4 | 5 | 4 | 5 | 0 | |
p02632 | C++ | Runtime Error | #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;
}
const int MAX = 1000001;
const int MOD = 1000000007;
long lon... | #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;
}
const int MAX = 2000001;
const int MOD = 1000000007;
long lon... | replace | 13 | 14 | 13 | 14 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// 型定義
typedef long long ll;
typedef pair<ll, ll> P;
// forループ
#define REP(i, n) for (ll i = 0; i < (ll)(n); ++i)
// 定数宣言
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
// グラフ表現
using Graph = vector<vector<int>>;
// グラフの辺表現
using Edge = map<pair<in... | #include <bits/stdc++.h>
using namespace std;
// 型定義
typedef long long ll;
typedef pair<ll, ll> P;
// forループ
#define REP(i, n) for (ll i = 0; i < (ll)(n); ++i)
// 定数宣言
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
// グラフ表現
using Graph = vector<vector<int>>;
// グラフの辺表現
using Edge = map<pair<in... | replace | 38 | 39 | 38 | 39 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
} else {
return false;
}
}
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
} else {
return false;
}
}
#define ll long long
#define double lon... | #include <bits/stdc++.h>
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
} else {
return false;
}
}
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
} else {
return false;
}
}
#define ll long long
#define double lon... | replace | 30 | 31 | 30 | 31 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define PI 3.14159265359
#define INF 1000100100
#define MOD 1000000007
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define PP pair<P, P>
using namespace std;
// const int mod = 998244353;
const int mod = 1000000007;
struct mint {
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define PI 3.14159265359
#define INF 1000100100
#define MOD 1000000007
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define PP pair<P, P>
using namespace std;
// const int mod = 998244353;
const int mod = 1000000007;
struct mint {
... | replace | 86 | 87 | 86 | 87 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 10;
const int mod = 1e9 + 7;
int n, m;
int fac[maxn], ifac[maxn];
char s[maxn];
int mul(int x, int y) { return 1ll * x * y % mod; }
int fpw(int x, int y) {
int r = 1;
for (int i = y; i; i >>= 1, x = mul(x, x))
if (i & 1)
r = mul(r, x);
... | #include <bits/stdc++.h>
using namespace std;
const int maxn = 2e6 + 10;
const int mod = 1e9 + 7;
int n, m;
int fac[maxn], ifac[maxn];
char s[maxn];
int mul(int x, int y) { return 1ll * x * y % mod; }
int fpw(int x, int y) {
int r = 1;
for (int i = y; i; i >>= 1, x = mul(x, x))
if (i & 1)
r = mul(r, x);
... | replace | 2 | 3 | 2 | 3 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++)
#define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--)
const int dx[4] = {1, 0, -1, 0... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++)
#define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--)
const int dx[4] = {1, 0, -1, 0... | replace | 108 | 109 | 108 | 109 | 0 | |
p02632 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define REP(i, n) for (ll(i) = (0); (i) < (n); ++i)
#define REV(i, n) for (ll(i)... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define REP(i, n) for (ll(i) = (0); (i) < (n); ++i)
#define REV(i, n) for (ll(i)... | replace | 70 | 71 | 70 | 71 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++)
#define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--)
const int dx[4] = {1, 0, -1, 0... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++)
#define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--)
const int dx[4] = {1, 0, -1, 0... | replace | 108 | 109 | 108 | 109 | 0 | |
p02632 | C++ | Runtime Error | // #pragma GCC optimize("Ofast")
// #pragma GCC optimize ("unroll-loops")
// #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 __gnu_pbds;
typedef lon... | // #pragma GCC optimize("Ofast")
// #pragma GCC optimize ("unroll-loops")
// #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 __gnu_pbds;
typedef lon... | replace | 34 | 35 | 34 | 35 | 0 | |
p02632 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
const int mx = 1e6 + 9;
inline void normal(ll &a) {
if (a >= MOD)
a %= MOD;
(a < 0) && (a += MOD);
}
inline ll modMul(ll a, ll b) {
normal(a), normal(b);
return (a * b) % MOD;
}
inline ll modAdd(ll a, ll b) {
no... | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
const int mx = 3e6 + 9;
inline void normal(ll &a) {
if (a >= MOD)
a %= MOD;
(a < 0) && (a += MOD);
}
inline ll modMul(ll a, ll b) {
normal(a), normal(b);
return (a * b) % MOD;
}
inline ll modAdd(ll a, ll b) {
no... | replace | 6 | 7 | 6 | 7 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define INF 1000000007
#define LINF (1LL << 61)
#define PI 3.14159265358979
typedef long long i64;
typedef pair<i64, i64> P;
inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return ... | #include <bits/stdc++.h>
using namespace std;
#define INF 1000000007
#define LINF (1LL << 61)
#define PI 3.14159265358979
typedef long long i64;
typedef pair<i64, i64> P;
inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return ... | replace | 40 | 41 | 40 | 41 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define foi(i, k, n) for (int i = (int)k; i < (int)n; ++i)
using namespace std;
constexpr int MOD = 7 + 1e9;
constexpr int MAXN = 5 + 1e6;
int add(int a, int b) {
int ans = a + b;
if (ans >= MOD)
ans -= MOD;
return ans;
}
int mul(int a, int b) { return (int)((1LL * a * b) % MOD); ... | #include <bits/stdc++.h>
#define foi(i, k, n) for (int i = (int)k; i < (int)n; ++i)
using namespace std;
constexpr int MOD = 7 + 1e9;
constexpr int MAXN = 5 + 3e6;
int add(int a, int b) {
int ans = a + b;
if (ans >= MOD)
ans -= MOD;
return ans;
}
int mul(int a, int b) { return (int)((1LL * a * b) % MOD); ... | replace | 6 | 7 | 6 | 7 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
const ll N = 1e6 + 30, Mod = 1e9 + 7;
const ll SQ = 330;
ll F[N], I[N];
ll mul(ll a, ll b) { return (a * b) % Mo... | #include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
const ll N = 2e6 + 30, Mod = 1e9 + 7;
const ll SQ = 330;
ll F[N], I[N];
ll mul(ll a, ll b) { return (a * b) % Mo... | replace | 10 | 11 | 10 | 11 | 0 | |
p02632 | C++ | Runtime Error | #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath> //sqrt pow
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <deque> // dequef
#includ... | #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath> //sqrt pow
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <deque> // dequef
#includ... | replace | 41 | 42 | 41 | 42 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i, m, n) for (ll i = (m); i <= (n); i++)
#define zep(i, m, n) for (ll i = (m); i < (n); i++)
#define rrep(i, m, n) for (ll i = (m); i >= (n); i--)
#define print(x) cout <<... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i, m, n) for (ll i = (m); i <= (n); i++)
#define zep(i, m, n) for (ll i = (m); i < (n); i++)
#define rrep(i, m, n) for (ll i = (m); i >= (n); i--)
#define print(x) cout <<... | replace | 16 | 17 | 16 | 17 | 0 | |
p02632 | C++ | Runtime Error | #include <fstream>
#include <iostream>
// BE CAREFUL WITH HASH TABLE & UNORDERED MAP
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
using namespace std;
#define MOD 1000000007
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, b) FOR(i, 0, b)
#define RFO(i, a, b) for (int ... | #include <fstream>
#include <iostream>
// BE CAREFUL WITH HASH TABLE & UNORDERED MAP
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
using namespace std;
#define MOD 1000000007
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, b) FOR(i, 0, b)
#define RFO(i, a, b) for (int ... | replace | 24 | 25 | 24 | 25 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// #define int long long
typedef long long ll;
// const int INF = 2e9;
// const ll INF = 9e18;
const int mod = 1000000007;
struct mint {
ll x; // typedef long long ll;
mint(ll x = 0) : x((x % mod + mod) % mod) {}
mint operator-() const { return mint(-x); }
mint &o... | #include <bits/stdc++.h>
using namespace std;
// #define int long long
typedef long long ll;
// const int INF = 2e9;
// const ll INF = 9e18;
const int mod = 1000000007;
struct mint {
ll x; // typedef long long ll;
mint(ll x = 0) : x((x % mod + mod) % mod) {}
mint operator-() const { return mint(-x); }
mint &o... | replace | 64 | 65 | 64 | 65 | 0 | |
p02632 | C++ | Runtime Error | /*#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/rational.hpp>
*/
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using ll = long long;
using ld = long double;
#define rep2(i, s, n) fo... | /*#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/rational.hpp>
*/
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using ll = long long;
using ld = long double;
#define rep2(i, s, n) fo... | replace | 94 | 95 | 94 | 95 | 0 | |
p02632 | C++ | Runtime Error | const int LG = 21;
const int N = 1e6 + 88;
const long long MOD = 1e9 + 7;
const long long INF = 1e9;
const long long INFLL = 1e18;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef... | const int LG = 21;
const int N = 2e6 + 88;
const long long MOD = 1e9 + 7;
const long long INF = 1e9;
const long long INFLL = 1e18;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef... | replace | 1 | 2 | 1 | 2 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
const int MAX = 200100;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = f... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
const int MAX = 2000100;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = ... | replace | 4 | 5 | 4 | 5 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// template {{{
#define range(i, l, r) for (int i = (int)(l); i < (int)(r); (i) += 1)
#define rrange(i, l, r) for (int i = (int)(r)-1; i >= (int)(l); (i) -= 1)
#define whole(f, x, ...) \
([&](decltype((x)) container)... | #include <bits/stdc++.h>
using namespace std;
// template {{{
#define range(i, l, r) for (int i = (int)(l); i < (int)(r); (i) += 1)
#define rrange(i, l, r) for (int i = (int)(r)-1; i >= (int)(l); (i) -= 1)
#define whole(f, x, ...) \
([&](decltype((x)) container)... | replace | 222 | 227 | 222 | 223 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10, mod = 1e9 + 7;
typedef long long ll;
ll fact[maxn], inv[maxn];
ll exp(ll a, ll b) {
ll res = 1LL;
for (; b; b >>= 1, a = (a * a) % mod)
if (b & 1)
res = (res * a) % mod;
return res;
}
void precalc() {
fact[0] = 1LL;
for (int i ... | #include <bits/stdc++.h>
using namespace std;
const int maxn = 2e6 + 10, mod = 1e9 + 7;
typedef long long ll;
ll fact[maxn], inv[maxn];
ll exp(ll a, ll b) {
ll res = 1LL;
for (; b; b >>= 1, a = (a * a) % mod)
if (b & 1)
res = (res * a) % mod;
return res;
}
void precalc() {
fact[0] = 1LL;
for (int i ... | replace | 2 | 3 | 2 | 3 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
using ll = long long;
const int MAX = 1010000;
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 - ... | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
using ll = long long;
const int MAX = 2010000;
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 - ... | replace | 6 | 7 | 6 | 7 | 0 | |
p02632 | C++ | Runtime Error | // I SELL YOU...!
#include <algorithm>
#include <chrono>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using TP = tuple<ll, ll, ll>;
void init_io() {
cin.tie(0);
ios::sy... | // I SELL YOU...!
#include <algorithm>
#include <chrono>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using TP = tuple<ll, ll, ll>;
void init_io() {
cin.tie(0);
ios::sy... | replace | 19 | 20 | 19 | 20 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long int
#define uu first
#define vv second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define INF 1e9
#define fastRead \
ios_base::sync_with_stdio(0); \
cin... | #include <bits/stdc++.h>
#define ll long long int
#define uu first
#define vv second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define INF 1e9
#define fastRead \
ios_base::sync_with_stdio(0); \
cin... | replace | 13 | 14 | 13 | 14 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(var, begin, end) for (int var = (begin); var <= (end); var++)
#define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--)
#define REP(var, length) FOR(var, 0, length - 1)
#define RREP(var, length) RFOR(var, length - 1, 0)
#de... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(var, begin, end) for (int var = (begin); var <= (end); var++)
#define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--)
#define REP(var, length) FOR(var, 0, length - 1)
#define RREP(var, length) RFOR(var, length - 1, 0)
#de... | replace | 133 | 138 | 133 | 135 | 0 | |
p02632 | C++ | Runtime Error | #pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
using base = complex<double>;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define M 1000000007
#define M2 998244353
#define ll long long
#define pll pair... | #pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
using base = complex<double>;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define M 1000000007
#define M2 998244353
#define ll long long
#define pll pair... | replace | 108 | 109 | 108 | 109 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;
struct fastio {
fastio() {
ios::sync_with_stdio(false);
cout << setprecision(10) << fixed;
cin.tie(0);
}
};
fastio _fast_io;
const int mod = 1e9 + 7;
int k;
string s;
const int N = 1e6 + 1;
ll fac[N];
... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;
struct fastio {
fastio() {
ios::sync_with_stdio(false);
cout << setprecision(10) << fixed;
cin.tie(0);
}
};
fastio _fast_io;
const int mod = 1e9 + 7;
int k;
string s;
const int N = 1e6 * 2 + 10;
ll fac... | replace | 19 | 20 | 19 | 20 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define MSET(x, y) memset(x, y, sizeof(x))
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define SZ size()
#define M 3000005
#define ll long long
#define ld long double
#define INF 1e18
#define endl "\n"
#define fastio ... | #include <bits/stdc++.h>
#define MSET(x, y) memset(x, y, sizeof(x))
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define SZ size()
#define M 3000005
#define ll long long
#define ld long double
#define INF 1e18
#define endl "\n"
#define fastio ... | replace | 38 | 39 | 38 | 39 | 0 | |
p02632 | C++ | Runtime Error | #include <iostream>
using namespace std;
const int MOD = 1000000007;
const int BUF = 1000005;
int factorial[BUF];
int add(int a, int b) { return (1LL * a + b) % MOD; }
int mul(int a, int b) { return 1LL * a * b % MOD; }
int modpow(int p, int n) {
if (n == 0)
return 1;
int t = modpow(p, n / 2);
return n & ... | #include <iostream>
using namespace std;
const int MOD = 1000000007;
const int BUF = 2000005;
int factorial[BUF];
int add(int a, int b) { return (1LL * a + b) % MOD; }
int mul(int a, int b) { return 1LL * a * b % MOD; }
int modpow(int p, int n) {
if (n == 0)
return 1;
int t = modpow(p, n / 2);
return n & ... | replace | 3 | 4 | 3 | 4 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int const nax = 1e3 + 10;
const int mod = 1000000007; //
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; }
int sub(int a, int ... | #include <bits/stdc++.h>
using namespace std;
int const nax = 2e6 + 10;
const int mod = 1000000007; //
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; }
int sub(int a, int ... | replace | 2 | 3 | 2 | 3 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
ll fac[N], inv[N];
ll binpow(ll a, ll b) {
ll res = 1;
while (b) {
if (b & 1)
res = res * a % mod;
a = a * a % mod;
b >>= 1;
}
return res;
}
void init() {
fac[0] = 1;
for... | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
const int N = 2e6 + 10;
const int mod = 1e9 + 7;
ll fac[N], inv[N];
ll binpow(ll a, ll b) {
ll res = 1;
while (b) {
if (b & 1)
res = res * a % mod;
a = a * a % mod;
b >>= 1;
}
return res;
}
void init() {
fac[0] = 1;
for... | replace | 3 | 4 | 3 | 4 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
constexpr int MOD = 1000000007;
// constexpr int MOD = 998244353;
constexpr int MAX = 510000;
vector<long> fact(MAX), finv(MAX), inve(MAX);
void init() {
fact.at(0) = fact.at(1) = 1;
finv.at(0) = finv.at(1) = 1;
inve.at(1) = 1;
for (int i = 2; i < MAX; i++) {
... | #include <bits/stdc++.h>
using namespace std;
constexpr int MOD = 1000000007;
// constexpr int MOD = 998244353;
constexpr int MAX = 3000000;
vector<long> fact(MAX), finv(MAX), inve(MAX);
void init() {
fact.at(0) = fact.at(1) = 1;
finv.at(0) = finv.at(1) = 1;
inve.at(1) = 1;
for (int i = 2; i < MAX; i++) {
... | replace | 5 | 6 | 5 | 6 | 0 | |
p02632 | C++ | Time Limit Exceeded |
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
#define F first
#define S second
#define def(x) cerr << #x << " is " << x << endl;
#define mod 1000000007
#define pb push_back
#define FOR(i, a, n) for (ll i = a; i < n; i++)
#define ios ... |
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
#define F first
#define S second
#define def(x) cerr << #x << " is " << x << endl;
#define mod 1000000007
#define pb push_back
#define FOR(i, a, n) for (ll i = a; i < n; i++)
#define ios ... | replace | 35 | 44 | 35 | 43 | TLE | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define REP(i, s, n) for (int i = s; i < n; i++)
#define NUM 2520
#define INF (1LL << 50)
#define DEBUG 1
#define mp(a, b) make_pair(a, b)
#define SORT(V) sort(V.begin(), V.end())
#define PI (3.141592653589794)
#define TO_STRING(VariableName) #Var... | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define REP(i, s, n) for (int i = s; i < n; i++)
#define NUM 2520
#define INF (1LL << 50)
#define DEBUG 1
#define mp(a, b) make_pair(a, b)
#define SORT(V) sort(V.begin(), V.end())
#define PI (3.141592653589794)
#define TO_STRING(VariableName) #Var... | replace | 139 | 140 | 139 | 140 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pcc pair<char, char>
#define vi vector<int>
#define vl vector<ll>
#define sd(x) scanf("%d", &x)
#define slld(x) scanf("%lld", &x)
#define p... | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pcc pair<char, char>
#define vi vector<int>
#define vl vector<ll>
#define sd(x) scanf("%d", &x)
#define slld(x) scanf("%lld", &x)
#define p... | replace | 38 | 39 | 38 | 39 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define REP(i, a, n) for (int i = (a); i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define FOR(it, c) \
for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, a, n) for (int i = (a); i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define FOR(it, c) \
for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).... | replace | 64 | 65 | 64 | 65 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define mp make_pair
#define v vector
#define inp_push(no, v) \
ll no; \
ci... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define mp make_pair
#define v vector
#define inp_push(no, v) \
ll no; \
ci... | replace | 17 | 18 | 17 | 18 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define SZ(x) (int)x.size()
#define ll long long
#define pb push_back
#define pq priority_queue
#define pii pair<int, int>
#define mod 1000000007
#define inf 0x3f3f3f3f
#define debug(x) cerr << #x << "=" << x << '\n'
#define rep(i, a, b) ... | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define SZ(x) (int)x.size()
#define ll long long
#define pb push_back
#define pq priority_queue
#define pii pair<int, int>
#define mod 1000000007
#define inf 0x3f3f3f3f
#define debug(x) cerr << #x << "=" << x << '\n'
#define rep(i, a, b) ... | replace | 15 | 16 | 15 | 16 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vin = vector<int>;
using vll = vector<long long>;
using vvin = vector<vector<int>>;
using vvll = vector<vector<long long>>;
using vstr = vector<string>;
using vvstr = vector<vector<string>>;
using vch = vector<char>;
using vvch = vector<vector<ch... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vin = vector<int>;
using vll = vector<long long>;
using vvin = vector<vector<int>>;
using vvll = vector<vector<long long>>;
using vstr = vector<string>;
using vvstr = vector<vector<string>>;
using vch = vector<char>;
using vvch = vector<vector<ch... | replace | 23 | 24 | 23 | 24 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 1000000 + 5, yzh = 1e9 + 7;
int k, n, fac[N], ifac[N];
char ch[N];
int quick_pow(int a, int b) {
int ans = 1;
while (b) {
if (b & 1)
ans = 1ll * a * ans % yzh;
b >>= 1, a = 1ll * a * a % yzh;
}
return ans;
}
int C(int n, int m) { return... | #include <bits/stdc++.h>
using namespace std;
const int N = 2000000 + 5, yzh = 1e9 + 7;
int k, n, fac[N], ifac[N];
char ch[N];
int quick_pow(int a, int b) {
int ans = 1;
while (b) {
if (b & 1)
ans = 1ll * a * ans % yzh;
b >>= 1, a = 1ll * a * a % yzh;
}
return ans;
}
int C(int n, int m) { return... | replace | 2 | 3 | 2 | 3 | 0 | |
p02632 | 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;
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 ... | #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;
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 ... | replace | 27 | 28 | 27 | 28 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define MOD 1000000007
using namespace std;
#define MAX 1000001
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; i++) {
fac[i] = fac[i - 1] ... | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define MOD 1000000007
using namespace std;
#define MAX 2000001
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; i++) {
fac[i] = fac[i - 1] ... | replace | 5 | 6 | 5 | 6 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int... | #include <bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int... | replace | 103 | 104 | 103 | 104 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long mpow(long long a, int n) {
if (n == 0)
return 1;
if (n == 1)
return a;
if (n % 2)
return (a * (mpow(a, n - 1) % mod)) % mod;
else {
long long tmp = mpow(a, n / 2) % mod;
return tmp * tmp % mod;
}
}
const in... | #include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long mpow(long long a, int n) {
if (n == 0)
return 1;
if (n == 1)
return a;
if (n % 2)
return (a * (mpow(a, n - 1) % mod)) % mod;
else {
long long tmp = mpow(a, n / 2) % mod;
return tmp * tmp % mod;
}
}
const in... | replace | 18 | 19 | 18 | 19 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
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) >= MOD)
x -= MOD;
return *this;
}
mint &operator-=(... | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
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) >= MOD)
x -= MOD;
return *this;
}
mint &operator-=(... | replace | 66 | 67 | 66 | 67 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define Sz(a) ((int)(a).size())
const int maxn = 1000009;
const int MOD = 1e9 + 7;
int64_t fac[maxn], invfac[maxn];
int64_t pw(int64_t a, int64_t b) {
int64_t c = 1;
while (b) {
if (b & 1ll)
c = c * a % MOD;
b >>= 1;
a = a * a % MOD;
}
return c;
}
... | #include <bits/stdc++.h>
using namespace std;
#define Sz(a) ((int)(a).size())
const int maxn = 2000009;
const int MOD = 1e9 + 7;
int64_t fac[maxn], invfac[maxn];
int64_t pw(int64_t a, int64_t b) {
int64_t c = 1;
while (b) {
if (b & 1ll)
c = c * a % MOD;
b >>= 1;
a = a * a % MOD;
}
return c;
}
... | replace | 3 | 4 | 3 | 4 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define REP(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define REPV(iter, v) \
for (auto(iter) = (v).begin(); (iter) != (v).end(); ++(iter))
#define ALL(v) (v).begin(), (v).end()
#define MOD 1000000007
using namespace std;
typedef lon... | #include <bits/stdc++.h>
#define REP(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define REPV(iter, v) \
for (auto(iter) = (v).begin(); (iter) != (v).end(); ++(iter))
#define ALL(v) (v).begin(), (v).end()
#define MOD 1000000007
using namespace std;
typedef lon... | replace | 13 | 14 | 13 | 14 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using lint = long long int;
template <int64_t MOD> struct Mint {
int64_t v;
Mint() { v = 0; }
Mint(int64_t x) {
v = x % MOD;
if (v < 0)
v += MOD;
}
Mint operator-() { return Mint{-v}; };
Mint operator+(Mint x) { return Mint(v + x.v); };
Mint op... | #include <bits/stdc++.h>
using namespace std;
using lint = long long int;
template <int64_t MOD> struct Mint {
int64_t v;
Mint() { v = 0; }
Mint(int64_t x) {
v = x % MOD;
if (v < 0)
v += MOD;
}
Mint operator-() { return Mint{-v}; };
Mint operator+(Mint x) { return Mint(v + x.v); };
Mint op... | replace | 63 | 64 | 63 | 64 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int MOD = 1e9 + 7;
const int MAXN = 1e6 + 100;
int qpow(int a, int b) {
int res = 1;
while (b) {
if (b & 1)
res = res * a % MOD;
a = a * a % MOD;
b /= 2;
}
return res;
}
int inv(int x) { return qpow(x, MOD - 2); }
... | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int MOD = 1e9 + 7;
const int MAXN = 2e6 + 100;
int qpow(int a, int b) {
int res = 1;
while (b) {
if (b & 1)
res = res * a % MOD;
a = a * a % MOD;
b /= 2;
}
return res;
}
int inv(int x) { return qpow(x, MOD - 2); }
... | replace | 8 | 9 | 8 | 9 | 0 | |
p02632 | C++ | Runtime Error | // #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization ("Ofast")
// #pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// template <typename T>
// using o_s... | // #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization ("Ofast")
// #pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// template <typename T>
// using o_s... | replace | 53 | 54 | 53 | 54 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"
constexpr int MOD = 1000000007;
const int INF = 1 << 30;
con... | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"
constexpr int MOD = 1000000007;
const int INF = 1 << 30;
con... | replace | 12 | 13 | 12 | 13 | 0 | |
p02632 | C++ | Runtime Error |
// Problem : F - Strivore
// Contest : AtCoder - AtCoder Beginner Contest 171
// URL : https://atcoder.jp/contests/abc171/tasks/abc171_f
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
/*
We want to count the number of strings T of length |S|+K such tha... |
// Problem : F - Strivore
// Contest : AtCoder - AtCoder Beginner Contest 171
// URL : https://atcoder.jp/contests/abc171/tasks/abc171_f
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
/*
We want to count the number of strings T of length |S|+K such tha... | replace | 343 | 344 | 343 | 344 | 0 | |
p02632 | C++ | Runtime Error | #include <algorithm>
#include <assert.h>
#include <cmath>
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <vector>
#defi... | #include <algorithm>
#include <assert.h>
#include <cmath>
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <vector>
#defi... | replace | 18 | 19 | 18 | 19 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int maxn = 2e5 + 555;
const int MOD = 1e9 + 7;
ll xpow(ll a, ll b) {
ll ret = 1;
a %= MOD;
assert(b >= 0);
while (b) {
if (b & 1)
ret = ret * a % MOD;
a = a * a % MOD;
b >>= 1;
}
return ret;
}
int32_t main() {
ios:... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int maxn = 2e6 + 555;
const int MOD = 1e9 + 7;
ll xpow(ll a, ll b) {
ll ret = 1;
a %= MOD;
assert(b >= 0);
while (b) {
if (b & 1)
ret = ret * a % MOD;
a = a * a % MOD;
b >>= 1;
}
return ret;
}
int32_t main() {
ios:... | replace | 3 | 4 | 3 | 4 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) \
for (__typeof__((s).begin()... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) \
for (__typeof__((s).begin()... | replace | 59 | 60 | 59 | 60 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rgi register int
#define ll long long
class fastin {
private:
int _ch, _f;
public:
inline fastin &operator>>(char &c) {
c = getchar();
return *this;
}
template <typename _Tp> inline fastin &operator>>(_Tp &_x) {
_x = 0;
while (!isdigit(_ch))
_f |= (_ch == ... | #include <bits/stdc++.h>
#define rgi register int
#define ll long long
class fastin {
private:
int _ch, _f;
public:
inline fastin &operator>>(char &c) {
c = getchar();
return *this;
}
template <typename _Tp> inline fastin &operator>>(_Tp &_x) {
_x = 0;
while (!isdigit(_ch))
_f |= (_ch == ... | replace | 53 | 54 | 53 | 54 | 0 | |
p02632 | C++ | Time Limit Exceeded | const int isDebugMode = 1;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
struct edge {
long long to, cost;
};
const int inf = 1 << 27;
const long long INF = 1LL << 60;
const int COMBMAX = 1001001;
const long long MOD = 1000000007;
const long long dy[] = {-1,... | const int isDebugMode = 1;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
struct edge {
long long to, cost;
};
const int inf = 1 << 27;
const long long INF = 1LL << 60;
const int COMBMAX = 3000000;
const long long MOD = 1000000007;
const long long dy[] = {-1,... | replace | 10 | 11 | 10 | 11 | TLE | |
p02632 | 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 MAX = 1000005;
const ll 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;
fo... | #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 MAX = 2000005;
const ll 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;
fo... | replace | 6 | 7 | 6 | 7 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define int l... | #include <bits/stdc++.h>
using namespace std;
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define int l... | replace | 55 | 56 | 55 | 56 | 0 | |
p02632 | C++ | Time Limit Exceeded | #pragma GCC optimize("O2")
#pragma GCC target("avx2")
// #include<bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define c... | #pragma GCC optimize("O2")
#pragma GCC target("avx2")
// #include<bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define c... | delete | 63 | 64 | 63 | 63 | TLE | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h> // ver2.7.1
#define int long long
#define endl "\n" // fflush(stdout);
#define ALL(v) (v).begin(), (v).end()
#define Vi vector<int>
#define VVi vector<Vi>
#define VVVi vector<VVi>
#define Vm vector<mint>
#define Vs vector<string>
#define Vd vector<double>
#define Vc vector<char>
#define Pii pai... | #include <bits/stdc++.h> // ver2.7.1
#define int long long
#define endl "\n" // fflush(stdout);
#define ALL(v) (v).begin(), (v).end()
#define Vi vector<int>
#define VVi vector<Vi>
#define VVVi vector<VVi>
#define Vm vector<mint>
#define Vs vector<string>
#define Vd vector<double>
#define Vc vector<char>
#define Pii pai... | replace | 228 | 229 | 228 | 229 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define repl(i, l, r) for (ll i = (l); i < (r); i++)
#define rep(i, n) repl(i, 0, n)
using ll = long long;
const ll MOD = 1000000007;
const ll MAX = 1100000;
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
r... | #include <bits/stdc++.h>
using namespace std;
#define repl(i, l, r) for (ll i = (l); i < (r); i++)
#define rep(i, n) repl(i, 0, n)
using ll = long long;
const ll MOD = 1000000007;
const ll MAX = 2100000;
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
r... | replace | 6 | 7 | 6 | 7 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define N 1000001 // size of array
const ll MOD = 1e9 + 7;
ll fac[N], inv[N], finv[N];
void com_init() {
fac[0] = 1;
fac[1] = 1;
finv[0] = 1;
finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < N; i++) {
fac[i] = fac[i - 1] * i % MOD;
i... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define N 2000000 // size of array
const ll MOD = 1e9 + 7;
ll fac[N], inv[N], finv[N];
void com_init() {
fac[0] = 1;
fac[1] = 1;
finv[0] = 1;
finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < N; i++) {
fac[i] = fac[i - 1] * i % MOD;
i... | replace | 4 | 5 | 4 | 5 | 0 | |
p02632 | 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 | |
p02632 | C++ | Runtime Error | #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx")
// #pragma comment(linker, "/stack:200000000"]
#include <algorithm>
#include <bitset>
#include <chrono>
#include <cmath>
#include <deque>
#include <fstream>
#include <... | #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx")
// #pragma comment(linker, "/stack:200000000"]
#include <algorithm>
#include <bitset>
#include <chrono>
#include <cmath>
#include <deque>
#include <fstream>
#include <... | replace | 45 | 46 | 45 | 46 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
void fst() {
ios::sync_with_stdio(0);
cin.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
#endif
}
int nxt() {
int x;
cin >> x;
return x;
}
int nex_l() {
long long x;
cin >> x;
return x;
}
typedef long long ll;
typedef vector<int> vi;
type... | #include <bits/stdc++.h>
using namespace std;
void fst() {
ios::sync_with_stdio(0);
cin.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
#endif
}
int nxt() {
int x;
cin >> x;
return x;
}
int nex_l() {
long long x;
cin >> x;
return x;
}
typedef long long ll;
typedef vector<int> vi;
type... | replace | 47 | 48 | 47 | 48 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
const int64_t MOD = 1000000007;
int64_t ff[1000006];
int64_t fact(int n) {
if (n == 0)
return 1;
if (n == 1)
return 1;
if (ff[n] != 0)
return ff[n];
ff[n] = (fact(n - 1) * n) % MOD;
return ff[n] % MOD;
}
int64_t pm(int64_t a, int64_t b) {
if (b == 0)
return 1;
i... | #include <bits/stdc++.h>
const int64_t MOD = 1000000007;
int64_t ff[2000006];
int64_t fact(int n) {
if (n == 0)
return 1;
if (n == 1)
return 1;
if (ff[n] != 0)
return ff[n];
ff[n] = (fact(n - 1) * n) % MOD;
return ff[n] % MOD;
}
int64_t pm(int64_t a, int64_t b) {
if (b == 0)
return 1;
i... | replace | 3 | 4 | 3 | 4 | 0 | |
p02632 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
const int N = 1e6 + 10;
int fact[N], infact[N];
int qmi(int a, int b) {
int res = 1;
while (b) {
if (b & 1)
res = (ll)res * a % mod;
a = (ll)a * a % mod;
b >>= 1;
}
... | #include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
const int N = 2e6 + 10;
int fact[N], infact[N];
int qmi(int a, int b) {
int res = 1;
while (b) {
if (b & 1)
res = (ll)res * a % mod;
a = (ll)a * a % mod;
b >>= 1;
}
... | replace | 7 | 8 | 7 | 8 | 0 | |
p02632 | C++ | Runtime Error | #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 fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
typedef long long ll;
typedef pair<ll... | #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 fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
typedef long long ll;
typedef pair<ll... | replace | 87 | 88 | 87 | 88 | 0 | |
p02632 | C++ | Runtime Error | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include ... | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include ... | replace | 35 | 36 | 35 | 36 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll, ll> P;
typedef vector<P> vp;
typedef vector<string> vs;
typedef vector<bool> vb;
const ll mod = 1e9 + 7;
const ll inf = 1e16;
#define rep(i, m, n) for (ll i = m; i < n; i++)
#define... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll, ll> P;
typedef vector<P> vp;
typedef vector<string> vs;
typedef vector<bool> vb;
const ll mod = 1e9 + 7;
const ll inf = 1e16;
#define rep(i, m, n) for (ll i = m; i < n; i++)
#define... | replace | 25 | 26 | 25 | 26 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e6 + 5;
const ll mod = 1e9 + 7;
int k, n;
string s;
ll f[N], inv[N];
ll pw(ll x, ll i) {
ll b = 1;
for (; i; i >>= 1, x = x * x % mod)
if (i & 1)
b = b * x % mod;
return b;
}
ll ckn(int n, int k) { return f[n] * inv[k... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 2e6 + 5;
const ll mod = 1e9 + 7;
int k, n;
string s;
ll f[N], inv[N];
ll pw(ll x, ll i) {
ll b = 1;
for (; i; i >>= 1, x = x * x % mod)
if (i & 1)
b = b * x % mod;
return b;
}
ll ckn(int n, int k) { return f[n] * inv[k... | replace | 6 | 7 | 6 | 7 | 0 | |
p02632 | C++ | Runtime Error | //
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
typedef pair<int, pint> ppint;
typedef pair<ll, pll> ppll;
typedef vector<int> vint;
typedef vector<ll> vll;
const double pi = M_PI;
const int INF10 = 1000000001;
const ll INF15 = 1e15 + 1;
c... | //
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
typedef pair<int, pint> ppint;
typedef pair<ll, pll> ppll;
typedef vector<int> vint;
typedef vector<ll> vll;
const double pi = M_PI;
const int INF10 = 1000000001;
const ll INF15 = 1e15 + 1;
c... | replace | 158 | 159 | 158 | 159 | 0 | |
p02632 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#define int long long
#define double long double
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i <= n; i++... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#define int long long
#define double long double
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i <= n; i++... | replace | 27 | 28 | 27 | 28 | 0 | |
p02632 | C++ | Runtime Error | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define fir first
#define sec second
using namesp... | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define fir first
#define sec second
using namesp... | replace | 26 | 27 | 26 | 27 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll M = 1e9 + 7;
ll n, m, ans = 0, fac[1000010];
string s;
ll mpow(ll a, ll n) {
int ret = 1;
for (ll i = n; i; i >>= 1, a = a * a % M)
if (i & 1)
ret = ret * a % M;
return ret;
}
int main() {
cin >> n >> s;
m = s.size();
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll M = 1e9 + 7;
ll n, m, ans = 0, fac[2000010];
string s;
ll mpow(ll a, ll n) {
int ret = 1;
for (ll i = n; i; i >>= 1, a = a * a % M)
if (i & 1)
ret = ret * a % M;
return ret;
}
int main() {
cin >> n >> s;
m = s.size();
... | replace | 6 | 7 | 6 | 7 | 0 | |
p02632 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
ll N, K;
ll m;
string ... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
ll N, K;
ll m;
string ... | replace | 47 | 48 | 47 | 48 | TLE | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long int lli;
const lli M = 1e9 + 7, N = 1e6 + 5;
lli fact[N];
lli binpow(lli a, lli b) {
if (b == 0)
return 1;
lli res = binpow(a, b / 2);
res = (res * res) % M;
if (b % 2)
return (res * a) % M;
return res;
}
lli inv(lli ... | #include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long int lli;
const lli M = 1e9 + 7, N = 2e6 + 5;
lli fact[N];
lli binpow(lli a, lli b) {
if (b == 0)
return 1;
lli res = binpow(a, b / 2);
res = (res * res) % M;
if (b % 2)
return (res * a) % M;
return res;
}
lli inv(lli ... | replace | 4 | 5 | 4 | 5 | 0 | |
p02632 | C++ | Runtime Error |
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif
void d_err() { cerr << endl; }
template <typename H, typename... T> void d_err(H h, T...... |
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif
void d_err() { cerr << endl; }
template <typename H, typename... T> void d_err(H h, T...... | replace | 99 | 100 | 99 | 100 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i < n; i++)
#define rev(i, n) for (int i = n - 1; i >= 0; i--)
#define all(v) v.begin(), v.end()
#define P pair<int, int>
#define len(s) (int)s.size()
#define pb push_back
... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i < n; i++)
#define rev(i, n) for (int i = n - 1; i >= 0; i--)
#define all(v) v.begin(), v.end()
#define P pair<int, int>
#define len(s) (int)s.size()
#define pb push_back
... | replace | 42 | 43 | 42 | 43 | 0 | |
p02632 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MP make_pair
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define PLI pair<ll, int>
#define PIL pair<int, ll>
#define STR string
#define Fst first
#define Snd second
#define SHN 1e9
#define LSHN 1e18
using namespace std;
ll n, m... | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MP make_pair
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define PLI pair<ll, int>
#define PIL pair<int, ll>
#define STR string
#define Fst first
#define Snd second
#define SHN 1e9
#define LSHN 1e18
using namespace std;
ll n, m... | replace | 33 | 34 | 33 | 34 | TLE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.