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 | #pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,avx2,fma")
#include <algorithm>
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define PI acos(-1.0)
#define No cout << "No\n";
#define Yes cout << "Yes\n";
#define no cout << "no\n";
#define yes cout << "... | #pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,avx2,fma")
#include <algorithm>
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define PI acos(-1.0)
#define No cout << "No\n";
#define Yes cout << "Yes\n";
#define no cout << "no\n";
#define yes cout << "... | replace | 110 | 111 | 110 | 111 | 0 | |
p02632 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <string>
#define flush fflush(stdout)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pl;
const int mod = (int)1e9 + 7, INF = (int)1e9;
const int di[4] = {1, 0, -1, 0}, dj[4] = {0, 1, 0, -1};
#define N 200007
ll fac[N], inv[N],... | #include <algorithm>
#include <iostream>
#include <string>
#define flush fflush(stdout)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pl;
const int mod = (int)1e9 + 7, INF = (int)1e9;
const int di[4] = {1, 0, -1, 0}, dj[4] = {0, 1, 0, -1};
#define N 2000007
ll fac[N], inv[N]... | replace | 11 | 12 | 11 | 12 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1 << 20, mod = 1e9 + 7;
int fact[maxn], inv[maxn];
void pre() {
for (int i = 0; i < maxn; i++)
if (i < 2)
fact[i] = inv[i] = 1;
else
fact[i] = i, inv[i] = mod - (mod / i) * 1ll * inv[mod % i] % mod;
for (int i = 1; i < maxn; i++)
... | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1 << 22, mod = 1e9 + 7;
int fact[maxn], inv[maxn];
void pre() {
for (int i = 0; i < maxn; i++)
if (i < 2)
fact[i] = inv[i] = 1;
else
fact[i] = i, inv[i] = mod - (mod / i) * 1ll * inv[mod % i] % mod;
for (int i = 1; i < maxn; i++)
... | replace | 2 | 3 | 2 | 3 | 0 | |
p02632 | C++ | Runtime Error | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
#define VI vector<int>
#define G(size_1) vector<vector<int>>(size_1, vector... | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
#define VI vector<int>
#define G(size_1) vector<vector<int>>(size_1, vector... | replace | 419 | 420 | 419 | 420 | 0 | |
p02632 | C++ | Runtime Error | // Mandelbrot: z(n+1) = (z(n))^2 + c
// Rick: I programmed you to believe that
// #include <boost/multiprecision/cpp_int.hpp>
#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
typedef long long int ll;
typedef double db;
// __int128 s128;
// __uint128_t u128;
typedef... | // Mandelbrot: z(n+1) = (z(n))^2 + c
// Rick: I programmed you to believe that
// #include <boost/multiprecision/cpp_int.hpp>
#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
typedef long long int ll;
typedef double db;
// __int128 s128;
// __uint128_t u128;
typedef... | replace | 47 | 48 | 47 | 48 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int ll
#define ll long long
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
// #define MOD 998244353
#define MEM_SIZE 2000100
#define DEBUG_OUT true
#define ALL(x) (... | #include <bits/stdc++.h>
using namespace std;
#define int ll
#define ll long long
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
// #define MOD 998244353
#define MEM_SIZE 2000100
#define DEBUG_OUT true
#define ALL(x) (... | replace | 103 | 104 | 103 | 104 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPP(i, n) for (int i = 1; i <= n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
long long INF = (long long)1E17;
#define i_7 (long long)(1E9 + 7)
// #define i_7 998'244'353
long mod(long a) {
long long c = a % i_7;
if (c >= 0)
re... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPP(i, n) for (int i = 1; i <= n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
long long INF = (long long)1E17;
#define i_7 (long long)(1E9 + 7)
// #define i_7 998'244'353
long mod(long a) {
long long c = a % i_7;
if (c >= 0)
re... | replace | 29 | 30 | 29 | 30 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
ll k;
char s[1000010];
ll fac[1000010], ifac[1000010], inv[1000010];
ll n;
ll ans;
ll ksm(ll a, ll b, ll m) {
ll ret = 1;
while (b) {
if (b & 1)
ret = (ret * a) % m;
a = (a * a) % m;
b >>= 1;
}
return r... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
ll k;
char s[1000010];
ll fac[2000010], ifac[2000010], inv[2000010];
ll n;
ll ans;
ll ksm(ll a, ll b, ll m) {
ll ret = 1;
while (b) {
if (b & 1)
ret = (ret * a) % m;
a = (a * a) % m;
b >>= 1;
}
return r... | replace | 6 | 7 | 6 | 7 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
#define x first
#define y second
#define getbit(x, i) (((x) >> (i)) & 1)
using namespace std;
typedef pair<int, int> pii;
#define hashset unordered_set
#define hashmap unordered_map
#define newline fast_writechar('\n')
#define unify(arr) arr.resize(unique(arr.begin(), arr.... | #include <bits/stdc++.h>
#define int long long
#define x first
#define y second
#define getbit(x, i) (((x) >> (i)) & 1)
using namespace std;
typedef pair<int, int> pii;
#define hashset unordered_set
#define hashmap unordered_map
#define newline fast_writechar('\n')
#define unify(arr) arr.resize(unique(arr.begin(), arr.... | replace | 53 | 54 | 53 | 54 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(a) (a).begin(), (a).end()
using namespace std;
using ll = long long int;
using vec = vector<int>;
using P = pair<int, int>;
const int mod = 1e9 + 7;
struct mint {
ll x; // typedef long long ll;
mint(ll x = 0) : x((x % mod + mod) %... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(a) (a).begin(), (a).end()
using namespace std;
using ll = long long int;
using vec = vector<int>;
using P = pair<int, int>;
const int mod = 1e9 + 7;
struct mint {
ll x; // typedef long long ll;
mint(ll x = 0) : x((x % mod + mod) %... | replace | 48 | 49 | 48 | 49 | 0 | |
p02632 | C++ | Runtime Error | // Coded by Abhijay Mitra
#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdlib.h>
#include <vector>
// ... | // Coded by Abhijay Mitra
#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdlib.h>
#include <vector>
// ... | replace | 39 | 40 | 39 | 40 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
// using namespace std;
#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")
#define rep(i, j, n) for (ll i = (ll)(j); i < (ll)(n); i++)
#define REP(i, j, n) for (ll i = (ll)(j); i... | #include <bits/stdc++.h>
// using namespace std;
#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")
#define rep(i, j, n) for (ll i = (ll)(j); i < (ll)(n); i++)
#define REP(i, j, n) for (ll i = (ll)(j); i... | replace | 32 | 33 | 32 | 33 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAX = 1e6 + 5;
int fact[MAX];
int inv[MAX];
int Power(int n, int x) {
if (x == 0) {
return 1;
} else if (x & 1) {
return 1ll * n * Power(n, x - 1) % MOD;
} else {
int res = Power(n, x / 2);
return 1ll * res * res %... | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAX = 3e6 + 5;
int fact[MAX];
int inv[MAX];
int Power(int n, int x) {
if (x == 0) {
return 1;
} else if (x & 1) {
return 1ll * n * Power(n, x - 1) % MOD;
} else {
int res = Power(n, x / 2);
return 1ll * res * res %... | replace | 4 | 5 | 4 | 5 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define bit(n) (1 << (n))
using namespace std;
typedef long long ll;
typede... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define bit(n) (1 << (n))
using namespace std;
typedef long long ll;
typede... | replace | 143 | 144 | 143 | 144 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
constexpr lint mod = 1e9 + 7;
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl((lint)(n))
#define fcout cout << fixed << setprecision(15)
#define highest(x) (63 - __builtin_clzl(x))
#define rep(i, n) for (int i = 0; i < i... | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
constexpr lint mod = 1e9 + 7;
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl((lint)(n))
#define fcout cout << fixed << setprecision(15)
#define highest(x) (63 - __builtin_clzl(x))
#define rep(i, n) for (int i = 0; i < i... | replace | 163 | 164 | 163 | 164 | 0 | |
p02632 | C++ | Runtime Error | #pragma region template
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vld = vector<l... | #pragma region template
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vld = vector<l... | replace | 156 | 157 | 156 | 157 | 0 | |
p02632 | 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; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
typedef long long ll;
const int MOD = 1e9 + 7;
const int MAXR = 10100... | #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; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
typedef long long ll;
const int MOD = 1e9 + 7;
const int MAXR = 30100... | replace | 11 | 12 | 11 | 12 | 0 | |
p02632 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#includ... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#includ... | replace | 198 | 199 | 198 | 199 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
using namespace std;
ll mpower(ll a, ll b, ll c) {
int z;
if (b == 0) {
z = 1;
z %= c;
return z;
}
if (b == 1) {
z = a;
z %= c;
return z;
} else {
return (((mpower(a, b / 2, c)) * (mpower(a, b / 2, c)) % c) *
mpower(a, b % ... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
ll mpower(ll a, ll b, ll c) {
int z;
if (b == 0) {
z = 1;
z %= c;
return z;
}
if (b == 1) {
z = a;
z %= c;
return z;
} else {
return (((mpower(a, b / 2, c)) * (mpower(a, b / 2, c)) % c) *
mpower(a, b % ... | replace | 21 | 22 | 21 | 22 | 0 | |
p02632 | C++ | Runtime Error | #pragma GCC target("avx")
// #pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define DB double
#define LD long double
#define ST string
#define BS bitset
#define PA pair<L... | #pragma GCC target("avx")
// #pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define DB double
#define LD long double
#define ST string
#define BS bitset
#define PA pair<L... | replace | 255 | 256 | 255 | 256 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MAX = 1000005;
ll mod = 1000000007;
ll fac[MAX];
ll finv[MAX];
ll inv[MAX];
// 階乗、逆階乗のテーブル作成
void conInit() {
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] * i % mod;
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MAX = 2000005;
ll mod = 1000000007;
ll fac[MAX];
ll finv[MAX];
ll inv[MAX];
// 階乗、逆階乗のテーブル作成
void conInit() {
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] * i % mod;
... | replace | 4 | 5 | 4 | 5 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7ll;
long long modpower(long long a, long long b) {
if (b == 0)
return 1ll;
long long x = modpower(a, b / 2ll);
x = (x * x) % mod;
if (b & 1)
return (x * a) % mod;
return (x % mod);
}
struct combination {
vector<long long>... | #include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7ll;
long long modpower(long long a, long long b) {
if (b == 0)
return 1ll;
long long x = modpower(a, b / 2ll);
x = (x * x) % mod;
if (b & 1)
return (x * a) % mod;
return (x % mod);
}
struct combination {
vector<long long>... | replace | 34 | 35 | 34 | 35 | 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 ll long long int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
typedef tree<ll, null_type, l... | #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 ll long long int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
typedef tree<ll, null_type, l... | replace | 19 | 20 | 19 | 20 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 10;
const ll mod = 1e9 + 7;
ll fac[maxn], inv[maxn], facinv[maxn], bin25[maxn], bin26[maxn];
void pre() {
fac[0] = 1;
for (int i = 1; i < maxn; ++i)
fac[i] = fac[i - 1] * i % mod;
inv[1] = 1;
for (int i = 2; i < maxn;... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2e6 + 10;
const ll mod = 1e9 + 7;
ll fac[maxn], inv[maxn], facinv[maxn], bin25[maxn], bin26[maxn];
void pre() {
fac[0] = 1;
for (int i = 1; i < maxn; ++i)
fac[i] = fac[i - 1] * i % mod;
inv[1] = 1;
for (int i = 2; i < maxn;... | replace | 3 | 4 | 3 | 4 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll, ll> P;
using VP = vector<P>;
using VVP = vector<VP>;
using VI = vector<ll>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;
const int inf = 1e9 + 7;
const ll INF = 1LL << 61;
co... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll, ll> P;
using VP = vector<P>;
using VVP = vector<VP>;
using VI = vector<ll>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;
const int inf = 1e9 + 7;
const ll INF = 1LL << 61;
co... | replace | 33 | 34 | 33 | 34 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; i++)
#define P pair<ll, ll>
#define Graph vector<vector<ll>>
#define INF (1ll << 60)
#define mod 1000000007
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; i++)
#define P pair<ll, ll>
#define Graph vector<vector<ll>>
#define INF (1ll << 60)
#define mod 1000000007
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return... | replace | 23 | 24 | 23 | 24 | 0 | |
p02632 | C++ | Runtime Error | /* #region Head */
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pll = pair<ll, ll>;
template <class T> using vc = vector<T>;
template <class T> using vvc = vc<vc<T>>;
using vll = vc<ll>;
using vvll = vvc<ll>;
using vld = vc<ld>;
usin... | /* #region Head */
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pll = pair<ll, ll>;
template <class T> using vc = vector<T>;
template <class T> using vvc = vc<vc<T>>;
using vll = vc<ll>;
using vvll = vvc<ll>;
using vld = vc<ld>;
usin... | replace | 260 | 261 | 260 | 261 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int MAX = 1000005;
const long long MOD = 1000000007;
typedef long long ll;
ll fac[MAX], finv[MAX], inv[MAX];
ll mod_pow(ll x, ll n) { // べき乗
ll ans = 1;
x %= MOD;
while (n != 0) {
if (n & 1)
ans = ans * x % MOD;
x = x * x % MOD;
n = n >> 1;
... | #include <bits/stdc++.h>
using namespace std;
const int MAX = 2000005;
const long long MOD = 1000000007;
typedef long long ll;
ll fac[MAX], finv[MAX], inv[MAX];
ll mod_pow(ll x, ll n) { // べき乗
ll ans = 1;
x %= MOD;
while (n != 0) {
if (n & 1)
ans = ans * x % MOD;
x = x * x % MOD;
n = n >> 1;
... | replace | 2 | 3 | 2 | 3 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long N = 1e6 + 10;
long long fact[N];
template <typename T> void add_self(T &a, T b) {
a += b;
if (a > mod) {
a -= mod;
}
}
template <typename T> void substract_self(T &a, T b) {
a -= b;
if (a < 0) {
a += mod;
... | #include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long N = 2e6 + 10;
long long fact[N];
template <typename T> void add_self(T &a, T b) {
a += b;
if (a > mod) {
a -= mod;
}
}
template <typename T> void substract_self(T &a, T b) {
a -= b;
if (a < 0) {
a += mod;
... | replace | 4 | 5 | 4 | 5 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int M = 1e6 + 5;
const int mod = 1e9 + 7;
int k, ans, f[M], inv[M];
string s;
int power(int a, int b) {
int res = 1;
while (b) {
if (b & 1)
res = (res * a) % mod;
b >>= 1;
a = (a * a) % mod;
}
return res % mod;
}
int m... | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int M = 2e6 + 5;
const int mod = 1e9 + 7;
int k, ans, f[M], inv[M];
string s;
int power(int a, int b) {
int res = 1;
while (b) {
if (b & 1)
res = (res * a) % mod;
b >>= 1;
a = (a * a) % mod;
}
return res % mod;
}
int m... | replace | 3 | 4 | 3 | 4 | 0 | |
p02632 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdint>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <... | #include <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdint>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <... | replace | 234 | 235 | 234 | 235 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPi(i, a, b) for (int i = int(a); i < int(b); i++)
#define MEMS(a, b) memset(a, b, sizeof(a))
#define mp make_pair
template <class T> bool chmax(T &a, const T &b) ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPi(i, a, b) for (int i = int(a); i < int(b); i++)
#define MEMS(a, b) memset(a, b, sizeof(a))
#define mp make_pair
template <class T> bool chmax(T &a, const T &b) ... | replace | 49 | 50 | 49 | 50 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, s, n) for (int i = (s); i < (n); i++)
#define all(v) v.begin(), v.end()
#define outve(v) \
for (auto i : v) ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, s, n) for (int i = (s); i < (n); i++)
#define all(v) v.begin(), v.end()
#define outve(v) \
for (auto i : v) ... | replace | 118 | 119 | 118 | 119 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <typename T1, typename T2> bool chmin(T1 &a, T2 b) {
if (a <= b)
return 0;
a = b;
return 1;
}
template <typename T1, typename T2> bool chmax(T1 &a, T2 b) {
if (a >= b)
return 0;
a = b;
return 1;
}
int dx[4] = {0, 1, -1, 0};... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <typename T1, typename T2> bool chmin(T1 &a, T2 b) {
if (a <= b)
return 0;
a = b;
return 1;
}
template <typename T1, typename T2> bool chmax(T1 &a, T2 b) {
if (a >= b)
return 0;
a = b;
return 1;
}
int dx[4] = {0, 1, -1, 0};... | replace | 84 | 85 | 84 | 85 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pl... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pl... | replace | 102 | 103 | 102 | 103 | 0 | |
p02632 | C++ | Runtime Error |
/*****/
#define TRUE true
#define FALSE false
#include <bits/stdc++.h>
/**/
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
/**/
using namespace std;
using ll = long long;
using ld = long double;
using pint = pair<int, int>;
using pll = pair<long long, long long>;
template... |
/*****/
#define TRUE true
#define FALSE false
#include <bits/stdc++.h>
/**/
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
/**/
using namespace std;
using ll = long long;
using ld = long double;
using pint = pair<int, int>;
using pll = pair<long long, long long>;
template... | replace | 263 | 264 | 263 | 264 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define vl vector<ll>
#define vi vector<int>
#define ff first
#define ss second
#define pb push_back
#define MOD 1000000007
// const int nax = 1e6+5;
#define inf 4e18
#define display(v) ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define vl vector<ll>
#define vi vector<int>
#define ff first
#define ss second
#define pb push_back
#define MOD 1000000007
// const int nax = 1e6+5;
#define inf 4e18
#define display(v) ... | replace | 34 | 35 | 34 | 35 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int k, n, l;
long long res, MOD = 1000000007, p25[1000100], comb;
long long inv[1000100];
void init_math(int N) {
inv[1] = 1LL;
for (int i = 2; i <= N; i++)
inv[i] = (MOD - ((MOD / i) * inv[MOD % i]) % MOD);
}
string s;
int main() {
cin >> k >> s;
n = s.size() +... | #include <bits/stdc++.h>
using namespace std;
int k, n, l;
long long res, MOD = 1000000007, p25[2000100], comb;
long long inv[2000100];
void init_math(int N) {
inv[1] = 1LL;
for (int i = 2; i <= N; i++)
inv[i] = (MOD - ((MOD / i) * inv[MOD % i]) % MOD);
}
string s;
int main() {
cin >> k >> s;
n = s.size() +... | replace | 3 | 5 | 3 | 5 | 0 | |
p02632 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <string.h>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
using namespace std;
typedef long l... | #include <algorithm>
#include <cassert>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <string.h>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
using namespace std;
typedef long l... | replace | 32 | 33 | 32 | 33 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
const int M = 1e9 + 7;
ll mul(ll a, ll b) { return (a * b) % M; }
ll mod_pow(ll a, ll b) {
ll r = 1;
while (b) {
if (b & 1)
r = mul(r, a);
b >>= 1;
a ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
const int M = 1e9 + 7;
ll mul(ll a, ll b) { return (a * b) % M; }
ll mod_pow(ll a, ll b) {
ll r = 1;
while (b) {
if (b & 1)
r = mul(r, a);
b >>= 1;
a ... | replace | 33 | 34 | 33 | 34 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
constexpr int MOD = 1000000007;
constexpr int MAX = 100005;
ll f[MAX];
void init() {
f[0] = 1;
for (int i = 1; i < MAX; i++)
f[i] = (f[i - 1] * i) % MOD;
}
ll inv(ll x) {
ll res = 1;
ll k = MOD - 2;
ll y = x;
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
constexpr int MOD = 1000000007;
constexpr int MAX = 2000005;
ll f[MAX];
void init() {
f[0] = 1;
for (int i = 1; i < MAX; i++)
f[i] = (f[i - 1] * i) % MOD;
}
ll inv(ll x) {
ll res = 1;
ll k = MOD - 2;
ll y = x;
... | replace | 5 | 6 | 5 | 6 | 0 | |
p02632 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <ciso646>
#include <cmath>
#include <complex>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#incl... | #include <algorithm>
#include <bitset>
#include <ciso646>
#include <cmath>
#include <complex>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#incl... | replace | 164 | 166 | 164 | 166 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPr(i, n) for (int i = (n)-1; i >= 0; --i)
#define FORq(i, m, n) for (int i = (m); i <= (n); ++i)
#define FORqr(i, m, n) for (int i = (n); i >= (m); --i)
#define M... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPr(i, n) for (int i = (n)-1; i >= 0; --i)
#define FORq(i, m, n) for (int i = (m); i <= (n); ++i)
#define FORqr(i, m, n) for (int i = (n); i >= (m); --i)
#define M... | replace | 131 | 132 | 131 | 132 | 0 | |
p02632 | C++ | Runtime Error | #ifndef Local
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx")
#endif
#include <bits/stdc++.h>
using namespace std;
#define popCnt(x) (__builtin_popcountll(x))
#define sz(x) ((int)(x.size()))
#define all(v) begin(v), e... | #ifndef Local
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx")
#endif
#include <bits/stdc++.h>
using namespace std;
#define popCnt(x) (__builtin_popcountll(x))
#define sz(x) ((int)(x.size()))
#define all(v) begin(v), e... | replace | 49 | 50 | 49 | 50 | 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)
#include <bits/stdc++.h>
#define int long long
#define sz(a) int((a)... |
// 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)
#include <bits/stdc++.h>
#define int long long
#define sz(a) int((a)... | replace | 30 | 31 | 30 | 31 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define rep(i, a, b) for (i = a; i < b; i++)
#define per(i, a, b) for (i = a; i >= b; i--)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define trav(x, it) for (auto it... | #include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define rep(i, a, b) for (i = a; i < b; i++)
#define per(i, a, b) for (i = a; i >= b; i--)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define trav(x, it) for (auto it... | replace | 40 | 41 | 40 | 41 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#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 ALL(v) (v).begin(), ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#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 ALL(v) (v).begin(), ... | replace | 28 | 29 | 28 | 29 | 0 | |
p02632 | C++ | Runtime Error | #include <iostream>
#include <string>
#include <vector>
using namespace std;
const int MAX = 1001000;
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 ... | #include <iostream>
#include <string>
#include <vector>
using namespace std;
const int MAX = 10000000;
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... | replace | 5 | 6 | 5 | 6 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define FASTIO \
ios::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define LL long long int
using nam... | #include <bits/stdc++.h>
#define FASTIO \
ios::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define LL long long int
using nam... | replace | 8 | 9 | 8 | 9 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
#define all(x) (x).begin(), (x).end()
const int INF = 1e9 + 5;
const int N = 1e6 + 5;
const int mod = 1e9 + 7;
ll fac[N];
ll mul(ll a, ll b) { return a * b % mod; }
ll poww(ll a, ll b) {
ll r = 1;
while (b) {
if (b & 1)
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
#define all(x) (x).begin(), (x).end()
const int INF = 1e9 + 5;
const int N = 2e6 + 10;
const ll mod = 1e9 + 7;
ll fac[N];
ll mul(ll a, ll b) { return a * b % mod; }
ll poww(ll a, ll b) {
ll r = 1;
while (b) {
if (b & 1)
... | replace | 6 | 8 | 6 | 8 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define db(a) cout << fixed << #a << " = " << a << endl;
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const ll MOD = 1e9 + 7;
const int MAXN = 1e6 + 10;
ll fact[MAXN];
ll powd[MAXN];
ll b_pow(ll x, ll m) {
if (m == 1LL)
return ... | #include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define db(a) cout << fixed << #a << " = " << a << endl;
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const ll MOD = 1e9 + 7;
const int MAXN = 2e6 + 10;
ll fact[MAXN];
ll powd[MAXN];
ll b_pow(ll x, ll m) {
if (m == 1LL)
return ... | replace | 9 | 10 | 9 | 10 | 0 | |
p02632 | C++ | Runtime Error | // Problem Link:
// Tutorial Link:
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define pb push_back
#define pLL pair<LL, LL>
#define ff first
#define ss second
#define rep(i, a, b) for (LL i = a; i <= b; ++i)
#define repb(i, a, b) for (LL i = a; i >= b; --i)
#define ld double
#define mp make_p... | // Problem Link:
// Tutorial Link:
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define pb push_back
#define pLL pair<LL, LL>
#define ff first
#define ss second
#define rep(i, a, b) for (LL i = a; i <= b; ++i)
#define repb(i, a, b) for (LL i = a; i >= b; --i)
#define ld double
#define mp make_p... | replace | 36 | 37 | 36 | 37 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define fo(i, a, b) for ((i) = (a); i <= (b); i++)
#define rfo(i, a, b) for ((i) = (a); i >= (b); i--)
#define inrange(x, y, z) (((x) >= (y)) && ((x) <= (z)))
#define ALL(vec) ((vec).begin(), (vec).end())
#define SOR(vec) sort(ALL(vec))
#define UNI(vec) (vec).erase(unique(ALL(vec)), (vec).end()... | #include <bits/stdc++.h>
#define fo(i, a, b) for ((i) = (a); i <= (b); i++)
#define rfo(i, a, b) for ((i) = (a); i >= (b); i--)
#define inrange(x, y, z) (((x) >= (y)) && ((x) <= (z)))
#define ALL(vec) ((vec).begin(), (vec).end())
#define SOR(vec) sort(ALL(vec))
#define UNI(vec) (vec).erase(unique(ALL(vec)), (vec).end()... | replace | 9 | 11 | 9 | 11 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#ifndef aa
#define trace(...)
#define endl '\n'
#endif
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef long double ld;
#define double long double
#define pii pair<int... | #include <bits/stdc++.h>
using namespace std;
#ifndef aa
#define trace(...)
#define endl '\n'
#endif
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef long double ld;
#define double long double
#define pii pair<int... | replace | 45 | 46 | 45 | 46 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 1e6 + 5;
const int INF = 0x3f3f3f3f;
const ll p = 1e9 + 7;
#define DEBUG(x) cout << x << '\n'
int F[MAXN], Finv[MAXN], inv[MAXN];
void init() {
F[0] = Finv[0] = inv[1] = 1;
for (int i = 2; i < MAXN; i++)
inv[i] = (p - p / i) *... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 2e6 + 5;
const int INF = 0x3f3f3f3f;
const ll p = 1e9 + 7;
#define DEBUG(x) cout << x << '\n'
int F[MAXN], Finv[MAXN], inv[MAXN];
void init() {
F[0] = Finv[0] = inv[1] = 1;
for (int i = 2; i < MAXN; i++)
inv[i] = (p - p / i) *... | replace | 3 | 4 | 3 | 4 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#pragma region Macros
typedef long long ll;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) (x).begin(), (x).end()
const long long MOD = 1e9 + 7;
// const long long MOD=998244353;
const int INF = 1e9;
const long long IINF =... | #include <bits/stdc++.h>
using namespace std;
#pragma region Macros
typedef long long ll;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) (x).begin(), (x).end()
const long long MOD = 1e9 + 7;
// const long long MOD=998244353;
const int INF = 1e9;
const long long IINF =... | replace | 192 | 193 | 192 | 193 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
// #define ll long long
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (a > b) {
a = b;
return 1... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
// #define ll long long
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (a > b) {
a = b;
return 1... | replace | 31 | 32 | 31 | 32 | 0 | |
p02632 | C++ | Time Limit Exceeded | #include <stdio.h>
#define ULL unsigned long long
#define MOD 1000000007
#define MAX 30000000
ULL RepSq(ULL n, ULL m, ULL mod);
void nCk_init(int mod);
ULL nCk(int n, int k, int mod);
ULL fac[MAX], finv[MAX], inv[MAX];
int main() {
nCk_init(MOD);
int K, a, iCnt = 0;
scanf("%d", &K);
getchar();
while ((... | #include <stdio.h>
#define ULL unsigned long long
#define MOD 1000000007
#define MAX 10000000
ULL RepSq(ULL n, ULL m, ULL mod);
void nCk_init(int mod);
ULL nCk(int n, int k, int mod);
ULL fac[MAX], finv[MAX], inv[MAX];
int main() {
nCk_init(MOD);
int K, a, iCnt = 0;
scanf("%d", &K);
getchar();
while ((... | replace | 5 | 6 | 5 | 6 | TLE | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define endl "\n"
#define se second
#define ll long long
#define inf 0x3f3f3f3f
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define endl "\n"
#define se second
#define ll long long
#define inf 0x3f3f3f3f
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(0); ... | replace | 11 | 12 | 11 | 12 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PLL = pair<ll, ll>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repn(i, n) for (int i = 0; i <= (int)(n); i++)
#define srep(i, l, n) for (int i = l; i < (int)(n); i++)
#define sre... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PLL = pair<ll, ll>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repn(i, n) for (int i = 0; i <= (int)(n); i++)
#define srep(i, l, n) for (int i = l; i < (int)(n); i++)
#define sre... | replace | 68 | 69 | 68 | 69 | 0 | |
p02632 | C++ | Runtime Error | /// kazuki08
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds... | /// kazuki08
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds... | replace | 48 | 49 | 48 | 49 | 0 | |
p02632 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <n... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <n... | replace | 40 | 41 | 40 | 41 | 0 | |
p02632 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
#define DEBUG(x) cout << #x << "=... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
#define DEBUG(x) cout << #x << "=... | replace | 19 | 20 | 19 | 20 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
ll x... | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
ll x... | replace | 68 | 69 | 68 | 69 | 0 | |
p02632 | C++ | Runtime Error | #pragma region
#pragma GCC target("avx2")
#pragma GCC optimize("03")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
#define endl "\n"
#define MP make_pair
#define FOR(i, a, b) for (int i = (a); i <= (b); i+... | #pragma region
#pragma GCC target("avx2")
#pragma GCC optimize("03")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
#define endl "\n"
#define MP make_pair
#define FOR(i, a, b) for (int i = (a); i <= (b); i+... | replace | 110 | 111 | 110 | 111 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a) for (int i = 0; i < (a); i++)
typedef long long ll;
#ifdef _DEBUG
inline void dump() { cerr << endl; }
template <typename Head> void dump(Head &&head) {
cerr << head;
dump();
}
template <typename Head, typename... Tail>
void dump(Head &&head, Tail &&.... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a) for (int i = 0; i < (a); i++)
typedef long long ll;
#ifdef _DEBUG
inline void dump() { cerr << endl; }
template <typename Head> void dump(Head &&head) {
cerr << head;
dump();
}
template <typename Head, typename... Tail>
void dump(Head &&head, Tail &&.... | replace | 120 | 121 | 120 | 121 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int N = 1e6 + 5;
bool cnt[30] = {};
long long fac[N] = {};
long long inv(long long x) {
if (x == 1)
return 1;
return (mod - mod / x) * inv(mod % x) % mod;
}
void init() {
fac[0] = 1;
for (long long i = 1; i < N; i++)
fac[... | #include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int N = 2e6 + 5;
long long fac[N] = {};
long long inv(long long x) {
if (x == 1)
return 1;
return (mod - mod / x) * inv(mod % x) % mod;
}
void init() {
fac[0] = 1;
for (long long i = 1; i < N; i++)
fac[i] = fac[i - 1] * i... | replace | 3 | 5 | 3 | 4 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
// using ll = long long;
using ull = uint64_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f64 = double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ld = double;
#define X first
#define Y... | #include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
// using ll = long long;
using ull = uint64_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f64 = double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ld = double;
#define X first
#define Y... | replace | 279 | 280 | 279 | 280 | 0 | |
p02632 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define IOS \
ios_base::sync_with_stdio(0); \
cin.tie(0)
/* start */
const int mod = 1e9 + 7; // CHANGE THIS
const int N = 1e6 + 9; ... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define IOS \
ios_base::sync_with_stdio(0); \
cin.tie(0)
/* start */
const int mod = 1e9 + 7;
const int N = 2e6 + 9;
int fat[N], inv... | replace | 8 | 10 | 8 | 10 | 0 | |
p02633 | C++ | Runtime Error | #include <cmath>
#include <iostream>
using namespace std;
/*
void calculate(float X) {
float deg = X;
float T = 3.14159265/180;
int t = 0;
float x = 0, y = 0;
float e = 0.001;
while (true) {
t++;
x -= sin(deg*T);
y -= cos(deg*T);
deg += X;
//cout << X << endl;
//cout << x << " " << ... | #include <cmath>
#include <iostream>
using namespace std;
/*
void calculate(float X) {
float deg = X;
float T = 3.14159265/180;
int t = 0;
float x = 0, y = 0;
float e = 0.001;
while (true) {
t++;
x -= sin(deg*T);
y -= cos(deg*T);
deg += X;
//cout << X << endl;
//cout << x << " " << ... | replace | 43 | 44 | 43 | 44 | 4 | |
p02633 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int n;
int sum = 0;
int cnt = 0;
while (sum == 0 || sum % 360 != 0) {
sum += n;
cnt++;
}
cout << cnt << endl;
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int sum = 0;
int cnt = 0;
while (sum == 0 || sum % 360 != 0) {
sum += n;
cnt++;
}
cout << cnt << endl;
return 0;
}
| insert | 5 | 5 | 5 | 6 | TLE | |
p02633 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define debug(a) cout << #a ": " << a << endl
#define IOS ios::sync_with_stdio(false), cin.tie(0)
using namespace std;
typedef long long ll;
int main(void) {
IOS;
int x;
cin >> x;
if (360 % x == 0)
cout << 360 / x << endl;
else
while (1)
;
return 0;
}
| #include <bits/stdc++.h>
#define debug(a) cout << #a ": " << a << endl
#define IOS ios::sync_with_stdio(false), cin.tie(0)
using namespace std;
typedef long long ll;
int main(void) {
IOS;
int x;
cin >> x;
int y = 360;
int g = __gcd(x, y);
x /= g, y /= g;
cout << y << endl;
return 0;
}
| replace | 10 | 15 | 10 | 14 | TLE | |
p02633 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define puts(i) cout << i << endl
#define pi 3.14159265358979323846264338
#define pb push_back
#define mp make_pair
#define inf 10000
using ll = long long;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
ll divisor = 100000... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define puts(i) cout << i << endl
#define pi 3.14159265358979323846264338
#define pb push_back
#define mp make_pair
#define inf 10000
using ll = long long;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
ll divisor = 100000... | insert | 23 | 23 | 23 | 24 | TLE | |
p02633 | C++ | Time Limit Exceeded | /*
Name:
Author: xiaruize
Date:
*/
#pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define MOD 1000000007
#define ALL(a) (a).begin(), (a).end()
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define ll long long
#define form(i, j, n) for ... | /*
Name:
Author: xiaruize
Date:
*/
#pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define MOD 1000000007
#define ALL(a) (a).begin(), (a).end()
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define ll long long
#define form(i, j, n) for ... | replace | 42 | 49 | 42 | 43 | TLE | |
p02633 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int X, A;
int counter = 1;
cin >> X;
int K = 360 / X;
if (360 % X == 0)
cout << K << endl;
else {
while (true) {
counter++;
if ((counter * 360) % X == 0) {
cout << counter * K << endl;
}
}
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int X, A;
int counter = 1;
cin >> X;
int K = 360 / X;
if (360 % X == 0)
cout << K << endl;
else {
while (true) {
counter++;
if ((counter * 360) % X == 0) {
cout << (counter * 360) / X << endl;
break;
}
}... | replace | 13 | 14 | 13 | 15 | TLE | |
p02633 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int x;
int y = 360;
while (true) {
if (y % x == 0) {
cout << y / x << endl;
return 0;
}
y += 360;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int x;
cin >> x;
int y = 360;
while (true) {
if (y % x == 0) {
cout << y / x << endl;
return 0;
}
y += 360;
}
}
| insert | 5 | 5 | 5 | 6 | 0 | |
p02633 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main(void) {
// Your code here!
int X;
int K;
cin >> X;
cout << 360 / K << endl;
}
| #include <iostream>
using namespace std;
int main(void) {
// Your code here!
int X;
int K;
cin >> X;
// Xto360nosaishoukoubasisu
int ans;
for (int i = 1; i <= 180; i++) {
ans = i * 360;
if (ans % X == 0) {
break;
}
}
cout << ans / X << endl;
}
| replace | 7 | 8 | 7 | 16 | 0 | |
p02633 | C++ | Runtime Error | #include <bits/stdc++.h>
int main() {
int x;
scanf("%d", &x);
for (int i = 1; i <= 10000000; ++i)
if (x * i % 360 == 0)
return printf("%d\n", i);
return 0;
} | #include <bits/stdc++.h>
int main() {
int x;
scanf("%d", &x);
for (int i = 1; i <= 10000000; ++i)
if (x * i % 360 == 0)
return printf("%d\n", i), 0;
return 0;
} | replace | 7 | 8 | 7 | 8 | 2 | |
p02633 | C++ | Runtime Error | #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#include <bits/stdc++.h>
#include <unordered_map>
#define M 1000000007
#define T 998244353
#define pi 3.14159265
#define N 100003
#define inf 1000000002
#define ll long long
#define fo(i, a, b) for (i = a; i <= b; i++)
#define ro(i, b, a) fo... | #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#include <bits/stdc++.h>
#include <unordered_map>
#define M 1000000007
#define T 998244353
#define pi 3.14159265
#define N 100003
#define inf 1000000002
#define ll long long
#define fo(i, a, b) for (i = a; i <= b; i++)
#define ro(i, b, a) fo... | replace | 43 | 47 | 43 | 45 | 0 | |
p02633 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#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 sp(n) cout << fixed << setprecision(n)
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... | #include <bits/stdc++.h>
#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 sp(n) cout << fixed << setprecision(n)
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... | insert | 29 | 29 | 29 | 30 | TLE | |
p02633 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#include <iomanip>
#include <math.h>
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
const int INF = 10010... | #include <bits/stdc++.h>
using namespace std;
#include <iomanip>
#include <math.h>
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
const int INF = 10010... | replace | 39 | 40 | 39 | 41 | 0 | |
p02633 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 7;
const int inf = INT_MAX;
const ll inff = 1e18;
const ll mod = 1e9 + 7;
#define pii pair<int, int>
#define mkp make_pair
#define F first
#define S second
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 7;
const int inf = INT_MAX;
const ll inff = 1e18;
const ll mod = 1e9 + 7;
#define pii pair<int, int>
#define mkp make_pair
#define F first
#define S second
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).... | replace | 29 | 43 | 29 | 30 | TLE | |
p02633 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
typedef long long ll;
#define forn(i, start, end) for (ll i = start; i < ll(end); i++)
#define input(arr, n) forn(i, 0, n) cin >> arr[i];
#define MOD 1000000007
#define vll vector<ll>
#define vpll vector<pair<ll, ll>>
#define vvll vector<vector<ll>>
#define mll map<ll, ll>
#define mcl map<char,... | #include <bits/stdc++.h>
typedef long long ll;
#define forn(i, start, end) for (ll i = start; i < ll(end); i++)
#define input(arr, n) forn(i, 0, n) cin >> arr[i];
#define MOD 1000000007
#define vll vector<ll>
#define vpll vector<pair<ll, ll>>
#define vvll vector<vector<ll>>
#define mll map<ll, ll>
#define mcl map<char,... | replace | 36 | 37 | 36 | 37 | TLE | |
p02633 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int X, K = 2;
static const double pi = 3.141592653589793;
cin >> X;
float x = 0.0, y = 1.0, theta;
while (true) {
theta = float(X * (K - 1) * pi) / 180.0;
x += sin(theta);
y += cos(theta);
if (x < 0.0001 && x > -0.0001 && y < 0.0... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int X, K = 2;
static const double pi = 3.141592653589793;
cin >> X;
float x = 0.0, y = 1.0, theta;
while (true) {
theta = float(X * (K - 1) * pi) / 180.0;
x += sin(theta);
y += cos(theta);
if (x < 0.001 && x > -0.001 && y < 0.001... | replace | 13 | 14 | 13 | 14 | TLE | |
p02634 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<vi> vvi;
#define INF (1e9)
ll MOD = 998244353;
int main() {
ll A, B, C, D;
cin >> A >> B >> C >> D;
vvi DP(C + 1, vi(D + 1));
DP[A][B] = 1;
for (int i = A + 1; i <= C; i++) {
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<vi> vvi;
#define INF (1e9)
ll MOD = 998244353;
int main() {
ll A, B, C, D;
cin >> A >> B >> C >> D;
vvi DP(C + 1, vi(D + 1));
DP[A][B] = 1;
for (int i = A + 1; i <= C; i++) {
... | replace | 24 | 28 | 24 | 26 | TLE | |
p02634 | C++ | Runtime Error | #include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
int main(void) {
ios::sync_with_stdio(false);
int A, B, C, D;
cin >> A >> B >> C >> D;
const int MAX = 3001;
const int64_t MOD = 998244353;
vector<vector<int64_t>> DP(MAX, vector<int64_t>(MAX, 0));
... | #include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
int main(void) {
ios::sync_with_stdio(false);
int A, B, C, D;
cin >> A >> B >> C >> D;
const int MAX = 3002;
const int64_t MOD = 998244353;
vector<vector<int64_t>> DP(MAX, vector<int64_t>(MAX, 0));
... | replace | 10 | 11 | 10 | 11 | 0 | |
p02634 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const int mod = 998244353;
int read() {
int x = 0, f = 1;
char ch = ' ';
while (!isdigit(ch)) {
ch = getchar();
if (ch == '-')
f = -1;
}
while (isdigit(ch))
x = (x << 3) + (x << 1) + (ch ^ 48), ch = getchar();
return x * f;... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const int mod = 998244353;
int read() {
int x = 0, f = 1;
char ch = ' ';
while (!isdigit(ch)) {
ch = getchar();
if (ch == '-')
f = -1;
}
while (isdigit(ch))
x = (x << 3) + (x << 1) + (ch ^ 48), ch = getchar();
return x * f;... | replace | 16 | 17 | 16 | 17 | 0 | |
p02634 | C++ | Runtime Error | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define mii map<int, int>
#define mll map<ll, ll>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vd vector<double>
#define vll vector<ll>
#define fi first
#define se sec... | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define mii map<int, int>
#define mll map<ll, ll>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vd vector<double>
#define vll vector<ll>
#define fi first
#define se sec... | replace | 33 | 34 | 33 | 34 | 0 | |
p02634 | 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 | 110 | 111 | 110 | 111 | 0 | |
p02634 | C++ | Time Limit Exceeded | #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 rep(i, a, b) for (ll i = a; i < b; ++i)
#define IOS \
ios::sync_with_stdio(0); ... | #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 rep(i, a, b) for (ll i = a; i < b; ++i)
#define IOS \
ios::sync_with_stdio(0); ... | replace | 52 | 54 | 52 | 55 | TLE | |
p02634 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef... | #include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef... | replace | 77 | 79 | 77 | 79 | TLE | |
p02634 | C++ | Runtime Error | #include "bits/stdc++.h"
#include <random>
using namespace std;
typedef long long int lint;
typedef pair<lint, lint> plint;
typedef pair<double long, double long> pld;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) ... | #include "bits/stdc++.h"
#include <random>
using namespace std;
typedef long long int lint;
typedef pair<lint, lint> plint;
typedef pair<double long, double long> pld;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) ... | replace | 103 | 104 | 103 | 104 | 0 | |
p02634 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
typedef long long int lint;
typedef pair<lint, lint> plint;
typedef pair<double long, double long> pld;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) ... | #include "bits/stdc++.h"
using namespace std;
typedef long long int lint;
typedef pair<lint, lint> plint;
typedef pair<double long, double long> pld;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) ... | replace | 91 | 92 | 91 | 92 | 0 | |
p02634 | Python | Time Limit Exceeded | import sys
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
def main():
A, B, C, D = [int(x) for x in input().split()]
MOD = 998244353
dp = [[0] * (D - B + 1) for j in range(C - A + 1)]
for j in range(C - A + 1):
if j == 0:
dp[j][0] = 1
else:
dp[j][0... | import sys
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
def main():
A, B, C, D = [int(x) for x in input().split()]
MOD = 998244353
dp = [[0] * (D - B + 1) for j in range(C - A + 1)]
for j in range(C - A + 1):
if j == 0:
dp[j][0] = 1
else:
dp[j][0... | replace | 18 | 19 | 18 | 19 | TLE | |
p02634 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 998244353;
int dp[4000][4000];
int f(int a, int b) {
if (~dp[a][b])
return dp[a][b];
return dp[a][b] = (f(a - 1, b) * b % MOD + f(a, b - 1) * a % MOD + MOD -
f(a - 1, b - 1) * (a - 1) % MOD * (b - 1) % MOD)... | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 998244353;
int dp[4001][4001];
int f(int a, int b) {
if (~dp[a][b])
return dp[a][b];
return dp[a][b] = (f(a - 1, b) * b % MOD + f(a, b - 1) * a % MOD + MOD -
f(a - 1, b - 1) * (a - 1) % MOD * (b - 1) % MOD)... | replace | 5 | 6 | 5 | 6 | -11 | |
p02634 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
constexpr int MOD = 998244353;
constexpr int INF = numeric_limits<int>::max() / 2;
typedef pair<int, int> P;
using Graph = vector<vector<int>>;
template <class T> inline bool chmax(T &a, T b) {
if ... | #include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
constexpr int MOD = 998244353;
constexpr int INF = numeric_limits<int>::max() / 2;
typedef pair<int, int> P;
using Graph = vector<vector<int>>;
template <class T> inline bool chmax(T &a, T b) {
if ... | replace | 46 | 48 | 46 | 47 | TLE | |
p02634 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for (int64 i = 0; i < (n); i++)
#define FOR(i, a, b) for (int64 i = (a); i < (b); i++)
#define all(x) x.begin(), x.end()
#define fs first
#define sc second
using int32 = int_fast32_t;
using uint32 = uint_... | #include <bits/stdc++.h>
using namespace std;
#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for (int64 i = 0; i < (n); i++)
#define FOR(i, a, b) for (int64 i = (a); i < (b); i++)
#define all(x) x.begin(), x.end()
#define fs first
#define sc second
using int32 = int_fast32_t;
using uint32 = uint_... | replace | 163 | 164 | 163 | 165 | TLE | |
p02634 | C++ | Runtime Error |
// #pragma GCC optimize ("-O3")
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <re... |
// #pragma GCC optimize ("-O3")
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <re... | replace | 619 | 620 | 619 | 620 | 0 | |
p02634 | 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 ord... | // #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 ord... | replace | 44 | 45 | 44 | 45 | 0 | |
p02634 | C++ | Runtime Error | #include <bits/stdc++.h>
typedef long long ll;
const ll mod = 998244353;
const int N = 1e3 + 5;
using namespace std;
int dp[N][N][2];
int main() {
int A, B, C, D;
cin >> A >> B >> C >> D;
if (C > A)
dp[C][D][0] = 1;
if (D > B)
dp[C][D][1] = 1;
ll ans = 0;
for (int i = C; i >= A; i--)
for (int j... | #include <bits/stdc++.h>
typedef long long ll;
const ll mod = 998244353;
const int N = 3e3 + 5;
using namespace std;
int dp[N][N][2];
int main() {
int A, B, C, D;
cin >> A >> B >> C >> D;
if (C > A)
dp[C][D][0] = 1;
if (D > B)
dp[C][D][1] = 1;
ll ans = 0;
for (int i = C; i >= A; i--)
for (int j... | replace | 3 | 4 | 3 | 4 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.