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
p02862
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, j, n) for (int i = (int)(j); i < (int)(n); i++) #define REP(i, j, n) for (int i = (int)(j); i <= (int)(n); i++) #define MOD 1000000007 #define int long long #define ALL(a) (a).begin(), (a).end() #define vi vector<int> #define vii vector<vi> #define pii pair<i...
#include <bits/stdc++.h> using namespace std; #define rep(i, j, n) for (int i = (int)(j); i < (int)(n); i++) #define REP(i, j, n) for (int i = (int)(j); i <= (int)(n); i++) #define MOD 1000000007 #define int long long #define ALL(a) (a).begin(), (a).end() #define vi vector<int> #define vii vector<vi> #define pii pair<i...
replace
14
15
14
15
0
p02862
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; #define SZ(a) ((int)a.size()) #define ALL(a) a.begin(), a.end() #define MP make_pair #define PB push_back #define EB emplace_back #define fst first #define snd second void dout() { cerr << endl; } template <typename Head, typ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; #define SZ(a) ((int)a.size()) #define ALL(a) a.begin(), a.end() #define MP make_pair #define PB push_back #define EB emplace_back #define fst first #define snd second void dout() { cerr << endl; } template <typename Head, typ...
replace
50
51
50
54
0
p02862
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, s, n) for (ll i = (s); i < (n); i++) #define rep0(i, n) rep(i, 0, n) #define rep1(i, n) rep(i, 1, n + 1) #define repR(i, s, n) for (ll i = (n - 1); i >= (s); i--) #define repR0(i, n) repR(i, 0, n) #define repR1(i, n) repR(i, 1, n + 1) ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, s, n) for (ll i = (s); i < (n); i++) #define rep0(i, n) rep(i, 0, n) #define rep1(i, n) rep(i, 1, n + 1) #define repR(i, s, n) for (ll i = (n - 1); i >= (s); i--) #define repR0(i, n) repR(i, 0, n) #define repR1(i, n) repR(i, 1, n + 1) ...
replace
62
63
62
63
0
p02862
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = unsigned long long; using P = pair<long double, long double>; const ll INF64 = 1LL << 60; const int INF = 1 << 29; const ll MOD = 1000000007; const int CASES = 3; // 負の数にも対応した mod (a = -11 とかでも OK) inline long long mod(long long a, long long m) { long long ...
#include <bits/stdc++.h> using namespace std; using ll = unsigned long long; using P = pair<long double, long double>; const ll INF64 = 1LL << 60; const int INF = 1 << 29; const ll MOD = 1000000007; const int CASES = 3; // 負の数にも対応した mod (a = -11 とかでも OK) inline long long mod(long long a, long long m) { long long ...
replace
60
62
60
62
TLE
p02862
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < n; i++) #define REP(i, n) for (ll i = 1; i ...
#include <algorithm> #include <cassert> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < n; i++) #define REP(i, n) for (ll i = 1; i ...
replace
17
18
17
18
0
p02862
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define mp make_pair #define pii pair<int, int> #define pb push_back #define r1 rt << 1 #define r2 rt << 1 | 1 #define fi first #define se second #define ri register int #define rep(i, a, b) for (ri i = (a); i <= (b); ++i) #define rep2(i, a, b, c) for (ri i = (a); i <= (b);...
#include <bits/stdc++.h> #define ll long long #define mp make_pair #define pii pair<int, int> #define pb push_back #define r1 rt << 1 #define r2 rt << 1 | 1 #define fi first #define se second #define ri register int #define rep(i, a, b) for (ri i = (a); i <= (b); ++i) #define rep2(i, a, b, c) for (ri i = (a); i <= (b);...
replace
72
73
72
77
0
p02862
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG // これつけるとA[N]でもいいらしい // for文のマクロ #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define big 1000000007 const int MOD = 1000000007; const int MAX = 510000; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1...
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG // これつけるとA[N]でもいいらしい // for文のマクロ #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define big 1000000007 const int MOD = 1000000007; const int MAX = 1000000; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[...
replace
8
9
8
9
0
p02862
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define rep(i, a, b) for (ll i = a; i < b; i++) #define rrep(i, a, b) for (ll i = a; i >= b; i--) #define fore(i, a) for (auto &i : a) #define all(x) (x).begin(), (x).end() // 2項定理(MOD使用) const ll MAX = 510000; const ll MOD = 1...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define rep(i, a, b) for (ll i = a; i < b; i++) #define rrep(i, a, b) for (ll i = a; i >= b; i--) #define fore(i, a) for (auto &i : a) #define all(x) (x).begin(), (x).end() // 2項定理(MOD使用) const ll MAX = 1000000; const ll MOD = ...
replace
10
11
10
11
0
p02862
C++
Runtime Error
// Author: getharshkumar #include <bits/stdc++.h> using namespace std; #define ll int64_t const ll M = 1e9 + 7, N = 1e6 + 5; ll fac[N]; ll power(ll x, ll y) { ll res = 1; x %= M; while (y) { if (y % 2) res = (res * x) % M; x = (x * x) % M; y /= 2; } return res; } ll ncr(ll n, ll r) { if (...
// Author: getharshkumar #include <bits/stdc++.h> using namespace std; #define ll int64_t const ll M = 1e9 + 7, N = 1e6 + 5; ll fac[N]; ll power(ll x, ll y) { ll res = 1; x %= M; while (y) { if (y % 2) res = (res * x) % M; x = (x * x) % M; y /= 2; } return res; } ll ncr(ll n, ll r) { if (...
replace
32
33
32
33
0
p02862
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define mod 1000000007ll using namespace std; ll fact[2000006]; ll bigmod(ll b, ll p) { if (!p) return 1ll; ll ret = bigmod(b, p / 2); ret = (ret * ret) % mod; if (p & 1ll) return ret = (ret * b) % mod; return ret; } ll ncr(ll n, ll r) { ll nume = fact[n...
#include <bits/stdc++.h> #define ll long long #define mod 1000000007ll using namespace std; ll fact[2000006]; ll bigmod(ll b, ll p) { if (!p) return 1ll; ll ret = bigmod(b, p / 2); ret = (ret * ret) % mod; if (p & 1ll) return ret = (ret * b) % mod; return ret; } ll ncr(ll n, ll r) { ll nume = fact[n...
replace
28
29
28
29
0
p02862
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; vector<long long> fact, fact_inv, inv; /* init_nCk :二項係数のための前処理 計算量:O(n) */ void init_nCk(int SIZE) { fact.resize(SIZE + 5); fact_inv.resize(SIZE + 5); inv.resize(SIZE + 5); fact[0] = fact[1] = 1; fact_inv[0] = fact_inv[1] = 1; inv[...
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; vector<long long> fact, fact_inv, inv; /* init_nCk :二項係数のための前処理 計算量:O(n) */ void init_nCk(int SIZE) { fact.resize(SIZE + 5); fact_inv.resize(SIZE + 5); inv.resize(SIZE + 5); fact[0] = fact[1] = 1; fact_inv[0] = fact_inv[1] = 1; inv[...
replace
38
40
38
44
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p02862
C++
Runtime Error
#include <algorithm> #include <iostream> #include <iterator> #include <vector> using namespace std; namespace mod { template <class T, int M> class MInt; template <class T, int M> MInt<T, M> Pow(const MInt<T, M> &base, T exp); template <class T, int M> MInt<T, M> Inv(const MInt<T, M> &n); template <class T, int M...
#include <algorithm> #include <iostream> #include <iterator> #include <vector> using namespace std; namespace mod { template <class T, int M> class MInt; template <class T, int M> MInt<T, M> Pow(const MInt<T, M> &base, T exp); template <class T, int M> MInt<T, M> Inv(const MInt<T, M> &n); template <class T, int M...
replace
121
122
121
126
0
p02862
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define MOD 1000000007 #define MAX_P 510000 using namespace std; vector<ll> factn(MAX_P + 1); // n! = factn[i] void fact(ll n) { factn[1] = 1; for (ll i = 2; i <= n; i++) { factn[i] = factn[i - 1] * i % MOD; } return; } ll extgcd(ll a, ll b, ll &x, ll &y) { ...
#include <bits/stdc++.h> #define ll long long #define MOD 1000000007 #define MAX_P 1100000 using namespace std; vector<ll> factn(MAX_P + 1); // n! = factn[i] void fact(ll n) { factn[1] = 1; for (ll i = 2; i <= n; i++) { factn[i] = factn[i - 1] * i % MOD; } return; } ll extgcd(ll a, ll b, ll &x, ll &y) { ...
replace
3
4
3
4
0
p02862
C++
Runtime Error
#include <algorithm> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; #define All(v...
#include <algorithm> #include <cmath> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; #define All(v...
insert
109
109
109
111
0
p02862
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define int long long #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPS(i, r, n) for (int i = (r); i < (n); ++i) #define REPR(i, n) for (int i = (n); i >= 0; --i) // from n to 0 #define REPRS(i, r, n) for (int i = (n); i >= (r); --i) /...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define int long long #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPS(i, r, n) for (int i = (r); i < (n); ++i) #define REPR(i, n) for (int i = (n); i >= 0; --i) // from n to 0 #define REPRS(i, r, n) for (int i = (n); i >= (r); --i) /...
replace
28
29
28
29
0
p02862
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; const long long MOD = 1000000007LL; const long long INF = 1e18; int GCD(int a, int b) { return b == 0 ? a : GCD(b, a % b); } long long fast_exp(long long base, long long exp, long long mod = MOD) { lon...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; const long long MOD = 1000000007LL; const long long INF = 1e18; int GCD(int a, int b) { return b == 0 ? a : GCD(b, a % b); } long long fast_exp(long long base, long long exp, long long mod = MOD) { lon...
replace
69
70
69
70
0
p02862
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr ll MOD = 1e9 + 7; constexpr ll INF = 1ll << 60; #define FOR(i, a, b) for (ll i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) (v).begin(), (v).end() constexpr ll COMB_MAX = 1e6 + 10; vector<ll> fac(COMB_MAX); vector<ll...
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr ll MOD = 1e9 + 7; constexpr ll INF = 1ll << 60; #define FOR(i, a, b) for (ll i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) (v).begin(), (v).end() constexpr ll COMB_MAX = 1e6 + 10; vector<ll> fac(COMB_MAX); vector<ll...
insert
52
52
52
54
0
p02862
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll int64_t #define rep(i, n) for (ll i = 0; i < n; i++) #define rrep(i, n) for (ll i = 1; i <= n; i++) #define ALL(x) (x).begin(), (x).end() #define SZ(x) ((int)(x).size()) #define pb push_back #define mod 1000000007 #define vec vector #define dump(x) cerr << #x << "=" << x << endl #def...
#include <bits/stdc++.h> #define ll int64_t #define rep(i, n) for (ll i = 0; i < n; i++) #define rrep(i, n) for (ll i = 1; i <= n; i++) #define ALL(x) (x).begin(), (x).end() #define SZ(x) ((int)(x).size()) #define pb push_back #define mod 1000000007 #define vec vector #define dump(x) cerr << #x << "=" << x << endl #def...
replace
65
66
65
66
TLE
p02862
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 = 1e9 + 7; ll inv(ll a) { ll n = mod - 2, ans = 1; while (n > 0) { if (n % 2) ans = ans * a % mod; n = n / 2; a = a * a % mod; } return ans; } ll A[2000001]; ll nCr(ll n, ll...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; ll mod = 1e9 + 7; ll inv(ll a) { ll n = mod - 2, ans = 1; while (n > 0) { if (n % 2) ans = ans * a % mod; n = n / 2; a = a * a % mod; } return ans; } ll A[2000001]; ll nCr(ll n, ll...
insert
25
25
25
29
0
p02862
C++
Runtime Error
#include <algorithm> #include <bitset> #include <iostream> #include <queue> #include <set> #include <string> #include <unordered_map> #include <utility> #include <vector> using namespace std; using ll = long long; using Pii = pair<int, int>; using Pll = pair<ll, ll>; template <class T> using Vvec = vector<vector<T>>; ...
#include <algorithm> #include <bitset> #include <iostream> #include <queue> #include <set> #include <string> #include <unordered_map> #include <utility> #include <vector> using namespace std; using ll = long long; using Pii = pair<int, int>; using Pll = pair<ll, ll>; template <class T> using Vvec = vector<vector<T>>; ...
replace
248
249
248
249
0
p02862
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long const ll mod = 1e9 + 7; ll big_mod(ll a, ll p) { if (p == 0) return 1LL; ll ret = big_mod(a, p / 2); ret *= ret; ret %= mod; if (p & 1) { ret *= a; ret %= mod; } return ret; } ll inv(ll x) { return big_mod(x, mod - 2); }...
#include <bits/stdc++.h> using namespace std; #define ll long long const ll mod = 1e9 + 7; ll big_mod(ll a, ll p) { if (p == 0) return 1LL; ll ret = big_mod(a, p / 2); ret *= ret; ret %= mod; if (p & 1) { ret *= a; ret %= mod; } return ret; } ll inv(ll x) { return big_mod(x, mod - 2); }...
replace
42
43
42
43
0
p02862
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; typedef long long ll; ll mod = 1e9 + 7; vector<ll> fact; void init_fact(int n) { fact = vector<ll>(n); fact[0] = 1; for (int i = 1; i < n; i++) fact[i] = fact[i - 1] * i % mod; } ll calc_pow(ll x, ll pow) { if (pow == 0) return 1; ll a = ...
#include <iostream> #include <vector> using namespace std; typedef long long ll; ll mod = 1e9 + 7; vector<ll> fact; void init_fact(int n) { fact = vector<ll>(n); fact[0] = 1; for (int i = 1; i < n; i++) fact[i] = fact[i - 1] * i % mod; } ll calc_pow(ll x, ll pow) { if (pow == 0) return 1; ll a = ...
replace
30
31
30
31
0
p02862
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 using ll = long long; ll factorial[2000000]; ll power(ll n, ll m) { ll ans = 1; for (int r = 0; m >> r > 0; r++) { if ((m >> r) & 1) ans = ans * n % mod; n = n * n % mod; } return ans; } ll inv(ll n) { return power(n, mod - 2);...
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 using ll = long long; ll factorial[2000000]; ll power(ll n, ll m) { ll ans = 1; for (int r = 0; m >> r > 0; r++) { if ((m >> r) & 1) ans = ans * n % mod; n = n * n % mod; } return ans; } ll inv(ll n) { return power(n, mod - 2);...
replace
37
38
37
38
0
p02862
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define ld long double #pragma 03 using namespace std; ll mod = 1e9 + 7; ll factorial[1000005]; ll binpow(ll c, ll d) { ll a = c % mod, b = d % (mod - 1); if (b == 0) return 1; ll x = binpow(a, b / 2); (x *= x) %= mod; if (b % 2 == 0) return x; else ...
#include <bits/stdc++.h> #define ll long long #define ld long double #pragma 03 using namespace std; ll mod = 1e9 + 7; ll factorial[1000005]; ll binpow(ll c, ll d) { ll a = c % mod, b = d % (mod - 1); if (b == 0) return 1; ll x = binpow(a, b / 2); (x *= x) %= mod; if (b % 2 == 0) return x; else ...
replace
39
40
39
40
0
p02862
C++
Runtime Error
/* Author:N_o_o_B Created:November 19 2019 14:02:32 */ #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; #define TRACE #ifdef TRACE #define trace(...) \ {...
/* Author:N_o_o_B Created:November 19 2019 14:02:32 */ #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; #define TRACE #ifdef TRACE #define trace(...) \ {...
replace
209
210
209
210
TLE
p02862
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <tuple> #include <vector> using namespace std; #define rep(i, n) for (int64_t i = 0; i < (n); i++) #define irep(i, n) for (int64_t i = 0; i <= (n); i++) #define rrep(i...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <tuple> #include <vector> using namespace std; #define rep(i, n) for (int64_t i = 0; i < (n); i++) #define irep(i, n) for (int64_t i = 0; i <= (n); i++) #define rrep(i...
insert
53
53
53
57
TLE
p02862
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int MAX_N = 1000005; const int mod = 1e9 + 7; LL pow_mod(LL a, LL k, LL m) { LL r = 1; for (; k > 0; k >>= 1) { if (k & 1) r = (r * a) % m; a = (a * a) % m; } return r; } LL inverse(LL a, LL m) { return pow_mod(a, m - 2,...
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int MAX_N = 1000005; const int mod = 1e9 + 7; LL pow_mod(LL a, LL k, LL m) { LL r = 1; for (; k > 0; k >>= 1) { if (k & 1) r = (r * a) % m; a = (a * a) % m; } return r; } LL inverse(LL a, LL m) { return pow_mod(a, m - 2,...
replace
39
42
39
46
0
p02862
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int MAX_N = 1000005; const int mod = 1e9 + 7; LL pow_mod(LL a, LL k, LL m) { LL r = 1; for (; k > 0; k >>= 1) { if (k & 1) r = (r * a) % m; a = (a * a) % m; } return r; } LL inverse(LL a, LL m) { return pow_mod(a, m - 2,...
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int MAX_N = 1000005; const int mod = 1e9 + 7; LL pow_mod(LL a, LL k, LL m) { LL r = 1; for (; k > 0; k >>= 1) { if (k & 1) r = (r * a) % m; a = (a * a) % m; } return r; } LL inverse(LL a, LL m) { return pow_mod(a, m - 2,...
insert
35
35
35
37
0
p02862
C++
Runtime Error
#include <bits/stdc++.h> // #include <ext/numeric> // #include <ext/pb_ds/assoc_container.hpp> // Common file // #include <ext/pb_ds/tree_policy.hpp> // Including // tree_order_statistics_node_update #define oo 0x3f3f3f3f #define OO 0x3f3f3f3f3f3f3f3f #define popcount(n) __builtin_popcount(n) #define popcountll(n) __bu...
#include <bits/stdc++.h> // #include <ext/numeric> // #include <ext/pb_ds/assoc_container.hpp> // Common file // #include <ext/pb_ds/tree_policy.hpp> // Including // tree_order_statistics_node_update #define oo 0x3f3f3f3f #define OO 0x3f3f3f3f3f3f3f3f #define popcount(n) __builtin_popcount(n) #define popcountll(n) __bu...
replace
55
56
55
56
0
p02862
C++
Runtime Error
#include <bits/stdc++.h> #define ALL(x) x.begin(), x.end() using namespace std; typedef long long ll; typedef vector<ll> vi; const ll mod = 1e9 + 7; const ll N = 2e6 + 123; ll fact[N]; ll mpow(ll x, ll n) { if (n == 0) return 1; ll res = mpow(x, n / 2); res = res * res % mod; if (n % 2 == 1) res = ...
#include <bits/stdc++.h> #define ALL(x) x.begin(), x.end() using namespace std; typedef long long ll; typedef vector<ll> vi; const ll mod = 1e9 + 7; const ll N = 2e6 + 123; ll fact[N]; ll mpow(ll x, ll n) { if (n == 0) return 1; ll res = mpow(x, n / 2); res = res * res % mod; if (n % 2 == 1) res = ...
replace
35
36
35
37
0
p02862
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define mod 1000000007 using namespace std; const int MAXN = 2e6 + 7; inline int add(int x, int y) { int res = x + y; if (res >= mod) res -= mod; return res; } inline int mul(int x, int y) { ll res = (ll)x * y; res -= res / mod * mod; return res; } int fac[M...
#include <bits/stdc++.h> #define ll long long #define mod 1000000007 using namespace std; const int MAXN = 2e6 + 7; inline int add(int x, int y) { int res = x + y; if (res >= mod) res -= mod; return res; } inline int mul(int x, int y) { ll res = (ll)x * y; res -= res / mod * mod; return res; } int fac[M...
replace
32
33
32
33
0
p02862
C++
Runtime Error
#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
161
162
161
162
0
p02862
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) using namespace std; typedef long long ll; ll mod = 1000000007; ll f[2000102]; void init() {...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) using namespace std; typedef long long ll; ll mod = 1000000007; ll f[2000102]; void init() {...
insert
64
64
64
69
0
p02862
C++
Runtime Error
#include <bits/stdc++.h> #define int long long using namespace std; int a, b; const int hell = 1e9 + 7; int fact[1000001]; int binpower(int a, int b) { int res = 1; while (b) { if (b & 1) (res *= a) %= hell; b /= 2; (a *= a) %= hell; } return res; } int modinverse(int n) { return binpower(...
#include <bits/stdc++.h> #define int long long using namespace std; int a, b; const int hell = 1e9 + 7; int fact[1000001]; int binpower(int a, int b) { int res = 1; while (b) { if (b & 1) (res *= a) %= hell; b /= 2; (a *= a) %= hell; } return res; } int modinverse(int n) { return binpower(...
replace
47
48
47
48
0
p02862
C++
Runtime Error
// #pragma GCC optimize(3, "Ofast", "inline") #include <bits/stdc++.h> #define String std::string #define fir first #define sec second #define mp std::make_pair #define Pair std::pair<int, int> #define Map std::map<int, int> #define Vector std::vector<int> typedef long long ll; typedef unsigned long long ull; const i...
// #pragma GCC optimize(3, "Ofast", "inline") #include <bits/stdc++.h> #define String std::string #define fir first #define sec second #define mp std::make_pair #define Pair std::pair<int, int> #define Map std::map<int, int> #define Vector std::vector<int> typedef long long ll; typedef unsigned long long ull; const i...
insert
62
62
62
64
0
p02863
C++
Runtime Error
// // sublime text 3, // emre yazicioglu // #include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long...
// // sublime text 3, // emre yazicioglu // #include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long...
replace
31
32
31
32
0
p02863
C++
Time Limit Exceeded
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; int main() { int N, T; cin >> N >> T; vi A(N), B(N); for (int i = 0; i < N; i++) { cin >> A[i] >> B[i]; } vector<vector<vi>> dp(T, vector<vi>(N, vi(2, 0))); for (int t = 0; t < T; t++) { ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; int main() { int N, T; cin >> N >> T; vi A(N), B(N); for (int i = 0; i < N; i++) { cin >> A[i] >> B[i]; } vector<vector<vi>> dp(T, vector<vi>(N, vi(2, 0))); for (int t = 0; t < T; t++) { for (int i = 0; i <...
delete
0
1
0
0
TLE
p02863
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ll long long int ll dp[3005][3005]; ll n, t, res; pair<ll, ll> ar[3005]; ll f(int cur_index, int cur_time) { if (cur_time >= t || cur_index > n) return 0; if (dp[cur_index][cur_time]) return dp[cur_index][cur_time]; ll r = 0; r = max(r, f(cur_index...
#include <bits/stdc++.h> using namespace std; #define ll long long int ll dp[3005][3005]; ll n, t, res; pair<ll, ll> ar[3005]; ll f(int cur_index, int cur_time) { if (cur_time >= t || cur_index > n) return 0; if (dp[cur_index][cur_time]) return dp[cur_index][cur_time]; ll r = 0; r = max(r, f(cur_index...
replace
18
19
18
19
TLE
p02863
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { int n, t; cin >> n >> t; long long a[n], b[n]; rep(i, n) cin >> a[i] >> b[i]; long long dp[n + 1][t + 3010][2]; // rep(i,t+3010) dp[0][i][0]=0; // rep(i,t+3010) dp[0][i][1]=0; rep(i, n + 1) { rep...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) int main() { int n, t; cin >> n >> t; long long a[n], b[n]; rep(i, n) cin >> a[i] >> b[i]; // long long dp[n+1][t+3010][2]; vector<vector<vector<long long>>> dp; vector<vector<long long>> tmp; vector<long long> t...
replace
8
9
8
14
0
p02863
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; void solve(long long N, long long T, std::vector...
#include <algorithm> #include <bitset> #include <cmath> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; void solve(long long N, long long T, std::vector...
replace
25
26
25
28
0
p02863
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; #define rep(i, n) for (ll i = 0; i < (int)(n); i++) #define ve vector int main() { int n, t; cin >> n >> t; ve<P> ab; rep(i, n) { ll a, b; cin >> a >> b; ab.push_back(P(a, b)); } sort(ab.begin(), ab.end...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; #define rep(i, n) for (ll i = 0; i < (int)(n); i++) #define ve vector int main() { int n, t; cin >> n >> t; ve<P> ab; rep(i, n) { ll a, b; cin >> a >> b; ab.push_back(P(a, b)); } sort(ab.begin(), ab.end...
replace
22
23
22
23
-6
Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)
p02863
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; int dp[4000][4000][2]; int main() { int N, T; cin >> N >> T; vector<P> v; for (int i = 0; i < N; i++) { int a, b; cin >> a >> b; v.push_back(P(a, b)); } for (int i = 1; i <= N; i++) { for (int...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; int dp[4000][4000][2]; int main() { int N, T; cin >> N >> T; vector<P> v; for (int i = 0; i < N; i++) { int a, b; cin >> a >> b; v.push_back(P(a, b)); } for (int i = 1; i <= N; i++) { for (int...
replace
31
33
31
32
-11
p02863
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL_DEBUG #include "LOCAL_DEBUG.hpp" #endif #define int long long signed main() { int n, t; cin >> n >> t; vector<int> a(n), b(n); for (int i = 0; i < n; i++) { cin >> a[i] >> b[i]; } vector<int> v; vector<int> order(n); iota(order.begin(), ...
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL_DEBUG #include "LOCAL_DEBUG.hpp" #endif #define int long long signed main() { int n, t; cin >> n >> t; vector<int> a(n), b(n); for (int i = 0; i < n; i++) { cin >> a[i] >> b[i]; } vector<int> v; vector<int> order(n); iota(order.begin(), ...
replace
41
42
41
42
0
p02863
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; const int MAX_N = 3000; const int MAX_T = 3000; int N, T; vector<int> As(MAX_N); vector<int> Bs(MAX_N); // memo1[i][j] := 0 ~ iでj分以内で食べられる最大値 vector<vector<int>> memo1(MAX_N, vector<int>(MAX_T + 1, -1)); // memo2[i][j] := i ~ T - 1でj分以内で...
#include <algorithm> #include <iostream> #include <vector> using namespace std; const int MAX_N = 3000; const int MAX_T = 3000; int N, T; vector<int> As(MAX_N); vector<int> Bs(MAX_N); // memo1[i][j] := 0 ~ iでj分以内で食べられる最大値 vector<vector<int>> memo1(MAX_N, vector<int>(MAX_T + 1, -1)); // memo2[i][j] := i ~ T - 1でj分以内で...
replace
38
39
38
39
0
p02863
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } int main() { ll n, t; cin >> n >> t; vector<vector<ll>> dp(t, vector<ll>(2)); for (ll i = 0; i < n; i++) { ll a, b; cin >> a >>...
#include <bits/stdc++.h> using namespace std; using ll = long long; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } int main() { ll n, t; cin >> n >> t; vector<vector<ll>> dp(t, vector<ll>(2)); for (ll i = 0; i < n; i++) { ll a, b; cin >> a >>...
replace
22
23
22
23
-11
p02863
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <vector> using namespace std; using lint = long long; constexpr int MOD = 1000000007, INF = 1010101010; constex...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <vector> using namespace std; using lint = long long; constexpr int MOD = 1000000007, INF = 1010101010; constex...
replace
95
99
95
99
0
p02863
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; int mod = 1000000007; int main(void) { vector<int> val_list; int N, T; cin >> N >> T; int A[N + 1], B[N + 1]; A[0] = 0; B[0] = 0; rep(i, N) { cin >> A[i + 1] >> B[i + 1]; } pair<pair<int...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; using ll = long long; int mod = 1000000007; int main(void) { vector<int> val_list; int N, T; cin >> N >> T; int A[N + 1], B[N + 1]; A[0] = 0; B[0] = 0; rep(i, N) { cin >> A[i + 1] >> B[i + 1]; } pair<pair<int...
replace
46
47
46
51
0
p02863
C++
Runtime Error
#include <bits/stdc++.h> #define ff first #define ss second #define pb push_back #define mp make_pair using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<ull, ull> pull; typedef pair<ll, ll> pii; typedef pair<ld, ld> pld; typedef long...
#include <bits/stdc++.h> #define ff first #define ss second #define pb push_back #define mp make_pair using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<ull, ull> pull; typedef pair<ll, ll> pii; typedef pair<ld, ld> pld; typedef long...
replace
21
23
21
23
-11
p02863
Python
Runtime Error
N, W = map(int, input().split()) items = sorted([list(map(int, input().split())) for i in range(N)]) # dp1[i][j] := 商品0 ~ i が対象 dp = [[0] * (W + 1) for i in range(N + 1)] # dpテーブルを埋める for i in range(N): wi, vi = items[i] for j in range(W + 1): if j + wi <= W: dp[i + 1][j + wi] = max(dp[i +...
N, W = map(int, input().split()) items = sorted([list(map(int, input().split())) for i in range(N)]) # dp1[i][j] := 商品0 ~ i が対象 dp = [[0] * (W + 1) for i in range(N + 1)] # dpテーブルを埋める for i in range(N): wi, vi = items[i] for j in range(W + 1): if j + wi <= W: dp[i + 1][j + wi] = max(dp[i +...
replace
18
19
18
19
TypeError: can only concatenate list (not "int") to list
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02863/Python/s826740020.py", line 19, in <module> ans = max(ans, dp[i] + vi) TypeError: can only concatenate list (not "int") to list
p02863
Python
Time Limit Exceeded
def solve(n, t, ab_list): ab_list_s = sorted(ab_list, key=lambda x: x[0]) res = 0 dp = [0] * t for i in range(n): for s in range(t - 1, -1, -1): if dp[s] > 0 or s == 0: u = s + ab_list_s[i][0] r = dp[s] + ab_list_s[i][1] if u >= t: ...
def solve(n, t, ab_list): ab_list_s = sorted(ab_list, key=lambda x: x[0]) res = 0 dp = [0] * t for i in range(n): for s in range(t - 1, -1, -1): if dp[s] > 0 or s == 0: u = s + ab_list_s[i][0] r = dp[s] + ab_list_s[i][1] if u >= t: ...
replace
33
34
33
34
TLE
p02863
Python
Runtime Error
n, t = map(int, input().split()) x = [list(map(int, input().split())) for _ in range(n)] a_max = max([y[1] for y in x]) dp_pre = [0 for j in range(t + a_max)] dp = [0 for j in range(t + a_max)] for ai, bi in x: for j in range(ai): dp[j] = dp_pre[j] for j in range(ai, t + ai): dp[j] = max(dp_pre...
n, t = map(int, input().split()) x = [list(map(int, input().split())) for _ in range(n)] x.sort() a_max = x[-1][0] dp_pre = [0 for j in range(t + a_max)] dp = [0 for j in range(t + a_max)] for ai, bi in x: for j in range(ai): dp[j] = dp_pre[j] for j in range(ai, t + ai): dp[j] = max(dp_pre[j], ...
replace
2
3
2
4
0
p02863
Python
Time Limit Exceeded
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10**9) INF = 1 << 60 MOD = 1000000007 def main(): N, T, *AB = map(int, read().split()) D = [(a, b) for a, b in zip(*[iter(AB)] * 2)] D.sort() dp = [0] * T ans = 0 for i in r...
import sys read = sys.stdin.read readline = sys.stdin.readline readlines = sys.stdin.readlines sys.setrecursionlimit(10**9) INF = 1 << 60 MOD = 1000000007 def main(): N, T, *AB = map(int, read().split()) D = [(a, b) for a, b in zip(*[iter(AB)] * 2)] D.sort() dp = [0] * T ans = 0 for i, (a,...
replace
19
23
19
23
TLE
p02863
Python
Time Limit Exceeded
N, T = map(int, input().split()) AB = [] for i in range(N): a, b = map(int, input().split()) AB.append((a, b)) AB.sort() ans = 0 dp = dp = [[0 for _ in range(3005)] for _ in range(3005)] for i in range(N): a, b = AB[i] for j in range(T): # iを使わないパターン dp[i + 1][j] = max(dp[i + 1][j], dp[...
N, T = map(int, input().split()) AB = [] for i in range(N): a, b = map(int, input().split()) AB.append((a, b)) AB.sort() ans = 0 dp = [[0 for _ in range(3005)] for _ in range(3005)] for i in range(N): a, b = AB[i] for j in range(T): # iを使わないパターン dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]...
replace
8
9
8
9
TLE
p02863
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #define loop(i, n) for (ll i = 0; i < n; i++) #define rep(i, x, n) for (ll i = x; i <= n; i++) using namespace std; using namespace __gnu_pbds; typedef long long ll; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, t...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #define loop(i, n) for (ll i = 0; i < n; i++) #define rep(i, x, n) for (ll i = x; i <= n; i++) using namespace std; using namespace __gnu_pbds; typedef long long ll; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, t...
replace
29
30
29
30
0
p02863
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int maxn = 3000 + 5; pii dish[maxn]; int dp[maxn][2 * maxn + 5], t; bool cmp(const pii &p1, const pii &p2) { if ((p1.first < t && p2.first >= t) || (p1.first >= t && p2.first < t)) retur...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int maxn = 3000 + 5; pii dish[maxn]; int dp[maxn][2 * maxn + 5], t; bool cmp(const pii &p1, const pii &p2) { return p1.first < p2.first; } int main() { ios::sync_with_stdio(0); cin.tie(0);...
replace
8
16
8
9
0
p02863
C++
Runtime Error
#include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <typeinfo> #includ...
#include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <typeinfo> #includ...
replace
38
39
38
39
-6
Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)
p02863
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; template <typename T> void read(T &t) { t = 0; char ch = getchar(); int f = 1; while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); } do { (t *= 10) += ch - '0'; ch = getchar(); } while ('0' <= ch && ch <= '9'); t *= f;...
#include <bits/stdc++.h> using namespace std; template <typename T> void read(T &t) { t = 0; char ch = getchar(); int f = 1; while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); } do { (t *= 10) += ch - '0'; ch = getchar(); } while ('0' <= ch && ch <= '9'); t *= f;...
replace
48
51
48
49
TLE
p02863
C++
Runtime Error
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string> #include <unordered_map> #include <vector> #define MOD 1000000007 #define int long l...
#include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string> #include <unordered_map> #include <vector> #define MOD 1000000007 #define int long l...
replace
102
103
102
103
0
p02863
C++
Runtime Error
#include <algorithm> #include <array> #include <stdio.h> #include <tuple> #define FOR(i, a, b) for (int(i) = (a); (i) < (b); ++(i)) #define REP(i, n) FOR(i, 0, n) using lli = long long int; constexpr int N = 3000; std::pair<int, int> A[N]; std::array<lli, N + 1> R; int main(void) { int n, t; scanf("%d%d", &n, &...
#include <algorithm> #include <array> #include <stdio.h> #include <tuple> #define FOR(i, a, b) for (int(i) = (a); (i) < (b); ++(i)) #define REP(i, n) FOR(i, 0, n) using lli = long long int; constexpr int N = 3000; std::pair<int, int> A[N]; std::array<lli, N + 1> R; int main(void) { int n, t; scanf("%d%d", &n, &...
replace
21
23
21
23
0
p02863
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <queue> #include <string.h> #include <vector> using namespace std; int i, j, k, T, A[3000], B[3000], N, memo1[3000][3001], memo2[3000][3001], ans; int dp1(int n, int m) { int s, t, u; if (memo1[n][m] != -1) { return memo1[n...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <queue> #include <string.h> #include <vector> using namespace std; int i, j, k, T, A[3000], B[3000], N, memo1[3000][3001], memo2[3000][3001], ans; int dp1(int n, int m) { int s, t, u; if (memo1[n][m] != -1) { return memo1[n...
replace
81
82
81
85
0
p02863
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define ALL(c) (c).begin(), (c).end() #define SUM(x) std::accumulate(ALL(x), 0LL) #define MIN(v) *std::min_element(v.begin(), v.end()) #define MAX(v) *std::max_element(v.begin(), v.end()) #define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.en...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define ALL(c) (c).begin(), (c).end() #define SUM(x) std::accumulate(ALL(x), 0LL) #define MIN(v) *std::min_element(v.begin(), v.end()) #define MAX(v) *std::max_element(v.begin(), v.end()) #define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.en...
replace
65
66
65
66
0
p02863
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, cc, n) for (int i = cc; i <= n; ++i) #define drep(i, cc, n) for (int i = cc; i >= n; --i) #define sz(s) (int)(s.size()) #define vecprint(v) \ rep(i, 0, v.size() - 1) cout << v[i] << " "; ...
#include <bits/stdc++.h> #define rep(i, cc, n) for (int i = cc; i <= n; ++i) #define drep(i, cc, n) for (int i = cc; i >= n; --i) #define sz(s) (int)(s.size()) #define vecprint(v) \ rep(i, 0, v.size() - 1) cout << v[i] << " "; ...
replace
33
34
33
34
0
p02863
C++
Runtime Error
#pragma GCC optimize(2) #include <bits/stdc++.h> using namespace std; const int man = 3e3 + 10; #define IOS ios::sync_with_stdio(0) template <typename T> T gcd(T a, T b) { return b == 0 ? a : gcd(b, a % b); } template <typename T> T exgcd(T a, T b, T &g, T &x, T &y) { if (!b) { g = a, x = 1, y = 0; } else { ...
#pragma GCC optimize(2) #include <bits/stdc++.h> using namespace std; const int man = 1e4 + 10; #define IOS ios::sync_with_stdio(0) template <typename T> T gcd(T a, T b) { return b == 0 ? a : gcd(b, a % b); } template <typename T> T exgcd(T a, T b, T &g, T &x, T &y) { if (!b) { g = a, x = 1, y = 0; } else { ...
replace
3
4
3
4
0
p02863
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> #define rep(i, n) for...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> #define rep(i, n) for...
replace
51
52
51
52
0
p02863
C++
Time Limit Exceeded
// include //------------------------------------------ #include <algorithm> #include <bitset> #include <deque> #include <functional> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #include <complex> #include <numeric> #include <utility> #include <i...
// include //------------------------------------------ #include <algorithm> #include <bitset> #include <deque> #include <functional> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #include <complex> #include <numeric> #include <utility> #include <i...
replace
80
85
80
84
TLE
p02863
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using Int = int_fast64_t; int main() { cin.tie(0); ios::sync_with_stdio(false); int n, t; cin >> n >> t; using P = pair<int, int>; vector<P> v(n); for (int i = 0; i < n; ++i) { int a, b; cin >> a >> b; v[i] = P(a, b); } sort(v.begin(), v.end()...
#include <bits/stdc++.h> using namespace std; using Int = int_fast64_t; int main() { cin.tie(0); ios::sync_with_stdio(false); int n, t; cin >> n >> t; using P = pair<int, int>; vector<P> v(n); for (int i = 0; i < n; ++i) { int a, b; cin >> a >> b; v[i] = P(a, b); } sort(v.begin(), v.end()...
replace
18
19
18
20
0
p02863
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i) #define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) #define ll long long #define lld long double #define ALL(x) x.begin(), x.end() #ifdef ...
#include <bits/stdc++.h> #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i) #define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) #define ll long long #define lld long double #define ALL(x) x.begin(), x.end() #ifdef ...
insert
56
56
56
58
TLE
p02863
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...
replace
70
71
70
71
0
p02863
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 rep1(i, N) for (int i = 1; i < int(N); ++i) #define all(a) (a).begin(), (a).end() #define bit(k) (1LL << (k)) #define SUM(v) accumulate(all(v), 0LL) typedef pair<int, int> i_i; typedef pair<ll...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, N) for (int i = 0; i < int(N); ++i) #define rep1(i, N) for (int i = 1; i < int(N); ++i) #define all(a) (a).begin(), (a).end() #define bit(k) (1LL << (k)) #define SUM(v) accumulate(all(v), 0LL) typedef pair<int, int> i_i; typedef pair<ll...
replace
121
122
121
122
-6
double free or corruption (!prev)
p02863
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <iostream> #include <string> #include <unordered_map> #include <unordered_set> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (n); i++) #define FOR(i, a, b) for (ll i = (a); i < (b); i++) #define FORR(i, a, b) for (l...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <iostream> #include <string> #include <unordered_map> #include <unordered_set> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (n); i++) #define FOR(i, a, b) for (ll i = (a); i < (b); i++) #define FORR(i, a, b) for (l...
replace
72
73
72
73
-11
p02863
C++
Runtime Error
#pragma GCC optimize("O3") #include "bits/stdc++.h" using namespace std; using ll = long long int; #define debugos cout #define debug(v) \ { \ printf("L%d %s > ", __LINE__, #v...
#pragma GCC optimize("O3") #include "bits/stdc++.h" using namespace std; using ll = long long int; #define debugos cout #define debug(v) \ { \ printf("L%d %s > ", __LINE__, #v...
replace
217
218
217
218
0
p02863
C++
Runtime Error
#include <cstring> #include <iostream> #include <stdlib.h> using namespace std; typedef struct { int a; int b; } Eat; int comp(const void *a, const void *b) { Eat c = *(Eat *)a; Eat d = *(Eat *)b; return c.a - d.a; } int main(void) { int n, t; cin >> n >> t; Eat eat[3002]; for (int i = 0; i < n; i++) ...
#include <cstring> #include <iostream> #include <stdlib.h> using namespace std; typedef struct { int a; int b; } Eat; int comp(const void *a, const void *b) { Eat c = *(Eat *)a; Eat d = *(Eat *)b; return c.a - d.a; } int main(void) { int n, t; cin >> n >> t; Eat eat[3002]; for (int i = 0; i < n; i++) ...
delete
47
48
47
47
-6
double free or corruption (!prev)
p02863
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0, i##_max = (N); i < i##_max; ++i) #define repp(i, l, r) for (int i = (l), i##_max = (r); i < i##_max; ++i) #define per(i, N) for (int i = (N)-1; i >= 0; --i) #define perr(i, l, r) for (int i = r - 1, i##_min(l); i >= i##_min; --i) #define al...
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0, i##_max = (N); i < i##_max; ++i) #define repp(i, l, r) for (int i = (l), i##_max = (r); i < i##_max; ++i) #define per(i, N) for (int i = (N)-1; i >= 0; --i) #define perr(i, l, r) for (int i = r - 1, i##_min(l); i >= i##_min; --i) #define al...
replace
55
56
55
56
-11
p02863
C++
Runtime Error
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using na...
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using na...
replace
26
28
26
28
0
p02863
C++
Runtime Error
#include <stdint.h> #include <stdlib.h> #include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; using default_counter_t = int64_t; // macro #define let auto const & #define overload4(a, b, c, d, name, ...) name #define rep1(n) ...
#include <stdint.h> #include <stdlib.h> #include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; using default_counter_t = int64_t; // macro #define let auto const & #define overload4(a, b, c, d, name, ...) name #define rep1(n) ...
delete
152
154
152
152
0
p02863
C++
Runtime Error
// g++ -std=c++14 test.cpp -o test.out #include <algorithm> #include <bitset> #include <cassert> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <stdlib.h> #include <string.h> #include <utility> #include <vector> using namespace...
// g++ -std=c++14 test.cpp -o test.out #include <algorithm> #include <bitset> #include <cassert> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <stdlib.h> #include <string.h> #include <utility> #include <vector> using namespace...
replace
36
37
36
37
0
p02863
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long long ans[3001][6001]; int main() { int n, t; cin >> n >> t; int a[n], b[n]; for (int i = 0; i < n; i++) cin >> a[i] >> b[i]; vector<pair<int, int>> x; for (int i = 0; i < n; i++) x.push_back(make_pair(a[i], b[i])); sort(x.begin(), x.end()); mem...
#include <bits/stdc++.h> using namespace std; long long ans[3001][6001]; int main() { int n, t; cin >> n >> t; int a[n], b[n]; for (int i = 0; i < n; i++) cin >> a[i] >> b[i]; vector<pair<int, int>> x; for (int i = 0; i < n; i++) x.push_back(make_pair(a[i], b[i])); sort(x.begin(), x.end()); mem...
replace
18
19
18
19
-11
p02863
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define FOR(i, m, n) for (int i = m; i < n; i++) #define ll long long int #define vl vector<ll> #define vi vector<int> const int INF = 2147483647; const ll MOD = 1000000007; using namespace std; int dp1[3001][3000] = {}; int dp2[3002][3000] = {}; ...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define FOR(i, m, n) for (int i = m; i < n; i++) #define ll long long int #define vl vector<ll> #define vi vector<int> const int INF = 2147483647; const ll MOD = 1000000007; using namespace std; int dp1[3001][3000] = {}; int dp2[3002][3000] = {}; ...
replace
17
18
17
18
0
p02863
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, T; cin >> N >> T; vector<int> A(N); vector<int> B(N); for (int i = 0; i < N; i++) { cin >> A[i] >> B[i]; } vector<vector<int>> dp(N + 1, vector<int>(T, 0)); vector<vector<int>> ep(N + 1, vector<int>(T, 0)); int a, b; for (int i...
#include <bits/stdc++.h> using namespace std; int main() { int N, T; cin >> N >> T; vector<int> A(N); vector<int> B(N); for (int i = 0; i < N; i++) { cin >> A[i] >> B[i]; } vector<vector<int>> dp(N + 1, vector<int>(T, 0)); vector<vector<int>> ep(N + 1, vector<int>(T, 0)); int a, b; for (int i...
replace
21
23
21
23
-6
munmap_chunk(): invalid pointer
p02863
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, t; cin >> n >> t; vector<pair<int, int>> ab(n); for (int i = 0; i < n; i++) { int a, b; cin >> a >> b; ab[i] = make_pair(a, b); } sort(ab.begin(), ab.end(), [](pair<int, int> lhs, pair<int, i...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int n, t; cin >> n >> t; vector<pair<int, int>> ab(n); for (int i = 0; i < n; i++) { int a, b; cin >> a >> b; ab[i] = make_pair(a, b); } sort(ab.begin(), ab.end(), [](pair<int, int> lhs, pair<int, i...
replace
22
23
22
23
0
p02863
C++
Runtime Error
#pragma GCC optimize("O3") #include "bits/stdc++.h" using namespace std; using ll = long long int; #define debugos cout #define debug(v) \ { \ printf("L%d %s > ", __LINE__, #v...
#pragma GCC optimize("O3") #include "bits/stdc++.h" using namespace std; using ll = long long int; #define debugos cout #define debug(v) \ { \ printf("L%d %s > ", __LINE__, #v...
insert
231
231
231
233
0
p02863
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define mp make_pair #define pb push_back #define x first #define y second #define pii pair<int, int> #define pll pair<ll, ll> #define xmod (int)(1e9 + 7) using namespace std; int n, t, dp[3005], ans; pii a[3005]; bool used[3005]; int main() { scanf("%d%d", &n, &t); fo...
#include <bits/stdc++.h> #define ll long long #define mp make_pair #define pb push_back #define x first #define y second #define pii pair<int, int> #define pll pair<ll, ll> #define xmod (int)(1e9 + 7) using namespace std; int n, t, dp[3005], ans; pii a[3005]; bool used[3005]; int main() { scanf("%d%d", &n, &t); fo...
replace
26
27
26
27
0
p02864
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int n; const int N = 300; const int K = N; const int H = 1e9; const long long LLINF = N * 1LL * H + 7; long long dp[N + 7][K + 7]; int h[N + 7]; long long dpf(int i, int k) { long long &d = dp[i][k]; if (d != -1) { return d; } if (i > n) { return d = ...
#include <bits/stdc++.h> using namespace std; int n; const int N = 300; const int K = N; const int H = 1e9; const long long LLINF = N * 1LL * H + 7; long long dp[N + 7][K + 7]; int h[N + 7]; long long dpf(int i, int k) { long long &d = dp[i][k]; if (d != -1) { return d; } if (i > n) { return d = ...
replace
27
28
27
28
0
p02864
C++
Runtime Error
#include <bits/stdc++.h> #define all(x) x.begin(), x.end() using namespace std; using ll = long long; using pii = pair<int, int>; const int MN = 305 + 5; int N, K, a[MN]; ll dp[MN][MN]; int main() { ios_base::sync_with_stdio(0), cin.tie(0); memset(dp, 0x3f, sizeof(dp)); cin >> N >> K; for (int i = 1; i <= N; i...
#include <bits/stdc++.h> #define all(x) x.begin(), x.end() using namespace std; using ll = long long; using pii = pair<int, int>; const int MN = 305 + 5; int N, K, a[MN]; ll dp[MN][MN]; int main() { ios_base::sync_with_stdio(0), cin.tie(0); memset(dp, 0x3f, sizeof(dp)); cin >> N >> K; for (int i = 1; i <= N; i...
replace
18
19
18
19
0
p02864
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll dp[505][505]; int n, k, h[305], b[305], he[305][305]; int main() { scanf("%d%d", &n, &k); memset(dp, 0x7f, sizeof(dp)); ll ans = dp[0][0]; int i, j; for (i = 1; i <= n; i++) { scanf("%d", &h[i]); for (j = 0; j <= k; j++) he[i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll dp[505][505]; int n, k, h[305], b[305], he[305][305]; int main() { scanf("%d%d", &n, &k); memset(dp, 0x7f, sizeof(dp)); ll ans = dp[0][0]; int i, j; for (i = 1; i <= n; i++) { scanf("%d", &h[i]); for (j = 0; j <= k; j++) he[i...
replace
36
37
36
37
0
p02864
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long using namespace std; const int MAXN = 301; ll dp[MAXN][MAXN], h[MAXN]; int main() { int n, k; scanf("%d%d", &n, &k); for (int i = 1; i <= n; i++) scanf("%lld", &h[i]); n++; for (int i = 1; i <= n; i++) for (int j = 0; j <= k; j++) { dp[i][j] = 1e16; ...
#include <bits/stdc++.h> #define ll long long using namespace std; const int MAXN = 302; ll dp[MAXN][MAXN], h[MAXN]; int main() { int n, k; scanf("%d%d", &n, &k); for (int i = 1; i <= n; i++) scanf("%lld", &h[i]); n++; for (int i = 1; i <= n; i++) for (int j = 0; j <= k; j++) { dp[i][j] = 1e16; ...
replace
3
4
3
4
0
p02864
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); ++i) using namespace std; using lint = long long; template <class T = int> using V = vector<T>; template <class T = int> using VV = V<V<T>>; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n, k; cin >> n >> k; k = n - k...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)(n); ++i) using namespace std; using lint = long long; template <class T = int> using V = vector<T>; template <class T = int> using VV = V<V<T>>; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n, k; cin >> n >> k; k = n - k...
replace
14
15
14
17
0
p02864
C++
Runtime Error
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; #ifndef orewabaka2 #define f first #define s second #define minna(a) a.begin(), a.end() #define ovse(a) a.rbegin(), a.rend() #define pb push_back #define endl aut '\n...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; #ifndef orewabaka2 #define f first #define s second #define minna(a) a.begin(), a.end() #define ovse(a) a.rbegin(), a.rend() #define pb push_back #define endl aut '\n...
replace
207
208
207
208
0
p02864
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAX_N = 3e2 + 10; const ll INF = 1e18 + 10; ll dp[MAX_N][MAX_N][MAX_N], H[MAX_N]; int N, K, M; int main() { for (int i = 0; i < MAX_N; i++) for (int j = 0; j < MAX_N; j++) for (int k = 0; k < MAX_N; k++) dp[i][j][k] = ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAX_N = 3e2 + 10; const ll INF = 1e18 + 10; ll dp[MAX_N][MAX_N][MAX_N], H[MAX_N]; int N, K, M; int main() { for (int i = 0; i < MAX_N; i++) for (int j = 0; j < MAX_N; j++) for (int k = 0; k < MAX_N; k++) dp[i][j][k] = ...
replace
37
38
37
38
TLE
p02864
C++
Runtime Error
#include <algorithm> #include <complex> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <memory> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define REP(i, m, n) for (int i...
#include <algorithm> #include <complex> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <memory> #include <numeric> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define REP(i, m, n) for (int i...
replace
73
74
73
74
-11
p02864
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define fs first #define fst first #define sc second #define snd second #define sz(X) (int)(X).size() #define forn(i, n) for (int i = 0; i < int(n); i++) #define fornr(i, n) for (int i = int(n) - 1; i >= 0; i--) #define forab(i, a...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define fs first #define fst first #define sc second #define snd second #define sz(X) (int)(X).size() #define forn(i, n) for (int i = 0; i < int(n); i++) #define fornr(i, n) for (int i = int(n) - 1; i >= 0; i--) #define forab(i, a...
replace
25
26
25
26
-11
p02864
C++
Time Limit Exceeded
#include <bits/stdc++.h> using std::min; int n, m, a[205]; long long dp[305][305][305], ans; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= n; i++) scanf("%d", &a[i]); memset(dp, 0x3f, sizeof(dp)); dp[0][0][0] = 0; for (int i = 0; i < n; i++) for (int j = 0; j <= i; j++) for (int k = 0...
#include <bits/stdc++.h> using std::min; int n, m, a[305]; long long dp[305][305][305], ans; int main() { scanf("%d%d", &n, &m); for (int i = 1; i <= n; i++) scanf("%d", &a[i]); memset(dp, 0x3f, sizeof(dp)); dp[0][0][0] = 0; for (int i = 0; i < n; i++) for (int j = 0; j <= i; j++) for (int k = 0...
replace
2
3
2
3
TLE
p02864
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> #define pb push_back #define mk make_pair #define eb emplace_back #define eps 1e-8 #define fi first #def...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> #define pb push_back #define mk make_pair #define eb emplace_back #define eps 1e-8 #define fi first #def...
delete
37
42
37
37
-11
p02864
C++
Runtime Error
// 解説PDFの通り実装 // K個の列を選んで長さを変えるのと、K個の列をなくすのとが同じことにまず気付く必要があった #include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> ...
// 解説PDFの通り実装 // K個の列を選んで長さを変えるのと、K個の列をなくすのとが同じことにまず気付く必要があった #include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> ...
replace
72
76
72
82
0
p02864
C++
Runtime Error
#define _USE_MATH_DEFINES #ifdef __GNUC__ #include <bits/stdc++.h> #else #define _CRT_SECURE_NO_WARNINGS #include <__msvc_all_public_headers.hpp> #undef min #undef max #endif #define rep(i, n) for (int i = 0; i < (n); ++i) #define FOR(i, m, n) for (int i = (m); i < (n); ++i) #define rrep(i, n) for (int i = (n)-1; i >= ...
#define _USE_MATH_DEFINES #ifdef __GNUC__ #include <bits/stdc++.h> #else #define _CRT_SECURE_NO_WARNINGS #include <__msvc_all_public_headers.hpp> #undef min #undef max #endif #define rep(i, n) for (int i = 0; i < (n); ++i) #define FOR(i, m, n) for (int i = (m); i < (n); ++i) #define rrep(i, n) for (int i = (n)-1; i >= ...
insert
577
577
577
581
0
p02864
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) ...
insert
55
55
55
57
0
p02864
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(i, 0, n) #define ALL(v) begin(v), end(v) #define fi first #define se second template <typename A, typename B> inline bool chmax(A &a, B b) { if (a < b) { a = b; return 1; } return 0; } ...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, n) FOR(i, 0, n) #define ALL(v) begin(v), end(v) #define fi first #define se second template <typename A, typename B> inline bool chmax(A &a, B b) { if (a < b) { a = b; return 1; } return 0; } ...
replace
30
31
30
31
0
p02864
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define per(i, n) for (int i = (n)-1; i >= 0; --i) #define repa(i, n) for (int i = 1; i < (n); ++i) #define foreach(i, n) for (auto &i : (n)) #define pii pair<int, int> #define pll pair<long long, long long> #define all(x) (x).begin(), (x).end() #...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define per(i, n) for (int i = (n)-1; i >= 0; --i) #define repa(i, n) for (int i = 1; i < (n); ++i) #define foreach(i, n) for (auto &i : (n)) #define pii pair<int, int> #define pll pair<long long, long long> #define all(x) (x).begin(), (x).end() #...
replace
84
92
84
87
TLE
p02864
C++
Runtime Error
#define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace s...
#define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace s...
replace
771
772
771
773
0
p02864
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; long long D[301][301], H[302]; int main() { int n, k; cin >> n >> k; for (int i = 1; i <= n; i++) { cin >> H[i]; } H[n + 1] = 0; for (int i = 0; i <= k; i++) { D[0][i] = 0; } for (int i = 1; i <= n + 1; i++) { D[i][0] = D[i - 1][0] + max(0ll, ...
#include <bits/stdc++.h> using namespace std; long long D[302][301], H[302]; int main() { int n, k; cin >> n >> k; for (int i = 1; i <= n; i++) { cin >> H[i]; } H[n + 1] = 0; for (int i = 0; i <= k; i++) { D[0][i] = 0; } for (int i = 1; i <= n + 1; i++) { D[i][0] = D[i - 1][0] + max(0ll, ...
replace
4
5
4
5
0