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
p02990
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; long long mod = 1000000007; long long mypow(long long x, long long y) { if (y == 1) return x; long long z = mypow(x, y / 2) % mod; if (y % 2 == 0...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; long long mod = 1000000007; long long mypow(long long x, long long y) { if (y == 1) return x; long long z = mypow(x, y / 2) % mod; if (y % 2 == 0...
replace
44
45
44
45
0
p02990
C++
Runtime Error
#include <algorithm> #include <climits> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < (int)n; ++i) #de...
#include <algorithm> #include <climits> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < (int)n; ++i) #de...
replace
70
71
70
71
0
p02990
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define MOD (1000000007) using namespace std; ...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define MOD (1000000007) using namespace std; ...
replace
26
27
26
31
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> #define FOR(i, k, n) for (int i = (k); i < (n); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) begin(x), end(x) using namespace std; using vecint = vector<int>; using ll = int64_t; constexpr ll MOD = 1000000007; ll frac[3000]; ll fracinv[3000]; // a^-1 mod p ll inv(ll a, ll p) { return (...
#include <bits/stdc++.h> #define FOR(i, k, n) for (int i = (k); i < (n); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) begin(x), end(x) using namespace std; using vecint = vector<int>; using ll = int64_t; constexpr ll MOD = 1000000007; ll frac[3000]; ll fracinv[3000]; // a^-1 mod p ll inv(ll a, ll p) { return (...
insert
35
35
35
39
0
p02990
C++
Runtime Error
#include <iostream> #include <stdio.h> // #include <bits/stdc++.h> #include <algorithm> #include <cassert> #include <cmath> #include <cmath> #include <cstdint> #include <cstring> #include <float.h> #include <iomanip> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <string> #...
#include <iostream> #include <stdio.h> // #include <bits/stdc++.h> #include <algorithm> #include <cassert> #include <cmath> #include <cmath> #include <cstdint> #include <cstring> #include <float.h> #include <iomanip> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <string> #...
replace
54
55
54
55
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; ll mod = 1000000007; ll po(ll x, int a) { if (x == 0) return 0; if (a == 0) return 1; if (a == 1) return x; ll tmp = po(x, a / 2); if (a % 2 == 0) return tmp * tmp % mod; ret...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; ll mod = 1000000007; ll po(ll x, int a) { if (x == 0) return 0; if (a == 0) return 1; if (a == 1) return x; ll tmp = po(x, a / 2); if (a % 2 == 0) return tmp * tmp % mod; ret...
insert
27
27
27
29
0
p02990
C++
Runtime Error
// abc132d.cpp : Blue and Red Balls #include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) #define upto(i, s, e, d) for (int i = (s); i < (e); i += (d)) #define oute(x) cout << (x) << endl const ll MOD = 1000000007; ll c[2001][2001]; void init(int N) { r...
// abc132d.cpp : Blue and Red Balls #include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) #define upto(i, s, e, d) for (int i = (s); i < (e); i += (d)) #define oute(x) cout << (x) << endl const ll MOD = 1000000007; ll c[2001][2001]; void init(int N) { r...
replace
18
19
18
19
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> #include <numeric> #include <vector> #define PI 3.14159265358979323846 #define MAXINF (1e18L) #define INF (1e9L) #define EPS (1e-9) #define MOD (ll)(1e9 + 7) #define REP(i, n) for (int i = 0; i < int(n); ++i) #define Rep(i, sta, n) for (int i = sta; i < n; i++) #define RREP(i, n) for (int i = i...
#include <bits/stdc++.h> #include <numeric> #include <vector> #define PI 3.14159265358979323846 #define MAXINF (1e18L) #define INF (1e9L) #define EPS (1e-9) #define MOD (ll)(1e9 + 7) #define REP(i, n) for (int i = 0; i < int(n); ++i) #define Rep(i, sta, n) for (int i = sta; i < n; i++) #define RREP(i, n) for (int i = i...
insert
49
49
49
51
0
p02990
C++
Runtime Error
#define DEBUG(...) /* Strip me down and go to town */ /* Lick me over upside down */ /* Pound and pound and pound and pound */ /* Baby make me make that sound ...
#define DEBUG(...) /* Strip me down and go to town */ /* Lick me over upside down */ /* Pound and pound and pound and pound */ /* Baby make me make that sound ...
replace
27
28
27
32
0
p02990
C++
Runtime Error
#include <iostream> using namespace std; typedef long long ll; const int MOD = 1000000007; ll fact[2010]; // a^b % MOD を計算して返す ll power(ll a, ll b) { if (b == 0) { return 1; } else { ll ans = power(a, b / 2); ans = ans * ans; ans = ans % MOD; if (b % 2 == 1) ans = ans * a; ans = ans...
#include <iostream> using namespace std; typedef long long ll; const int MOD = 1000000007; ll fact[2010]; // a^b % MOD を計算して返す ll power(ll a, ll b) { if (b == 0) { return 1; } else { ll ans = power(a, b / 2); ans = ans * ans; ans = ans % MOD; if (b % 2 == 1) ans = ans * a; ans = ans...
insert
41
41
41
45
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (int)(b); ++i) #define REP(i, n) FOR(i, 0, n) using namespace std; typedef long long ll; // https://youtu.be/L8grWxBlIZ4?t=9858 // https://youtu.be/ERZuLAxZffQ?t=4765 const int mod = 1000000007; struct mint { ll x; mint(ll x = 0) : x(x % mod) {} ...
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (int)(b); ++i) #define REP(i, n) FOR(i, 0, n) using namespace std; typedef long long ll; // https://youtu.be/L8grWxBlIZ4?t=9858 // https://youtu.be/ERZuLAxZffQ?t=4765 const int mod = 1000000007; struct mint { ll x; mint(ll x = 0) : x(x % mod) {} ...
replace
43
44
43
44
-11
p02990
C++
Runtime Error
#include <stdio.h> long long p = 1000000007; long long n, k; long long rui(long long a, long long b) { if (b == 0) return 1; if (b == 1) return a; if (b == 2) return a * a % p; if (b % 2) return (rui(rui(a, b / 2), 2) * a % p); return rui(rui(a, b / 2), 2); } long long inv(long long a) { retur...
#include <stdio.h> long long p = 1000000007; long long n, k; long long rui(long long a, long long b) { if (b == 0) return 1; if (b == 1) return a; if (b == 2) return a * a % p; if (b % 2) return (rui(rui(a, b / 2), 2) * a % p); return rui(rui(a, b / 2), 2); } long long inv(long long a) { retur...
replace
36
37
36
38
0
p02990
C++
Runtime Error
// review #include <iostream> using namespace std; typedef long long ll; const int MOD = 1e9 + 7; int N, K; ll dp[2100]; ll mod_pow(ll x, ll n) { ll res = 1; while (n > 0) { if (n & 1) { res = res * x % MOD; } x = x * x % MOD; n >>= 1; } return res; } ll mod_inv(ll x) { return mod_pow(...
// review #include <iostream> using namespace std; typedef long long ll; const int MOD = 1e9 + 7; int N, K; ll dp[2100]; ll mod_pow(ll x, ll n) { ll res = 1; while (n > 0) { if (n & 1) { res = res * x % MOD; } x = x * x % MOD; n >>= 1; } return res; } ll mod_inv(ll x) { return mod_pow(...
insert
25
25
25
28
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #pragma GCC optimize("unroll-loops,no-stack-protector") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") using namespace __gnu_pbds; using namespace std; template <typename T> using orde...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #pragma GCC optimize("unroll-loops,no-stack-protector") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") using namespace __gnu_pbds; using namespace std; template <typename T> using orde...
replace
63
64
63
68
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> #define all(x) begin(x), end(x) #define dbg(x) cerr << #x << " = " << x << endl #define _ << ' ' << using namespace std; using ll = long long; using vi = vector<int>; const int mod = 1000000007; int add(int a, int b) { return (a += b) < mod ? a : a - mod; } int sub(int a, int b) { return (a -=...
#include <bits/stdc++.h> #define all(x) begin(x), end(x) #define dbg(x) cerr << #x << " = " << x << endl #define _ << ' ' << using namespace std; using ll = long long; using vi = vector<int>; const int mod = 1000000007; int add(int a, int b) { return (a += b) < mod ? a : a - mod; } int sub(int a, int b) { return (a -=...
replace
28
29
28
33
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> #include <unistd.h> using namespace std; #define DEBUG(x) cerr << #x << ": " << x << endl; #define DEBUG_VEC(v) \ cerr << #v << ":"; \ for (int i = 0; i < v.size(); i++) ...
#include <bits/stdc++.h> #include <unistd.h> using namespace std; #define DEBUG(x) cerr << #x << ": " << x << endl; #define DEBUG_VEC(v) \ cerr << #v << ":"; \ for (int i = 0; i < v.size(); i++) ...
insert
102
102
102
104
0
p02990
C++
Runtime Error
#include <stdio.h> #include <string.h> #define lli long long int lli bigmod = 1000000007, memo[2010][2010]; lli dp(lli x, lli y) { if ((y == 0) || (x == y)) return 1; if (memo[x][y] == -1) memo[x][y] = (dp(x - 1, y) + dp(x - 1, y - 1)) % bigmod; return memo[x][y]; } int main() { lli n, k, ans; sca...
#include <stdio.h> #include <string.h> #define lli long long int lli bigmod = 1000000007, memo[2010][2010]; lli dp(lli x, lli y) { if (x < y) return 0; if ((y == 0) || (x == y)) return 1; if (memo[x][y] == -1) memo[x][y] = (dp(x - 1, y) + dp(x - 1, y - 1)) % bigmod; return memo[x][y]; } int main...
insert
8
8
8
10
0
p02990
Python
Runtime Error
from math import factorial N, K = [int(_) for _ in input().split()] # N = 10 MOD = 10**9 + 7 kaijo = [0] * (N + 1) kaijo[0] = kaijo[1] = 1 for i in range(2, N + 1): kaijo[i] = (kaijo[i - 1] * i) % MOD gyaku = [0] * (N + 1) gyaku[0] = gyaku[1] = 1 for i in range(2, N + 1): # gyaku[i] = (gyaku[i - 1] * pow(i,...
from math import factorial N, K = [int(_) for _ in input().split()] # N = 10 MOD = 10**9 + 7 kaijo = [0] * (N + 1) kaijo[0] = kaijo[1] = 1 for i in range(2, N + 1): kaijo[i] = (kaijo[i - 1] * i) % MOD gyaku = [0] * (N + 1) gyaku[0] = gyaku[1] = 1 for i in range(2, N + 1): # gyaku[i] = (gyaku[i - 1] * pow(i,...
replace
28
29
28
32
0
p02990
Python
Runtime Error
from math import factorial as fac N, K = map(int, input().split()) def func(n, k, r): return ( fac(k - 1) * fac(n - k + 1) // (fac(k - r) * fac(r - 1) * fac(n - k - r + 1) * fac(r)) ) for i in range(1, K + 1): print(func(N, K, i) % (10**9 + 7))
from math import factorial as fac N, K = map(int, input().split()) def func(n, k, r): return ( fac(k - 1) * fac(n - k + 1) // (fac(k - r) * fac(r - 1) * fac(n - k - r + 1) * fac(r)) ) for i in range(1, K + 1): if N - K + 1 >= i: print(func(N, K, i) % (10**9 + 7)) els...
replace
14
15
14
18
0
p02990
Python
Runtime Error
# パスカルの三角形 N, K = map(int, input().split()) n = max(K - 1, N - K + 1) c = [[0] * (n + 1) for _ in range(n + 1)] c[0][0] = 1 for i in range(1, n + 1): ci = c[i] ci1 = c[i - 1] ci[0] = 1 for j in range(1, i + 1): ci[j] = (ci1[j - 1] + ci1[j]) % 1000000007 result = [] for i in range(1, K + 1): ...
# パスカルの三角形 N, K = map(int, input().split()) n = max(K, N - K + 1) c = [[0] * (n + 1) for _ in range(n + 1)] c[0][0] = 1 for i in range(1, n + 1): ci = c[i] ci1 = c[i - 1] ci[0] = 1 for j in range(1, i + 1): ci[j] = (ci1[j - 1] + ci1[j]) % 1000000007 result = [] for i in range(1, K + 1): re...
replace
3
4
3
4
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const long m = 1000000007; int main() { int n, k; cin >> n >> k; long a[n + 1][k + 1]; for (int i = 0; i < n + 1; i++) { a[i][0] = 1; } for (int i = 0; i < k + 1; i++) { a[i][i] = 1; } for (int i = 1; i < n + 1; i++) { for (int j = 1; j <= i; j++...
#include <bits/stdc++.h> using namespace std; const long m = 1000000007; int main() { int n, k; cin >> n >> k; long a[2002][2002]; for (int i = 0; i < n + 1; i++) { a[i][0] = 1; } for (int i = 0; i < k + 1; i++) { a[i][i] = 1; } for (int i = 1; i < n + 1; i++) { for (int j = 1; j <= i; j++) ...
replace
6
7
6
7
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> template <std::uint_fast64_t Modulus> class modint { using u64 = std::uint_fast64_t; public: u64 a; constexpr modint(const u64 x = 0) noexcept : a(x % Modulus) {} constexpr u64 &value() noexcept { return a; } constexpr const u64 &value() const noexcept { return a; } constexpr mod...
#include <bits/stdc++.h> template <std::uint_fast64_t Modulus> class modint { using u64 = std::uint_fast64_t; public: u64 a; constexpr modint(const u64 x = 0) noexcept : a(x % Modulus) {} constexpr u64 &value() noexcept { return a; } constexpr const u64 &value() const noexcept { return a; } constexpr mod...
replace
103
104
103
110
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pll; ll mod = 1e9 + 7; ll mpow(ll x, ll n) { ll ans = 1; while (n > 0) { if (n & 1) { ans = ans * x % mod; } x = x * x % mod; n >>= 1; } return ans; } // 階乗,factで初期化 vector<ll> tfact(1e7 + 1); void ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pll; ll mod = 1e9 + 7; ll mpow(ll x, ll n) { ll ans = 1; while (n > 0) { if (n & 1) { ans = ans * x % mod; } x = x * x % mod; n >>= 1; } return ans; } // 階乗,factで初期化 vector<ll> tfact(1e7 + 1); void ...
replace
43
44
43
49
0
p02990
C++
Runtime Error
#include <algorithm> #include <cfloat> #include <complex> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <unordered_map> #include <vector> #define fs first ...
#include <algorithm> #include <cfloat> #include <complex> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string> #include <unordered_map> #include <vector> #define fs first ...
replace
97
99
97
103
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long long mod = 1e9 + 7; void comb(vector<vector<long long>> &vec) { for (size_t i = 0; i < vec.size(); i++) { vec[i][0] = 1; vec[i][i] = 1; } for (size_t i = 1; i < vec.size(); i++) { for (size_t j = 1; j < i; j++) { vec[i][j] = vec[i - 1][j - 1] ...
#include <bits/stdc++.h> using namespace std; long long mod = 1e9 + 7; void comb(vector<vector<long long>> &vec) { for (size_t i = 0; i < vec.size(); i++) { vec[i][0] = 1; vec[i][i] = 1; } for (size_t i = 1; i < vec.size(); i++) { for (size_t j = 1; j < i; j++) { vec[i][j] = vec[i - 1][j - 1] ...
replace
21
22
21
22
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define ll ...
#include <bits/stdc++.h> using namespace std; #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define ll ...
replace
95
98
95
103
0
Time elapsed : 0.000158
p02990
C++
Runtime Error
#include <bits/stdc++.h> #define int long long using namespace std; const int mod = 1e9 + 7; int C[3000][3000]; int c(int x, int y) { if (y == 0 || x == y) return 1; else if (C[x][y] > 0) return C[x][y]; else return C[x][y] = (c(x - 1, y - 1) + c(x - 1, y)) % mod; } signed main() { int n, k; c...
#include <bits/stdc++.h> #define int long long using namespace std; const int mod = 1e9 + 7; int C[3000][3000]; int c(int x, int y) { if (y == 0 || x == y) return 1; else if (C[x][y] > 0) return C[x][y]; else return C[x][y] = (c(x - 1, y - 1) + c(x - 1, y)) % mod; } signed main() { int n, k; c...
insert
21
21
21
25
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> V; #define rep(cnt, e) for (ll cnt = 0; cnt < e; cnt++) typedef pair<ll, ll> P; const ll mod = 1e9 + 7; const ll INF = INT64_MAX; ll i, j, k; ll kaijou[2000 + 1]; ll gyakugen[2000 + 1]; long long ruijou(long long x, long long y) { ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> V; #define rep(cnt, e) for (ll cnt = 0; cnt < e; cnt++) typedef pair<ll, ll> P; const ll mod = 1e9 + 7; const ll INF = INT64_MAX; ll i, j, k; ll kaijou[2000 + 1]; ll gyakugen[2000 + 1]; long long ruijou(long long x, long long y) { ...
insert
22
22
22
24
0
p02990
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> #include <vector> #define llint long long int #define LNUM 1000000007 #define MULT(x, y) (((x % LNUM) * (y % LNUM)) % LNUM) #define SUM(x, y) (((x % LNUM) + (y % LNUM)) % LNUM) llint combi_val[2002][2002]; void init() { for (int i = 0; i < 2002; i++) { ...
#include <algorithm> #include <iostream> #include <string> #include <vector> #define llint long long int #define LNUM 1000000007 #define MULT(x, y) (((x % LNUM) * (y % LNUM)) % LNUM) #define SUM(x, y) (((x % LNUM) + (y % LNUM)) % LNUM) llint combi_val[2002][2002]; void init() { for (int i = 0; i < 2002; i++) { ...
replace
37
38
37
41
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> #define int long long using namespace std; const int MOD = 1e9 + 7; const int N = 1e7 + 10; int n, k; int fac[N], inv[N]; template <typename T> inline void read(T &x) { T flg = 1; x = 0; char ch = getchar(); while (!isdigit(ch)) { if (ch == '-') flg = -flg; ch = getchar();...
#include <bits/stdc++.h> #define int long long using namespace std; const int MOD = 1e9 + 7; const int N = 1e7 + 10; int n, k; int fac[N], inv[N]; template <typename T> inline void read(T &x) { T flg = 1; x = 0; char ch = getchar(); while (!isdigit(ch)) { if (ch == '-') flg = -flg; ch = getchar();...
insert
47
47
47
51
-11
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 2e3 + 7; const int maxm = 2e6 + 7; const ll mod = 1e9 + 7; int n, m, k; ll f[maxn], inv[maxn], sinv[maxn]; ll cc(ll a, ll b) { if (a == b || b == 0) return 1; return f[a] * sinv[a - b] % mod * sinv[b] % mod; } int main() { s...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 2e3 + 7; const int maxm = 2e6 + 7; const ll mod = 1e9 + 7; int n, m, k; ll f[maxn], inv[maxn], sinv[maxn]; ll cc(ll a, ll b) { if (a < b) return 0; if (a == b || b == 0) return 1; return f[a] * sinv[a - b] % mod * sinv[b...
insert
10
10
10
12
0
p02990
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; using ll = long long; const ll dev = (ll)(1e9) + 7; vector<ll> fac(2001); // n!(mod M) vector<ll> ifac(2001); // k!^{M-2} (mod M) ll mpow(ll x, ll n) { // x^n(mod M) ←普通にpow(x,n)では溢れてしまうため,随時mod計算 ll ans = 1...
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; using ll = long long; const ll dev = (ll)(1e9) + 7; vector<ll> fac(10000); // n!(mod M) vector<ll> ifac(10000); // k!^{M-2} (mod M) ll mpow(ll x, ll n) { // x^n(mod M) ←普通にpow(x,n)では溢れてしまうため,随時mod計算 ll ans =...
replace
11
13
11
13
-6
free(): invalid size
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long long modinv(long long a, long long m) { long long b = m, u = 1, v = 0; while (b) { long long t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } u %= m; if (u < 0) u += m; return u; } int main() { const int MOD = 10000000...
#include <bits/stdc++.h> using namespace std; long long modinv(long long a, long long m) { long long b = m, u = 1, v = 0; while (b) { long long t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } u %= m; if (u < 0) u += m; return u; } int main() { const int MOD = 10000000...
insert
28
28
28
32
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <algorithm> #include <string> #include <vector> using namespace std; typedef long long ll; const ll mod = 1000000007; class mint { public: ll x; mint(ll x = 0) : x(x % mod) {} mint &operator+=(const ...
#include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <algorithm> #include <string> #include <vector> using namespace std; typedef long long ll; const ll mod = 1000000007; class mint { public: ll x; mint(ll x = 0) : x(x % mod) {} mint &operator+=(const ...
insert
62
62
62
64
0
p02990
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <string> #include <vector> #define mod 1000000007 #define pb push_back using namespace std; typedef pair<int, int> pii; typedef long long ll; ll factx[22222]; ll factxx[22222]; ll xxcal(ll n, ll x) { if (x == 0) ...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <string> #include <vector> #define mod 1000000007 #define pb push_back using namespace std; typedef pair<int, int> pii; typedef long long ll; ll factx[22222]; ll factxx[22222]; ll xxcal(ll n, ll x) { if (x == 0) ...
insert
21
21
21
23
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> #pragma GCC optimize("unroll-loops,no-stack-protector") #pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define watch(x) cout << (#x) << " is " << (x) << endl #define debug cout << "hi" << endl using namespace std; typedef long long ll; typedef long double ld; typedef ...
#include <bits/stdc++.h> #pragma GCC optimize("unroll-loops,no-stack-protector") #pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define watch(x) cout << (#x) << " is " << (x) << endl #define debug cout << "hi" << endl using namespace std; typedef long long ll; typedef long double ld; typedef ...
insert
51
51
51
55
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef unsigned long long int ll; const int INF = 1 << 30; int comb[2010][2010]; void comb_table(int n) { for (int i = 0; i <= n; ++i) { for (int j = 0; j <= i; ++j) { if (j == 0 or j == i) { comb[i][j] = 1; } else { comb[i][j] = (comb[i ...
#include <bits/stdc++.h> using namespace std; typedef unsigned long long int ll; const int INF = 1 << 30; int comb[2010][2010]; void comb_table(int n) { for (int i = 0; i <= n; ++i) { for (int j = 0; j <= i; ++j) { if (j == 0 or j == i) { comb[i][j] = 1; } else { comb[i][j] = (comb[i ...
replace
22
29
22
45
0
p02990
C++
Runtime Error
#include <assert.h> #include <bits/stdc++.h> using namespace std; using i64 = long long; const i64 MOD = 1e9 + 7; long long modinv(long long a, long long m) { long long b = m, u = 1, v = 0; while (b) { long long t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } u %= m; if (u <...
#include <assert.h> #include <bits/stdc++.h> using namespace std; using i64 = long long; const i64 MOD = 1e9 + 7; long long modinv(long long a, long long m) { long long b = m, u = 1, v = 0; while (b) { long long t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } u %= m; if (u <...
replace
30
36
30
37
0
2 2 1 3 1 1 2 3 0 0 1 1
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define ZERO_IQ \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout....
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define ZERO_IQ \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout....
replace
16
17
16
17
-11
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; inline ll qpow(ll a, ll b, ll mod) { ll res = 1; while (b) { if (b & 1) res = (res * a) % mod; a = (a * a) % mod; b >>= 1; } return res; } const int mod = 1e9 + 7; const int MAXN = 2e5 + 7; ll fac[...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; inline ll qpow(ll a, ll b, ll mod) { ll res = 1; while (b) { if (b & 1) res = (res * a) % mod; a = (a * a) % mod; b >>= 1; } return res; } const int mod = 1e9 + 7; const int MAXN = 2e5 + 7; ll fac[...
replace
20
21
20
21
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, a, n) for (int i = a, _n = n; i <= _n; ++i) #define drep(i, a, n) for (int i = a, _n = n; i >= _n; --i) #define debug(x) cout << #x << " = " << x << endl const int Mod = 1e9 + 7; int n, k; long long f[5005]; long long Pow(long long a, int b) { long lo...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, n) for (int i = a, _n = n; i <= _n; ++i) #define drep(i, a, n) for (int i = a, _n = n; i >= _n; --i) #define debug(x) cout << #x << " = " << x << endl const int Mod = 1e9 + 7; int n, k; long long f[5005]; long long Pow(long long a, int b) { long lo...
insert
26
26
26
28
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define error(args...) \ { \ string _s = #args; ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define error(args...) \ { \ string _s = #args; ...
replace
97
98
97
101
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr long long MOD = 1e9 + 7; long long factrial[10000]; long long Repeat(long long a, long long cnt) { if (cnt == 0) return 1LL; if (cnt % 2 == 1) { long long x = Repeat(a, cnt / 2); return (((a * x) % MOD) * x) % MOD; } else {...
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr long long MOD = 1e9 + 7; long long factrial[10000]; long long Repeat(long long a, long long cnt) { if (cnt == 0) return 1LL; if (cnt % 2 == 1) { long long x = Repeat(a, cnt / 2); return (((a * x) % MOD) * x) % MOD; } else {...
replace
41
42
41
45
0
p02990
C++
Runtime Error
#include <algorithm> #include <iostream> #include <unordered_map> #include <vector> using namespace std; int main(int argc, char const *argv[]) { int MOD = 1000000007; int N, K; cin >> N >> K; unordered_map<int, vector<long long int>> comb; comb[1].push_back(1LL); comb[1].push_back(1LL); for (int i = 2;...
#include <algorithm> #include <iostream> #include <unordered_map> #include <vector> using namespace std; int main(int argc, char const *argv[]) { int MOD = 1000000007; int N, K; cin >> N >> K; unordered_map<int, vector<long long int>> comb; comb[0].push_back(1LL); comb[1].push_back(1LL); comb[1].push_ba...
insert
12
12
12
13
0
p02990
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; #define int long long #define ll long long typedef pair<int, int> P; #define mod 1000000007 #define INF (1LL << 60) #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define YES puts("YES\n") #define Yes puts("Yes\n") #define NO puts("NO\n") #define No p...
#include "bits/stdc++.h" using namespace std; #define int long long #define ll long long typedef pair<int, int> P; #define mod 1000000007 #define INF (1LL << 60) #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define YES puts("YES\n") #define Yes puts("Yes\n") #define NO puts("NO\n") #define No p...
insert
58
58
58
60
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define sz(x) (int)(x.size()) #define fi first #define se second #define pii pair<int, int> const int N = 2005, mod = 1e9 + 7; int fact[N] = {1}, inv[N] = {1}; int pow_mod(int a, int b) { if (b == 0) { return 1; } int nesf = pow_mod(a, b / 2...
#include <bits/stdc++.h> using namespace std; #define int long long #define sz(x) (int)(x.size()) #define fi first #define se second #define pii pair<int, int> const int N = 2005, mod = 1e9 + 7; int fact[N] = {1}, inv[N] = {1}; int pow_mod(int a, int b) { if (b == 0) { return 1; } int nesf = pow_mod(a, b / 2...
replace
21
22
21
26
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> #include <cassert> using namespace std; typedef unsigned long long ll; const ll MOD = 1e9 + 7; ll ModPow(ll base, ll exp, ll mod) { ll ret = 1; base %= mod; while (exp > 0) { if (exp & 1) ret = (ret * base) % mod; base = (base * base) % mod; exp >>= 1; } return re...
#include <bits/stdc++.h> #include <cassert> using namespace std; typedef unsigned long long ll; const ll MOD = 1e9 + 7; ll ModPow(ll base, ll exp, ll mod) { ll ret = 1; base %= mod; while (exp > 0) { if (exp & 1) ret = (ret * base) % mod; base = (base * base) % mod; exp >>= 1; } return re...
replace
23
24
23
24
-6
375b590f-a758-40ff-a7de-439594b70553.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02990/C++/s246491631.cpp:25: ll Comb(ll, ll, ll (*)[4001]): Assertion `n>2000' failed.
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(var, n) for (int var = 0; var < (n); ++var) const ll MOD = 1e9 + 7; ll fct[2001], inv[2001], fill[1000]; inline ll ModPow(ll base, ll exp, ll mod) { ll ret = 1; base %= mod; while (exp > 0) { if (exp & 1) ret = (ret * ba...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(var, n) for (int var = 0; var < (n); ++var) const ll MOD = 1e9 + 7; ll fct[2001], inv[2001], fill[2000]; inline ll ModPow(ll base, ll exp, ll mod) { ll ret = 1; base %= mod; while (exp > 0) { if (exp & 1) ret = (ret * ba...
replace
8
9
8
9
0
p02990
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <string> #include <vector> using namespace std; typedef pair<int, int> P; typedef long long ll; #define rep(i, n) for (ll i = 0; i < n; ++i) #define exrep(i, a, b) for (ll i = a; i <= b; i++) #define out(x) cout << x << endl #define exout(x) printf("%.10f\n", x) #define chmax(x, y) x =...
#include <bits/stdc++.h> #include <string> #include <vector> using namespace std; typedef pair<int, int> P; typedef long long ll; #define rep(i, n) for (ll i = 0; i < n; ++i) #define exrep(i, a, b) for (ll i = a; i <= b; i++) #define out(x) cout << x << endl #define exout(x) printf("%.10f\n", x) #define chmax(x, y) x =...
replace
18
19
18
19
TLE
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define mod 1000000007 #define endl '\n' ll binpow(ll a, ll b) { ll ...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define mod 1000000007 #define endl '\n' ll binpow(ll a, ll b) { ll ...
replace
40
44
40
41
TLE
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll MOD = 1e9 + 7; const int N = 5005; namespace Modop { ll modAdd(ll a, ll b) { return (a + b) % MOD; } ll modSub(ll a, ll b) { return (((a - b) % MOD) + MOD) % MOD; } ll modMul(ll a, ll b) { return ((a % MOD) * (b % MOD)) % MOD; } ll modExp(...
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll MOD = 1e9 + 7; const int N = 5005; namespace Modop { ll modAdd(ll a, ll b) { return (a + b) % MOD; } ll modSub(ll a, ll b) { return (((a - b) % MOD) + MOD) % MOD; } ll modMul(ll a, ll b) { return ((a % MOD) * (b % MOD)) % MOD; } ll modExp(...
replace
59
60
59
63
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef double D; typedef pair<ll, ll> P; #define M 1000000007 #define F first #define S second #define PB push_back #define INF 100000000000000000 ll pw(ll x, ll y) { ll res = 1; while (y) { if (y & 1) res = res * x % M; x = x * x % ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef double D; typedef pair<ll, ll> P; #define M 1000000007 #define F first #define S second #define PB push_back #define INF 100000000000000000 ll pw(ll x, ll y) { ll res = 1; while (y) { if (y & 1) res = res * x % M; x = x * x % ...
replace
28
29
28
32
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < n; ++i) #define repR(i, n) for (ll i = n; i >= 0; ++i) #define FDS(i, n) for (ll i = 0; i < n; ++i) #define FDSR(i, n) for (ll i = n; i >= 0; ++i) #define FOR(i, m, n) for (ll i = m; i < n; ++i) #define FORR(i, m, n) for (ll i = m; i >= n; --i) #define VSORT...
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < n; ++i) #define repR(i, n) for (ll i = n; i >= 0; ++i) #define FDS(i, n) for (ll i = 0; i < n; ++i) #define FDSR(i, n) for (ll i = n; i >= 0; ++i) #define FOR(i, m, n) for (ll i = m; i < n; ++i) #define FORR(i, m, n) for (ll i = m; i >= n; --i) #define VSORT...
replace
70
71
70
74
-11
p02990
C++
Runtime Error
// A modular inverse based solution to // compute nCr % p #include <bits/stdc++.h> using namespace std; #define ll long long ll fac[200000]; /* Iterative Function to calculate (x^y)%p in O(log y) */ ll fact(int n) { fac[0] = 1; for (ll i = 1; i <= n; i++) fac[i] = fac[i - 1] * i % 1000000007; return fac[n]; ...
// A modular inverse based solution to // compute nCr % p #include <bits/stdc++.h> using namespace std; #define ll long long ll fac[200000]; /* Iterative Function to calculate (x^y)%p in O(log y) */ ll fact(int n) { fac[0] = 1; for (ll i = 1; i <= n; i++) fac[i] = fac[i - 1] * i % 1000000007; return fac[n]; ...
replace
56
61
56
63
0
p02990
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long i = 0; i < (n); i++) #define pb push_back #define all(v) (v).begin(), (v).end() #define fi first #define se second #define sz(x) ((int)(x).size()) using ll = long long; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define MOD 100000...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long i = 0; i < (n); i++) #define pb push_back #define all(v) (v).begin(), (v).end() #define fi first #define se second #define sz(x) ((int)(x).size()) using ll = long long; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define MOD 100000...
replace
34
35
34
35
MLE
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; const int mod = 1000000007; struct mint { ll x; mint(ll 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; } m...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int mod = 1000000007; struct mint { ll x; mint(ll 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; } m...
insert
81
81
81
85
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define endl '\n' const ll MOD = 1000000007; ll modInv(ll a, ll m) { ll b = m, u = 1, v = 0; while (b) { ll t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define endl '\n' const ll MOD = 1000000007; ll modInv(ll a, ll m) { ll b = m, u = 1, v = 0; while (b) { ll t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } ...
replace
45
47
45
51
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> #define LL long long #define fi first #define se second #define mp make_pair #define pb push_back using namespace std; LL gcd(LL a, LL b) { return b ? gcd(b, a % b) : a; } LL lcm(LL a, LL b) { return a / gcd(a, b) * b; } LL powmod(LL a, LL b, LL MOD) { LL ans = 1; while (b) { if (b %...
#include <bits/stdc++.h> #define LL long long #define fi first #define se second #define mp make_pair #define pb push_back using namespace std; LL gcd(LL a, LL b) { return b ? gcd(b, a % b) : a; } LL lcm(LL a, LL b) { return a / gcd(a, b) * b; } LL powmod(LL a, LL b, LL MOD) { LL ans = 1; while (b) { if (b %...
replace
34
35
34
36
0
p02990
C++
Runtime Error
// sept 17,2020 #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #include <bits/stdc++.h> using namespace std; #define int long long #define double long double #define endl "\n" #define pb push_back #define PI 3.1415926535897932384626433832795l #define F first #define S second #define mp make_pair #defi...
// sept 17,2020 #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #include <bits/stdc++.h> using namespace std; #define int long long #define double long double #define endl "\n" #define pb push_back #define PI 3.1415926535897932384626433832795l #define F first #define S second #define mp make_pair #defi...
replace
223
225
223
229
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int64_t mod = 1e9 + 7; int64_t fact[4013]; int64_t add_mod(int64_t a, int64_t b, int64_t m) { return (a + b) % m; } int64_t sub_mod(int64_t a, int64_t b, int64_t m) { return (a - b + m) % m; } int64_t mul_mod(int64_t a, int64_t b, int64_t m) { return (a * b) % m; ...
#include <bits/stdc++.h> using namespace std; const int64_t mod = 1e9 + 7; int64_t fact[4013]; int64_t add_mod(int64_t a, int64_t b, int64_t m) { return (a + b) % m; } int64_t sub_mod(int64_t a, int64_t b, int64_t m) { return (a - b + m) % m; } int64_t mul_mod(int64_t a, int64_t b, int64_t m) { return (a * b) % m; ...
replace
42
46
42
50
0
p02990
C++
Runtime Error
/* これを入れて実行 g++ code.cpp ./a.out */ #include <algorithm> #include <bitset> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <string> #include <tuple> #include <utility> #include <vector> using namespa...
/* これを入れて実行 g++ code.cpp ./a.out */ #include <algorithm> #include <bitset> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdio.h> #include <string> #include <tuple> #include <utility> #include <vector> using namespa...
replace
105
106
105
106
0
p02990
C++
Runtime Error
#define LOCAL #include "bits/stdc++.h" using namespace std; #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(0); #define LLINF ((long long)1e18) // 1234567890987654321 #define INF 1234567890ll #def...
#define LOCAL #include "bits/stdc++.h" using namespace std; #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(0); #define LLINF ((long long)1e18) // 1234567890987654321 #define INF 1234567890ll #def...
insert
106
106
106
110
0
p02990
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; using ll = long long; using ld = long double; const double PI = 3.1415926535897932384626433832795; // const ll MOD = 1000000007; const int dx[] = {0, 1, 0, -1}; const int dy[] = {-1, 0, 1, 0}; int gcd(int x, int y) { return y ? gcd(y, x % y) : abs(x); } ll gcd(ll x, ll...
#include "bits/stdc++.h" using namespace std; using ll = long long; using ld = long double; const double PI = 3.1415926535897932384626433832795; // const ll MOD = 1000000007; const int dx[] = {0, 1, 0, -1}; const int dy[] = {-1, 0, 1, 0}; int gcd(int x, int y) { return y ? gcd(y, x % y) : abs(x); } ll gcd(ll x, ll...
replace
88
89
88
89
-11
p02990
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; using ll = long long; using ld = long double; const double PI = 3.1415926535897932384626433832795; // const ll MOD = 1000000007; const int dx[] = {0, 1, 0, -1}; const int dy[] = {-1, 0, 1, 0}; int gcd(int x, int y) { return y ? gcd(y, x % y) : abs(x); } ll gcd(ll x, ll...
#include "bits/stdc++.h" using namespace std; using ll = long long; using ld = long double; const double PI = 3.1415926535897932384626433832795; // const ll MOD = 1000000007; const int dx[] = {0, 1, 0, -1}; const int dy[] = {-1, 0, 1, 0}; int gcd(int x, int y) { return y ? gcd(y, x % y) : abs(x); } ll gcd(ll x, ll...
replace
88
89
88
89
-11
p02990
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<ll, ll> Pl; #define rep(i, n) for (int i = 0; i < (n...
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <queue> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<ll, ll> Pl; #define rep(i, n) for (int i = 0; i < (n...
insert
65
65
65
69
0
p02990
C++
Runtime Error
#include <algorithm> #include <cstring> #include <iostream> #include <vector> #define SIZE 2001 #define MOD 1000000007 using namespace std; long long dp[SIZE][SIZE]; void makePasTri(int n) { dp[0][0] = 1; for (int i = 1; i <= n + 1; i++) { dp[i][0] = 1; for (int j = 1; j <= i; j++) { dp[i][j] = (dp...
#include <algorithm> #include <cstring> #include <iostream> #include <vector> #define SIZE 2001 #define MOD 1000000007 using namespace std; long long dp[SIZE][SIZE]; void makePasTri(int n) { dp[0][0] = 1; for (int i = 1; i <= n; i++) { dp[i][0] = 1; for (int j = 1; j <= i; j++) { dp[i][j] = (dp[i -...
replace
13
14
13
14
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define lli long long int #define rep(i, n) for (lli i = 0; i < n; i++) #define repb(i, n) for (lli i = n - 1; i >= 0; i--) #define pb push_back #define mp make_pair #define bg() begin() #define en() end() #define ft first #define sc second #define vect_lli_it vector<lli>::...
#include <bits/stdc++.h> using namespace std; #define lli long long int #define rep(i, n) for (lli i = 0; i < n; i++) #define repb(i, n) for (lli i = n - 1; i >= 0; i--) #define pb push_back #define mp make_pair #define bg() begin() #define en() end() #define ft first #define sc second #define vect_lli_it vector<lli>::...
replace
97
102
97
105
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long int #define pb push_back #define ff first #define ss second #define vi vector<int> #define br cout << "\n"; #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define tr(c, i) for (auto i : c) #define pii pair<int, int> #define fast_io() ...
#include <bits/stdc++.h> #define ll long long int #define pb push_back #define ff first #define ss second #define vi vector<int> #define br cout << "\n"; #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define tr(c, i) for (auto i : c) #define pii pair<int, int> #define fast_io() ...
insert
60
60
60
64
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long vector<vector<ll>> dp; ll aCb(ll a, ll b) { if (dp[a][b] != -1) { return dp[a][b]; } if (a == b) { return 1; } else if (b == 0) { return 1; } else if (b == 1) { return a; } else { return dp[a][b] = (aCb(a - 1, b - 1) + ...
#include <bits/stdc++.h> using namespace std; #define ll long long vector<vector<ll>> dp; ll aCb(ll a, ll b) { if (dp[a][b] != -1) { return dp[a][b]; } if (a == b) { return 1; } else if (b == 0) { return 1; } else if (b == 1) { return a; } else { return dp[a][b] = (aCb(a - 1, b - 1) + ...
insert
35
35
35
37
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long long comb(long long m, long long r, vector<vector<long long>> &history) { if (history[m][r] != -1) { return history[m][r]; } else if (r == 0 || r == m) { history[m][r] = 1; return 1; } else { history[m][r] = (comb(m - 1, r - 1, history) +...
#include <bits/stdc++.h> using namespace std; long long comb(long long m, long long r, vector<vector<long long>> &history) { if (r > m) { return 0; } else if (history[m][r] != -1) { return history[m][r]; } else if (r == 0 || r == m) { history[m][r] = 1; return 1; } else { history[m][r] = ...
replace
4
5
4
7
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define MOD 1000000007 #define INF 0x3f3f3f3f #define INFL 0x3f3f3f3f3f3f3f3f using namespace std; typedef long long ll; typedef pair<int, int> P; class Pascal { vector<vector<int>> C; public: Pascal() {} Pascal(int n) { n = n * 2 + 10...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define MOD 1000000007 #define INF 0x3f3f3f3f #define INFL 0x3f3f3f3f3f3f3f3f using namespace std; typedef long long ll; typedef pair<int, int> P; class Pascal { vector<vector<int>> C; public: Pascal() {} Pascal(int n) { n = n * 2 + 10...
insert
36
36
36
45
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define For(i, a, b) for (int i = (a); i <= static_cast<int>(b); i++) #define Forr(i, a, b) for (int i = (a); i >= static_cast<int>(b); i--) #define rep(i, n) For(i, 0, n - 1) #define repall(i, arr) for (auto &i : (arr)) #define all(x) (x).begin(), (x...
#include <bits/stdc++.h> using namespace std; #define int long long #define For(i, a, b) for (int i = (a); i <= static_cast<int>(b); i++) #define Forr(i, a, b) for (int i = (a); i >= static_cast<int>(b); i--) #define rep(i, n) For(i, 0, n - 1) #define repall(i, arr) for (auto &i : (arr)) #define all(x) (x).begin(), (x...
replace
110
111
110
116
0
p02990
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define mod 1000000007 using namespace std; /*2進数配列+1*/ vector<int> twoadd(vector<int> v, int N) { v[N - 1] += 1; int ind = N - 1; int j = N - 1; for (j = N - 1; j >= 1; j--) { if (v[j] > 1) { v[j - 1] += 1; v[j] = 0; ...
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define mod 1000000007 using namespace std; /*2進数配列+1*/ vector<int> twoadd(vector<int> v, int N) { v[N - 1] += 1; int ind = N - 1; int j = N - 1; for (j = N - 1; j >= 1; j--) { if (v[j] > 1) { v[j - 1] += 1; v[j] = 0; ...
replace
95
96
95
96
TLE
p02990
C++
Runtime Error
#include <bits/stdc++.h> #define ft first #define sc second #define lb lower_bound #define ub upper_bound #define pb push_back #define pt(sth) cout << sth << "\n" #define chmax(a, b) \ { ...
#include <bits/stdc++.h> #define ft first #define sc second #define lb lower_bound #define ub upper_bound #define pb push_back #define pt(sth) cout << sth << "\n" #define chmax(a, b) \ { ...
insert
41
41
41
45
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 5; ll fact[N], inv_fact[N]; const ll mod = 1e9 + 7; ll mul(ll a, ll b) { return (a * b) % mod; } ll fp(ll base, ll pw) { if (pw == 1) return base; if (base == 0) return 0; if (pw == 0) return 1; ll x = fp(base, p...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 5; ll fact[N], inv_fact[N]; const ll mod = 1e9 + 7; ll mul(ll a, ll b) { return (a * b) % mod; } ll fp(ll base, ll pw) { if (pw == 1) return base; if (base == 0) return 0; if (pw == 0) return 1; ll x = fp(base, p...
insert
28
28
28
30
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, a, b) for (int i = a; i < b; i++) #define rrep(i, a, b) for (int i = a; i >= b; i--) //------------------------------------------- ll mod = 1000000007; // mod1000000007を扱うケース //------------------------------------------- //--------------...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, a, b) for (int i = a; i < b; i++) #define rrep(i, a, b) for (int i = a; i >= b; i--) //------------------------------------------- ll mod = 1000000007; // mod1000000007を扱うケース //------------------------------------------- //--------------...
replace
61
62
61
62
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> typedef long long int ll; using namespace std; const ll mod = 1e9 + 7; ll powmod(ll a, ll b) { ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1) res = res * a % mod; a = a * a % mod; } return res; } ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a;...
#include <bits/stdc++.h> typedef long long int ll; using namespace std; const ll mod = 1e9 + 7; ll powmod(ll a, ll b) { ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1) res = res * a % mod; a = a * a % mod; } return res; } ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a;...
replace
41
49
41
58
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i < (b); i++) #define rrep(i, a, b) for (int i = a; i >= (b); i--) #define all(x) (x).begin(), (x).end() using namespace std; using ll = long long; using P = pair<int, int>; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; retu...
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i < (b); i++) #define rrep(i, a, b) for (int i = a; i >= (b); i--) #define all(x) (x).begin(), (x).end() using namespace std; using ll = long long; using P = pair<int, int>; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; retu...
insert
85
85
85
89
-11
p02990
C++
Runtime Error
#include <algorithm> #include <iostream> #include <math.h> #include <string> #include <utility> #include <vector> #define N (1000000000 + 7) typedef long long ll; using namespace std; struct edge { ll to; }; ll kaijo[100010]; void init() { kaijo[0] = 1; for (ll i = 1; i <= 100000; i++) kaijo[i] = (kaijo[i - 1...
#include <algorithm> #include <iostream> #include <math.h> #include <string> #include <utility> #include <vector> #define N (1000000000 + 7) typedef long long ll; using namespace std; struct edge { ll to; }; ll kaijo[100010]; void init() { kaijo[0] = 1; for (ll i = 1; i <= 100000; i++) kaijo[i] = (kaijo[i - 1...
replace
49
54
49
59
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; typedef pair<int, int> P; const ll mod = 1000000007; // 出力は (ans % mod + mod) % mod (負の剰余を正にする) const int inf = 1e9; const long long INF = 1LL << 60; // INF = 1152921504606846976 #define N_MA...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; typedef pair<int, int> P; const ll mod = 1000000007; // 出力は (ans % mod + mod) % mod (負の剰余を正にする) const int inf = 1e9; const long long INF = 1LL << 60; // INF = 1152921504606846976 #define N_MA...
replace
53
54
53
59
0
p02990
C++
Runtime Error
#include <algorithm> #include <iostream> #include <stdio.h> using namespace std; const int M = 2005; const int MO = 1e9 + 7; int inv[M], fa[M], ifa[M]; int add(int x, int y) { x += y; if (x >= MO) x -= MO; return x; } int mul(int x, int y) { return 1LL * x * y % MO; } void init() { fa[0] = ifa[0] = 1; ...
#include <algorithm> #include <iostream> #include <stdio.h> using namespace std; const int M = 2005; const int MO = 1e9 + 7; int inv[M], fa[M], ifa[M]; int add(int x, int y) { x += y; if (x >= MO) x -= MO; return x; } int mul(int x, int y) { return 1LL * x * y % MO; } void init() { fa[0] = ifa[0] = 1; ...
replace
38
39
38
43
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define mod 1000000007 int f[12001]; int fi[12001]; int n, k; int m(int a, int b) { return (a * b) % mod; } int fp(int x, int y) { int res = 1; while (y) { if (y & 1) res = res * x % mod; x = x * x % mod; y >>= 1; } return re...
#include <bits/stdc++.h> using namespace std; #define int long long #define mod 1000000007 int f[12001]; int fi[12001]; int n, k; int m(int a, int b) { return (a * b) % mod; } int fp(int x, int y) { int res = 1; while (y) { if (y & 1) res = res * x % mod; x = x * x % mod; y >>= 1; } return re...
replace
36
38
36
40
0
p02990
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; const ll MOD = 1000000007; ll c[30010][3010]; void init_triangle() { c[0][0] = 1; rep(i, 3000) rep(j, 3000) { if (j > i) break; c[i + 1][j] = (c[i + 1][j] + c[i][j]) % MOD; c[i + ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; const ll MOD = 1000000007; ll c[30010][3010]; void init_triangle() { c[0][0] = 1; rep(i, 3000) rep(j, 3000) { if (j > i) break; c[i + 1][j] = (c[i + 1][j] + c[i][j]) % MOD; c[i + ...
insert
22
22
22
24
-11
p02990
C++
Runtime Error
#include <iostream> using namespace std; const long long MOD = 1e9 + 7; long long fanc[2009], inv_fanc[2009]; 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; } // a^{-1} ...
#include <iostream> using namespace std; const long long MOD = 1e9 + 7; long long fanc[2009], inv_fanc[2009]; 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; } // a^{-1} ...
insert
34
34
34
36
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> #include <cmath> #include <iostream> #include <stdlib.h> #define ll long long const ll INF = 0x3f3f3f3f; #define mod 1000000007 using namespace std; // priority_queue const ll Maxn = 1e5; ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); } ll kc(ll a, ll b) { ll c = 1; while (b) { ...
#include <bits/stdc++.h> #include <cmath> #include <iostream> #include <stdlib.h> #define ll long long const ll INF = 0x3f3f3f3f; #define mod 1000000007 using namespace std; // priority_queue const ll Maxn = 1e5; ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); } ll kc(ll a, ll b) { ll c = 1; while (b) { ...
insert
26
26
26
28
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int64_t mod = 1000000007; vector<int64_t> f(2001), fi(2001); int64_t pw(int64_t x, int64_t y) { int64_t z; if (y == 0) return 1; else { z = pw(x, y / 2) * pw(x, y / 2) % mod; if (y % 2 == 1) z = z * x % mod; return z; } } int64_t cmb(int64_t x,...
#include <bits/stdc++.h> using namespace std; int64_t mod = 1000000007; vector<int64_t> f(2001), fi(2001); int64_t pw(int64_t x, int64_t y) { int64_t z; if (y == 0) return 1; else { z = pw(x, y / 2) * pw(x, y / 2) % mod; if (y % 2 == 1) z = z * x % mod; return z; } } int64_t cmb(int64_t x,...
replace
30
32
30
36
TLE
p02990
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdlib> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> #define DEBUG 1 using namespace std; constexpr int kMod = 1000000007; typedef long lo...
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdlib> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> #define DEBUG 1 using namespace std; constexpr int kMod = 1000000007; typedef long lo...
replace
18
19
18
20
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> typedef long long ll; const ll mod = 1e9 + 7; const ll inf = 0x3f3f3f3f; const int N = 2e5 + 5; using namespace std; ll f[N]; ll ksm(ll a, ll b) { ll ans = 1; for (; b; b >>= 1, a = a * a % mod) if (b & 1) ans = ans * a % mod; return ans; } void fac(int n) { f[0] = 1; f[1] =...
#include <bits/stdc++.h> typedef long long ll; const ll mod = 1e9 + 7; const ll inf = 0x3f3f3f3f; const int N = 2e5 + 5; using namespace std; ll f[N]; ll ksm(ll a, ll b) { ll ans = 1; for (; b; b >>= 1, a = a * a % mod) if (b & 1) ans = ans * a % mod; return ans; } void fac(int n) { f[0] = 1; f[1] =...
replace
30
31
30
33
0
p02990
C++
Runtime Error
#include <iostream> using namespace std; typedef long long ll; const ll mod = 1e9 + 7; ll fac[2005]; ll rfac[2005]; ll P(ll a, ll x) { ll res = 1; while (x > 0) { if (x & 1) res = res * a % mod; a = a * a % mod; x >>= 1; } return res; } int main() { ll n, k; cin >> n >> k; fac[0]...
#include <iostream> using namespace std; typedef long long ll; const ll mod = 1e9 + 7; ll fac[2005]; ll rfac[2005]; ll P(ll a, ll x) { ll res = 1; while (x > 0) { if (x & 1) res = res * a % mod; a = a * a % mod; x >>= 1; } return res; } int main() { ll n, k; cin >> n >> k; fac[0]...
replace
41
44
41
49
0
p02990
C++
Runtime Error
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <functional> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <vector> #define _USE_MATH_DEFINES #include <bitset> #include <deque> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #in...
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <functional> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <vector> #define _USE_MATH_DEFINES #include <bitset> #include <deque> #include <iostream> #include <list> #include <map> #include <math.h> #include <queue> #in...
insert
91
91
91
93
0
p02990
C++
Runtime Error
// temprates #include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string> #include <tuple> #include <vector> ...
// temprates #include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string> #include <tuple> #include <vector> ...
replace
54
55
54
55
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> #pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #define ll long long #define eps 1e-7 #define all(x) ((x).begin()), ((x).end()) #define usecppio \ ios::sync_with_stdio(0); ...
#include <bits/stdc++.h> #pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #define ll long long #define eps 1e-7 #define all(x) ((x).begin()), ((x).end()) #define usecppio \ ios::sync_with_stdio(0); ...
insert
30
30
30
34
0
p02990
C++
Runtime Error
/** * author: rishabh_sethi **/ #include <bits/stdc++.h> #define pb push_back #define ll long long #define mem(x, val) memset(x, val, sizeof(x)) #define mk make_pair #define f(i, n) for (i = 0; i < n; i++) #define f1(i, n) for (i = 1; i <= n; i++) #define all(a) a.begin(), a.end() #define upp(v, val) upper_bound(...
/** * author: rishabh_sethi **/ #include <bits/stdc++.h> #define pb push_back #define ll long long #define mem(x, val) memset(x, val, sizeof(x)) #define mk make_pair #define f(i, n) for (i = 0; i < n; i++) #define f1(i, n) for (i = 1; i <= n; i++) #define all(a) a.begin(), a.end() #define upp(v, val) upper_bound(...
replace
235
238
235
243
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef string str; #define rep(i, n) for (int i = 0; i < n; ++i) #define REP(i, n) for (int i = 1; i <= n; ++i) #define all(obj) (obj).begin(), (obj).end() using P = pair<int, int>; const int inf = 1e9; const ll INF = 1e18; const ll MOD = 1e9 + 7; con...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef string str; #define rep(i, n) for (int i = 0; i < n; ++i) #define REP(i, n) for (int i = 1; i <= n; ++i) #define all(obj) (obj).begin(), (obj).end() using P = pair<int, int>; const int inf = 1e9; const ll INF = 1e18; const ll MOD = 1e9 + 7; con...
replace
40
41
40
41
0
p02990
C++
Runtime Error
#include <iostream> using namespace std; const int MOD = 1000000007; const int MAX = 2000; long long mod(long long a) { a %= MOD; return a >= 0 ? a : a + MOD; } long long inverse[MAX + 1]; long long factorial[MAX + 1]; long long factorial_inverse[MAX + 1]; void calc(int n) { inverse[1] = 1; factorial[0] = fa...
#include <iostream> using namespace std; const int MOD = 1000000007; const int MAX = 2000; long long mod(long long a) { a %= MOD; return a >= 0 ? a : a + MOD; } long long inverse[MAX + 1]; long long factorial[MAX + 1]; long long factorial_inverse[MAX + 1]; void calc(int n) { inverse[1] = 1; factorial[0] = fa...
replace
39
40
39
43
0
p02990
C++
Runtime Error
#include <algorithm> #include <iostream> #include <limits> #include <string> #include <tuple> #include <vector> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, n) FOR(i, 0, n) #define FORCLS(i, a, b) for (int i = (a); i <= (b); i++) #define REPCLS(i, n) FORCLS(i, 1, n) templa...
#include <algorithm> #include <iostream> #include <limits> #include <string> #include <tuple> #include <vector> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, n) FOR(i, 0, n) #define FORCLS(i, a, b) for (int i = (a); i <= (b); i++) #define REPCLS(i, n) FORCLS(i, 1, n) templa...
replace
71
78
71
76
0
p02990
C++
Runtime Error
#include <algorithm> #include <iostream> #include <string> #define llint long long #define mod 1000000007 using namespace std; llint n, k; const int FACT_MAX = 200005; llint fact[FACT_MAX], fact_inv[FACT_MAX]; llint modpow(llint a, llint n) { if (n == 0) return 1; if (n % 2) { return ((a % mod) * (modpo...
#include <algorithm> #include <iostream> #include <string> #define llint long long #define mod 1000000007 using namespace std; llint n, k; const int FACT_MAX = 200005; llint fact[FACT_MAX], fact_inv[FACT_MAX]; llint modpow(llint a, llint n) { if (n == 0) return 1; if (n % 2) { return ((a % mod) * (modpo...
replace
49
50
49
50
0
p02990
C++
Runtime Error
#include <algorithm> #include <cassert> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; typedef long long ll; const int INF = 1 << 30; const ll MOD = 1e9 + 7; const double EPS = 1e-9; ll...
#include <algorithm> #include <cassert> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; typedef long long ll; const int INF = 1 << 30; const ll MOD = 1e9 + 7; const double EPS = 1e-9; ll...
insert
53
53
53
55
0
p02990
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <numeric> #include <sstream> #include <string> #include <utility> #include <vector> using namespace std; #define repd(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n)...
#include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <numeric> #include <sstream> #include <string> #include <utility> #include <vector> using namespace std; #define repd(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n)...
insert
47
47
47
52
0
p02990
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const long long MOD = 1e9 + 7; const long long MAX = 1e6; long long fact[MAX + 1] = {0}; void fact_init() { fact[0] = 1; for (long long i = 1; i <= MAX; i++) { fact[i] = (fact[i - 1] * i % MOD) % MOD; } } long long repeat_fact(long long N, long long P) { if (...
#include <bits/stdc++.h> using namespace std; const long long MOD = 1e9 + 7; const long long MAX = 1e6; long long fact[MAX + 1] = {0}; void fact_init() { fact[0] = 1; for (long long i = 1; i <= MAX; i++) { fact[i] = (fact[i - 1] * i % MOD) % MOD; } } long long repeat_fact(long long N, long long P) { if (...
replace
33
37
33
40
0