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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02648 | C++ | Runtime Error | // warm heart, wagging tail,and a smile just for you!
// ███████████
// ███╬╬╬╬╬╬╬╬╬╬███
// ███╬╬╬╬╬████╬╬╬╬╬╬███
// ... | // warm heart, wagging tail,and a smile just for you!
// ███████████
// ███╬╬╬╬╬╬╬╬╬╬███
// ███╬╬╬╬╬████╬╬╬╬╬╬███
// ... | replace | 89 | 90 | 89 | 90 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p02648 | C++ | Runtime Error | #include <bits/stdc++.h>
#define long long long int
using namespace std;
// @author: pashka
int BUBEN = (1 << 9) - 1;
int MAX = 100001;
int main() {
ios::sync_with_stdio(false);
int n;
cin >> n;
vector<int> v(n), w(n);
for (int i = 0; i < n; i++) {
cin >> v[i] >> w[i];
}
int nn = min(n, BUBEN);
... | #include <bits/stdc++.h>
#define long long long int
using namespace std;
// @author: pashka
int BUBEN = (1 << 9) - 1;
int MAX = 100001;
int main() {
ios::sync_with_stdio(false);
int n;
cin >> n;
vector<int> v(n), w(n);
for (int i = 0; i < n; i++) {
cin >> v[i] >> w[i];
}
int nn = min(n, BUBEN);
... | replace | 39 | 40 | 39 | 40 | 0 | |
p02648 | C++ | Time Limit Exceeded | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
// #define int long long
// #define double long double
#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 repeq(i, n) for (int i = 0; i <= (int)(n); ++i)
#define rep1eq(i, n) for (int ... | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
// #define int long long
// #define double long double
#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 repeq(i, n) for (int i = 0; i <= (int)(n); ++i)
#define rep1eq(i, n) for (int ... | replace | 107 | 108 | 107 | 108 | TLE | |
p02648 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int maxD = 1 << 9, maxQ = 100009, maxN = (1 << 18) + 9;
int maxL, N, Q, v[maxN], w[maxN], id[20], ans[maxQ];
vector<int> dp;
vector<pair<int, int>> qr[maxQ];
void df0(int nod) {
if (nod >= maxD) {
if (!qr[nod].empty()) {
int nr = 1;
id[0] = nod;
... | #include <bits/stdc++.h>
using namespace std;
const int maxD = 1 << 9, maxQ = 100009, maxN = (1 << 18) + 9;
int maxL, N, Q, v[maxN], w[maxN], id[20], ans[maxQ];
vector<int> dp;
vector<pair<int, int>> qr[maxN];
void df0(int nod) {
if (nod >= maxD) {
if (!qr[nod].empty()) {
int nr = 1;
id[0] = nod;
... | replace | 7 | 8 | 7 | 8 | 0 | |
p02648 | C++ | Runtime Error | #include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
#define Test(tt) cout << "Case #" << tt << ": "
using namespace std;
const int MAXN = (int)1e5;
int value[MAXN + 1], weight[MAXN + 1];
vector<pair<int, int>> qry[MAXN + 1];
vector<pair<ll, ll>> sums[20][2];
ll sol... | #include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
#define Test(tt) cout << "Case #" << tt << ": "
using namespace std;
const int MAXN = (1 << 18);
int value[MAXN + 1], weight[MAXN + 1];
vector<pair<int, int>> qry[MAXN + 1];
vector<pair<ll, ll>> sums[20][2];
ll so... | replace | 8 | 9 | 8 | 9 | 0 | |
p02648 | C++ | Time Limit Exceeded | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#de... | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#de... | replace | 39 | 40 | 39 | 40 | TLE | |
p02648 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define debug(v) \
cout << #v << ":"; \
for (auto x : v) { ... | #include <bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define debug(v) \
cout << #v << ":"; \
for (auto x : v) { ... | replace | 32 | 34 | 32 | 34 | TLE | |
p02648 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N, Q;
vector<pair<ll, ll>> tree;
vector<pair<ll, ll>> que;
vector<vector<ll>> best_per_weight;
int max_idx = 1;
ll max_l;
ll brute_force(int v, ll w, ll acc_val, ll max_wq) {
if (v < max_idx) {
return best_per_weight[v][max_wq - w] + acc_va... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N, Q;
vector<pair<ll, ll>> tree;
vector<pair<ll, ll>> que;
vector<vector<ll>> best_per_weight;
int max_idx = 1;
ll max_l;
ll brute_force(int v, ll w, ll acc_val, ll max_wq) {
if (v < max_idx) {
return best_per_weight[v][max_wq - w] + acc_va... | replace | 52 | 53 | 52 | 53 | TLE | |
p02648 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(a, n) for (ll a = 0; a < (n); ++a)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<vector<ll>> Graph;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T ... | #include <bits/stdc++.h>
#define rep(a, n) for (ll a = 0; a < (n); ++a)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<vector<ll>> Graph;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T ... | replace | 82 | 83 | 82 | 83 | -11 | |
p02648 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
typedef vector<int> vi;
typedef long long lint;
typedef unsigned int uint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
typedef unsigned long long ulint;
#define endl '\n'
#define fst first
#define sed second
#define pb push_back
#... | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
typedef vector<int> vi;
typedef long long lint;
typedef unsigned int uint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
typedef unsigned long long ulint;
#define endl '\n'
#define fst first
#define sed second
#define pb push_back
#... | replace | 70 | 72 | 70 | 72 | -11 | |
p02648 | C++ | Runtime Error | #include <bits/stdc++.h>
#define FASTIO
using namespace std;
using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();
template <typename T1, typename T2>... | #include <bits/stdc++.h>
#define FASTIO
using namespace std;
using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();
template <typename T1, typename T2>... | replace | 73 | 74 | 73 | 86 | -11 | |
p02648 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const ll maxn = 1e5 + 5;
const ll mod = 1e9 + 7;
const ld PI = acos((ld)-1);
#define pb push_back
#define endl '\n'
#define do... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const ll maxn = 1e5 + 5;
const ll mod = 1e9 + 7;
const ld PI = acos((ld)-1);
#define pb push_back
#define endl '\n'
#define do... | replace | 38 | 39 | 38 | 39 | -11 | |
p02648 | C++ | Time Limit Exceeded | // https://atcoder.jp/contests/tokiomarine2020/tasks/tokiomarine2020_d
#define CIN_ONLY
#define DECIMAL_DIGITS 10
#define STATIC_MOD 1e9 + 7
#ifdef BTK
/*<head>*/
#include "Template.hpp"
/*</head>*/
#else
/*<body>*/
/* #region auto includes */
/* #region stl */
/*<stl>*/
#include <bits/stdc++.h>
#include <sys/types.h>... | // https://atcoder.jp/contests/tokiomarine2020/tasks/tokiomarine2020_d
#define CIN_ONLY
#define DECIMAL_DIGITS 10
#define STATIC_MOD 1e9 + 7
#ifdef BTK
/*<head>*/
#include "Template.hpp"
/*</head>*/
#else
/*<body>*/
/* #region auto includes */
/* #region stl */
/*<stl>*/
#include <bits/stdc++.h>
#include <sys/types.h>... | replace | 632 | 633 | 632 | 633 | TLE | |
p02648 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); ++i)
#define all(a) (a).begin(), (a).end()
typedef long long ll;
#define rep1(i, n) for (int i = 1; i <= int(n); ++i)
#define lb(s, x) (lower_bound(all(s), x) - s.begin())
#define debug(x) cerr << (#x) << ": " << (x) << endl
te... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); ++i)
#define all(a) (a).begin(), (a).end()
typedef long long ll;
#define rep1(i, n) for (int i = 1; i <= int(n); ++i)
#define lb(s, x) (lower_bound(all(s), x) - s.begin())
#define debug(x) cerr << (#x) << ": " << (x) << endl
te... | replace | 66 | 67 | 66 | 67 | TLE | |
p02648 | C++ | Runtime Error | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
... | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
... | replace | 70 | 71 | 70 | 71 | 0 | |
p02648 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> Pii;
const int SAKAIME = 2048;
const int MAX_W = 300000;
const int MAX_N = 100000;
vector<vector<int>> memo(SAKAIME + 1, vector<int>(MAX_W + 1, 0));
vector<Pii> VW(MAX_N + 1);
int dfs(int v, int l) {
if (v <= SAKAIME)
re... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> Pii;
const int SAKAIME = 2048;
const int MAX_W = 100000;
const int MAX_N = 300000;
vector<vector<int>> memo(SAKAIME + 1, vector<int>(MAX_W + 1, 0));
vector<Pii> VW(MAX_N + 1);
int dfs(int v, int l) {
if (v <= SAKAIME)
re... | replace | 6 | 8 | 6 | 8 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p02648 | C++ | Time Limit Exceeded | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("unroll-loops")
// #pragma warning(disable : 4996)
#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#define __builtin_popcountll __popcnt64
#endif
#include <limits.h>
#include <m... | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("unroll-loops")
// #pragma warning(disable : 4996)
#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#define __builtin_popcountll __popcnt64
#endif
#include <limits.h>
#include <m... | replace | 114 | 115 | 114 | 115 | TLE | |
p02648 | C++ | Time Limit Exceeded |
// Problem : D - Knapsack Queries on a tree
// Contest : AtCoder - Tokio Marine & Nichido Fire Insurance Programming Contest
// 2020 URL :
// https://atcoder.jp/contests/tokiomarine2020/tasks/tokiomarine2020_d Memory
// Limit : 1024 MB Time Limit : 3000 ms Powered by CP Editor
// (https://github.com/cpeditor/cpeditor)... |
// Problem : D - Knapsack Queries on a tree
// Contest : AtCoder - Tokio Marine & Nichido Fire Insurance Programming Contest
// 2020 URL :
// https://atcoder.jp/contests/tokiomarine2020/tasks/tokiomarine2020_d Memory
// Limit : 1024 MB Time Limit : 3000 ms Powered by CP Editor
// (https://github.com/cpeditor/cpeditor)... | replace | 347 | 348 | 347 | 348 | TLE | |
p02648 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uint = unsigned;
using pcc = pair<char, char>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using tuplis = array<ll, 3>;
template <class T> using p... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uint = unsigned;
using pcc = pair<char, char>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using tuplis = array<ll, 3>;
template <class T> using p... | replace | 388 | 389 | 388 | 389 | 0 | |
p02648 | C++ | Time Limit Exceeded | #include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <chrono>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <... | #include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <chrono>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <... | replace | 59 | 60 | 59 | 60 | TLE | |
p02648 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
// typedef vector<vector<ll>> Graph;
const ll mod = 1e9 + 7;
// const ll mod = 998244353;
#define REP(i, n) for (ll i = 0; i < (l... | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
// typedef vector<vector<ll>> Graph;
const ll mod = 1e9 + 7;
// const ll mod = 998244353;
#define REP(i, n) for (ll i = 0; i < (l... | replace | 132 | 133 | 132 | 134 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p02648 | C++ | Time Limit Exceeded | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdint>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include ... | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdint>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include ... | replace | 168 | 169 | 168 | 169 | TLE | |
p02648 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define ALL(obj) (obj).begin(), (obj).end()
#define SPEED \
cin.tie(0); \
ios::sync_with_stdio(false);
template <cla... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define ALL(obj) (obj).begin(), (obj).end()
#define SPEED \
cin.tie(0); \
ios::sync_with_stdio(false);
template <cla... | replace | 52 | 53 | 52 | 54 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p02648 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5;
int n, pa[333333], v[333333], w[333333], ans[333333], x, y, cur[333333];
int cv[33], cw[33], cnt, sumv[11111], sumw[11111], fun[333333], q;
bool con[333333];
vector<pair<int, int>> que[333333];
void proq(int x) {
int xx = x;
if (que[x].empty())
... | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5;
int n, pa[333333], v[333333], w[333333], ans[333333], x, y, cur[333333];
int cv[33], cw[33], cnt, sumv[11111], sumw[11111], fun[333333], q;
bool con[333333];
vector<pair<int, int>> que[333333];
void proq(int x) {
int xx = x;
if (que[x].empty())
... | replace | 78 | 79 | 78 | 79 | TLE | |
p02648 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); ++i)
#define all(a) (a).begin(), (a).end()
typedef long long ll;
#define rep1(i, n) for (int i = 1; i <= int(n); ++i)
#define lb(s, x) (lower_bound(all(s), x) - s.begin())
using P = pair<ll, ll>;
#define w first
#define v secon... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); ++i)
#define all(a) (a).begin(), (a).end()
typedef long long ll;
#define rep1(i, n) for (int i = 1; i <= int(n); ++i)
#define lb(s, x) (lower_bound(all(s), x) - s.begin())
using P = pair<ll, ll>;
#define w first
#define v secon... | replace | 52 | 53 | 52 | 53 | TLE | |
p02648 | C++ | Memory Limit Exceeded | const int isDebugMode = 0;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
struct edge {
long long to, cost;
};
const int inf = 1 << 27;
const long long INF = 1LL << 60;
const int COMBMAX = 1001001;
const long long MOD = 1000000007;
const long long dy[] = {-1,... | const int isDebugMode = 0;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
struct edge {
long long to, cost;
};
const int inf = 1 << 27;
const long long INF = 1LL << 60;
const int COMBMAX = 1001001;
const long long MOD = 1000000007;
const long long dy[] = {-1,... | replace | 105 | 106 | 105 | 106 | MLE | |
p02648 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define reg register
typedef long long ll;
using namespace std;
namespace IO {
char buf[1 << 15], *S, *T;
inline char gc() {
if (S == T) {
T = (S = buf) + fread(buf, 1, 1 << 15, stdin);
if (S == T)
return EOF;
}
return *S++;
}
inline int read() {
reg int x;
reg char c;
... | #include <bits/stdc++.h>
#define reg register
typedef long long ll;
using namespace std;
namespace IO {
char buf[1 << 15], *S, *T;
inline char gc() {
if (S == T) {
T = (S = buf) + fread(buf, 1, 1 << 15, stdin);
if (S == T)
return EOF;
}
return *S++;
}
inline int read() {
reg int x;
reg char c;
... | delete | 51 | 53 | 51 | 51 | TLE | |
p02648 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#define int long long
#define double long double
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i <= n; i++... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#define int long long
#define double long double
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i <= n; i++... | replace | 198 | 200 | 198 | 200 | -11 | |
p02648 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
using ll = long long;
int ipow(int a, int b) {
int r = 1;
while (b >= 1) {
if (b % 2 == 1)
r *= a;
b /= 2;
a *= a;
}
return r;
}
int main() {
int N;
cin >> N;
vector<int> V, ... | #include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
using ll = long long;
int ipow(int a, int b) {
int r = 1;
while (b >= 1) {
if (b % 2 == 1)
r *= a;
b /= 2;
a *= a;
}
return r;
}
int main() {
int N;
cin >> N;
vector<int> V, ... | replace | 41 | 42 | 41 | 42 | TLE | |
p02648 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {... | #include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {... | replace | 26 | 27 | 26 | 27 | TLE | |
p02648 | C++ | Memory Limit Exceeded | /*temp*/
//
//
//
//
// #undef _DEBUG
// #pragma GCC optimize("Ofast")
// 不動小数点の計算高速化
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// #include <boost/multiprecision/cpp_int.hpp>
#ifdef _DEBUG
#include "template.h"
#else
#if __cplusplus >= 201703L
/*Atcoderでしか使えない(c++17 && このテンプレートが使... | /*temp*/
//
//
//
//
// #undef _DEBUG
// #pragma GCC optimize("Ofast")
// 不動小数点の計算高速化
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// #include <boost/multiprecision/cpp_int.hpp>
#ifdef _DEBUG
#include "template.h"
#else
#if __cplusplus >= 201703L
/*Atcoderでしか使えない(c++17 && このテンプレートが使... | replace | 7,125 | 7,126 | 7,125 | 7,126 | MLE | |
p02648 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef int I;
#define REP(i, n) for (I i = 0; i < (I)(n); i++)
I n;
I vw[26214][2], dp[1024][100001];
I c1, c2;
void dfs(I i) {
I j = i / 2;
if (i > 1) {
for (I k = c2; k + 1; k--) {
if (dp[j - 1][k] or !k) {
I ne = k + vw[i - 1][1];
if (ne ... | #include <bits/stdc++.h>
using namespace std;
typedef int I;
#define REP(i, n) for (I i = 0; i < (I)(n); i++)
I n;
I vw[323456][2], dp[1024][100001];
I c1, c2;
void dfs(I i) {
I j = i / 2;
if (i > 1) {
for (I k = c2; k + 1; k--) {
if (dp[j - 1][k] or !k) {
I ne = k + vw[i - 1][1];
if (ne... | replace | 6 | 7 | 6 | 7 | -11 | |
p02648 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int p[1024][1 << 17], v[1 << 19], w[1 << 19], q, a, l, i;
int f(int a, int l) {
if (l < 0)
return -1e9;
if (!a)
return 0;
if (a > 1023)
return max(f(a / 2, l), f(a / 2, l - w[a]) + v[a]);
if (~p[a][l])
return p[a][l];
return p[a][l] = max({f(a / 2,... | #include <bits/stdc++.h>
using namespace std;
int p[1024][1 << 17], v[1 << 19], w[1 << 19], q, a, l, i;
int f(int a, int l) {
if (l < 0)
return -1e9;
if (!a)
return 0;
if (a > 1023)
return max(f(a / 2, l), f(a / 2, l - w[a]) + v[a]);
if (~p[a][l])
return p[a][l];
return p[a][l] = max({f(a / 2,... | replace | 15 | 16 | 15 | 16 | -11 | |
p02648 | C++ | Time Limit Exceeded | // raja1999
// #pragma comment(linker, "/stack:200000000")
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")
#include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ext/pb_ds/assoc_container.hpp>
#includ... | // raja1999
// #pragma comment(linker, "/stack:200000000")
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")
#include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ext/pb_ds/assoc_container.hpp>
#includ... | insert | 108 | 108 | 108 | 109 | TLE | |
p02648 | Python | Time Limit Exceeded | import sys
n, *inp = map(int, sys.stdin.buffer.read().split())
vvv = [0] + inp[0 : n * 2 : 2]
www = [0] + inp[1 : n * 2 : 2]
weight_limit = 10**5
precalc_limit = min(1 << 9, n + 1)
precalc = [[0] * (weight_limit + 1)]
for u in range(1, precalc_limit):
v = vvv[u]
w = www[u]
dp = precalc[u >> 1][:]
for... | import sys
n, *inp = map(int, sys.stdin.buffer.read().split())
vvv = [0] + inp[0 : n * 2 : 2]
www = [0] + inp[1 : n * 2 : 2]
weight_limit = 10**5
precalc_limit = min(1 << 10, n + 1)
precalc = [[0] * (weight_limit + 1)]
for u in range(1, precalc_limit):
v = vvv[u]
w = www[u]
dp = precalc[u >> 1][:]
fo... | replace | 7 | 8 | 7 | 8 | TLE | |
p02648 | C++ | Time Limit Exceeded | #pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl... | #pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl... | replace | 42 | 43 | 42 | 43 | TLE | |
p02648 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using ll = long long;
using uint = unsigned int;
using ull = unsigned long long;
using ld = long double;
template <typename T, int n> using arr = T (&)[n];
template <typename T, int n> using c_arr = const T (&)[n];
template <typename T> using max_heap = std::priority_queue<T>;
template <typena... | #include <bits/stdc++.h>
using ll = long long;
using uint = unsigned int;
using ull = unsigned long long;
using ld = long double;
template <typename T, int n> using arr = T (&)[n];
template <typename T, int n> using c_arr = const T (&)[n];
template <typename T> using max_heap = std::priority_queue<T>;
template <typena... | replace | 173 | 174 | 173 | 174 | TLE | |
p02648 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include ... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include ... | replace | 96 | 97 | 96 | 97 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p02648 | C++ | Time Limit Exceeded | #include <bits/stdc++.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>
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 | 103 | 103 | 103 | 106 | TLE | |
p02648 | C++ | Time Limit Exceeded | #include <algorithm>
#include <array>
#include <cassert>
#include <climits>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#incl... | #include <algorithm>
#include <array>
#include <cassert>
#include <climits>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#incl... | replace | 37 | 38 | 37 | 38 | TLE | |
p02648 | C++ | Runtime Error | #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <bitset> //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#includ... | #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <algorithm>
#include <bitset> //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#includ... | replace | 51 | 52 | 51 | 52 | -11 | |
p02648 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x, to) for (x = 0; x < (to); x++)
#define FORR(x, arr) for (auto &x : arr)
#define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++)
#define ALL(a) (a.begin()), ... | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x, to) for (x = 0; x < (to); x++)
#define FORR(x, arr) for (auto &x : arr)
#define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++)
#define ALL(a) (a.begin()), ... | replace | 90 | 91 | 90 | 91 | 0 | |
p02648 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bits/stdc++.h>
#include <cctype>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long ... | #include <algorithm>
#include <bits/stdc++.h>
#include <cctype>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long ... | replace | 303 | 304 | 303 | 304 | TLE | |
p02648 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, int> pii;
typedef pair<ll, ld> pld;
typedef pair<pii, int> ppiii;
typedef pair<pii, ll> ppiil;
typedef pair<pll, ll> pplll;
typedef pair<pli, int> pplii;
ty... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, int> pii;
typedef pair<ll, ld> pld;
typedef pair<pii, int> ppiii;
typedef pair<pii, ll> ppiil;
typedef pair<pll, ll> pplll;
typedef pair<pli, int> pplii;
ty... | replace | 120 | 121 | 120 | 121 | -11 | |
p02648 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
// type alias
typedef long long LL;
typedef pair<int, int> II;
typedef tuple<int, int, int> III;
typedef vector<int> VI;
typedef vector<string> VS;
typedef unordered_map<int, int> MAPII;
typedef unordered_set<int> SETI;
template <class T> using VV = vector<vector<T>>;
// mi... | #include <bits/stdc++.h>
using namespace std;
// type alias
typedef long long LL;
typedef pair<int, int> II;
typedef tuple<int, int, int> III;
typedef vector<int> VI;
typedef vector<string> VS;
typedef unordered_map<int, int> MAPII;
typedef unordered_set<int> SETI;
template <class T> using VV = vector<vector<T>>;
// mi... | replace | 118 | 120 | 118 | 120 | TLE | |
p02648 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <vector>
using namespace std;
int n, q;
int v[(1 << 18) + 1], w[(1 << 18) + 1];
int dp[550][100001];
int inf = -1;
int vq, wq;
int dfs(int i, int weight) {
// cout << i << " " << weight << " " << d... | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <vector>
using namespace std;
int n, q;
int v[(1 << 18) + 1], w[(1 << 18) + 1];
int dp[550][100001];
int inf = -1;
int vq, wq;
int dfs(int i, int weight) {
// cout << i << " " << weight << " " << d... | insert | 46 | 46 | 46 | 52 | TLE | |
p02648 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> Prepare(const vector<pair<int, int>> &a, int bound) {
const int n = static_cast<int>(a.size());
vector<pair<int, int>> result;
for (int i = 0; i < (1 << n); ++i) {
int x = 0, y = 0;
for (int j = 0; j < n; ++j) {
if (~i & (1 << j))... | #include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> Prepare(const vector<pair<int, int>> &a, int bound) {
const int n = static_cast<int>(a.size());
vector<pair<int, int>> result;
for (int i = 0; i < (1 << n); ++i) {
int x = 0, y = 0;
for (int j = 0; j < n; ++j) {
if (~i & (1 << j))... | replace | 45 | 46 | 45 | 46 | 0 | |
p02648 | C++ | Runtime Error | // #pragma GCC optimize("Ofast")
// #pragma GCC optimize ("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma warning(disable : 4786)
#pragma warning(disable : 4996)
#include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
#include <cmath>
#includ... | // #pragma GCC optimize("Ofast")
// #pragma GCC optimize ("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma warning(disable : 4786)
#pragma warning(disable : 4996)
#include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
#include <cmath>
#includ... | insert | 116 | 116 | 116 | 118 | 0 | Time = 0.000112
|
p02648 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
#define rer(i, a, b) for (int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), ... | #include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
#define rer(i, a, b) for (int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), ... | replace | 73 | 74 | 73 | 74 | TLE | |
p02648 | C++ | Time Limit Exceeded | // -----------------------------------
// author : MatsuTaku
// country : Japan
// created : 06/13/20 21:03:09
// -----------------------------------
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n;
cin >> n;
struct ... | // -----------------------------------
// author : MatsuTaku
// country : Japan
// created : 06/13/20 21:03:09
// -----------------------------------
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n;
cin >> n;
struct ... | replace | 26 | 27 | 26 | 27 | TLE | |
p02648 | C++ | Time Limit Exceeded | #pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
const int P = 1 << 2;
const int INF = 1 << 22;
int main() {
int N;
cin >> N;
vector<int> V(N), W(N);
for (int i = 0; i < N; i++) {
cin >> V[i] >> W[i];
}
in... | #pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
const int P = 1 << 11;
const int INF = 1 << 22;
int main() {
int N;
cin >> N;
vector<int> V(N), W(N);
for (int i = 0; i < N; i++) {
cin >> V[i] >> W[i];
}
i... | replace | 5 | 6 | 5 | 6 | TLE | |
p02648 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
#define mod 1000000007
#define dom 998244353
#define all(c) begin(c), end(c)
#define rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
template <typename T> bool chmax(T &a, const T &b) {
... | #include "bits/stdc++.h"
using namespace std;
#define mod 1000000007
#define dom 998244353
#define all(c) begin(c), end(c)
#define rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
template <typename T> bool chmax(T &a, const T &b) {
... | replace | 32 | 34 | 32 | 34 | TLE | |
p02648 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
#define MOD 1000000007
#define f(i, n) for (int i = 0; i < (int)(n); i++)
#define N 200010
vector<pai... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
#define MOD 1000000007
#define f(i, n) for (int i = 0; i < (int)(n); i++)
#define N 800010
vector<pai... | replace | 14 | 15 | 14 | 15 | 0 | |
p02648 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mt make_tuple
#define MOD 1000000007
#define fo(i, a, b) for (i = a; i < b; i++)
#define foe(i, a, b) for (i = a; i <= b; i++)
#define all(x... | #include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mt make_tuple
#define MOD 1000000007
#define fo(i, a, b) for (i = a; i < b; i++)
#define foe(i, a, b) for (i = a; i <= b; i++)
#define all(x... | replace | 27 | 28 | 27 | 28 | 0 | |
p02648 | C++ | Runtime Error | #pragma region template 2.4
#include <bits/stdc++.h>
using namespace std;
template <typename T> using pq_asc = priority_queue<T, vector<T>, greater<T>>;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
#define REP(i, n) for ... | #pragma region template 2.4
#include <bits/stdc++.h>
using namespace std;
template <typename T> using pq_asc = priority_queue<T, vector<T>, greater<T>>;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
#define REP(i, n) for ... | replace | 83 | 84 | 83 | 84 | 0 | |
p02648 | C++ | Runtime Error | #pragma GCC optimize("Ofast")
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <complex> // complex
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include... | #pragma GCC optimize("Ofast")
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <complex> // complex
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include... | replace | 62 | 63 | 62 | 63 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p02648 | C++ | Runtime Error | #include <stdio.h>
int n, q;
long long p = 10000000;
long long v[1024 * 256 + 1];
long long w[1024 * 256 + 1];
long long u[100000];
long long l[100000];
int s[1024];
int ss, uu;
long long e[256];
long long ee[128 + 1];
long long ef[128 + 1];
long long d[1024][1024];
long long te, ans;
int ar, br;
int main() {
scanf("... | #include <stdio.h>
int n, q;
long long p = 10000000;
long long v[1024 * 256 + 1];
long long w[1024 * 256 + 1];
long long u[100000];
long long l[100000];
int s[1024];
int ss, uu;
long long e[512 + 1];
long long ee[128 + 1];
long long ef[128 + 1];
long long d[1024][1024];
long long te, ans;
int ar, br;
int main() {
sca... | replace | 9 | 10 | 9 | 10 | 0 | |
p02648 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef unsigned long long int lu;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef set<ll> sl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> ii;
typedef pair<ll, ll> il;
#de... | #include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef unsigned long long int lu;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef set<ll> sl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> ii;
typedef pair<ll, ll> il;
#de... | replace | 292 | 293 | 292 | 293 | TLE | |
p02648 | C++ | Time Limit Exceeded | #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 <stack>
#include <string>
#include <unordered_map>
#include <vector>
#define MOD 1000000007
#... | #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 <stack>
#include <string>
#include <unordered_map>
#include <vector>
#define MOD 1000000007
#... | replace | 108 | 109 | 108 | 109 | TLE | |
p02648 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, x, y) for (ll i = (x); i < (y); i++)
#define rrep(i, x, y) for (ll i = (ll)(y)-1; i >= (x); i--)
#define all(x) (x).begin(), (x).end()
#ifdef LOCAL
#define debug(x) \
cerr << #x << " = " << (x) ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, x, y) for (ll i = (x); i < (y); i++)
#define rrep(i, x, y) for (ll i = (ll)(y)-1; i >= (x); i--)
#define all(x) (x).begin(), (x).end()
#ifdef LOCAL
#define debug(x) \
cerr << #x << " = " << (x) ... | replace | 30 | 31 | 30 | 31 | TLE | |
p02648 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i < i##_len; i++)
#define FORD(i, a, b) for (int i = (a), i##_len = (b); i > i##_len; i--)
#define ALL(x) (x).begin(), (x).end() //... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i < i##_len; i++)
#define FORD(i, a, b) for (int i = (a), i##_len = (b); i > i##_len; i--)
#define ALL(x) (x).begin(), (x).end() //... | replace | 27 | 28 | 27 | 28 | TLE | |
p02649 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
template <typename T> void out(T x) {
cout << x << endl;
exit(0);
}
#define watch(x) cout << (#x) << " is " << (x) << endl
using ll = long long;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 5;
int n, k, S, T;
// S: AND
// T: OR
bool compat(int x) {
if ((x | T) ... | #include <bits/stdc++.h>
using namespace std;
template <typename T> void out(T x) {
cout << x << endl;
exit(0);
}
#define watch(x) cout << (#x) << " is " << (x) << endl
using ll = long long;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 5;
int n, k, S, T;
// S: AND
// T: OR
bool compat(int x) {
if ((x | T) ... | replace | 55 | 63 | 55 | 59 | TLE | |
p02649 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define PI 3.14159265359
using namespace std;
using ll = long long;
using P = pair<int, int>;
int cnt[1000000], cntid[50];
ll c[50][50], cc[50][50];
int main() {
int n, k, s, t;
cin >> n >> k >> s >> t;
rep(i, 1000000) { ... | #include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define PI 3.14159265359
using namespace std;
using ll = long long;
using P = pair<int, int>;
int cnt[1000000], cntid[50];
ll c[51][51], cc[51][51];
int main() {
int n, k, s, t;
cin >> n >> k >> s >> t;
rep(i, 1000000) { ... | replace | 9 | 10 | 9 | 10 | 0 | |
p02649 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
const int M = 1000000007;
int main() {
cin.tie(0);
ios::sync_with_stdio(0);
int n, k, s, t;
cin >> n >> k >> s >> t;
if ((s | t) != t) {
cout << 0 << '\n';
return 0;
}
vector<int> a;
for (int i = 0; i < n; ++i) {
int aa... | #include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
const int M = 1000000007;
int main() {
cin.tie(0);
ios::sync_with_stdio(0);
int n, k, s, t;
cin >> n >> k >> s >> t;
if ((s | t) != t) {
cout << 0 << '\n';
return 0;
}
vector<int> a;
for (int i = 0; i < n; ++i) {
int aa... | insert | 34 | 34 | 34 | 37 | TLE | |
p02649 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
// not a multiset
// find_by_order(k) -> itr of k-th(0-based) element
// order_of_key(k) -> index of lower_bound(k)
using ordered_set = tree<int, null_type, less<int>,... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
// not a multiset
// find_by_order(k) -> itr of k-th(0-based) element
// order_of_key(k) -> index of lower_bound(k)
using ordered_set = tree<int, null_type, less<int>,... | replace | 249 | 276 | 249 | 269 | TLE | |
p02649 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
#define rer(i, a, b) for (int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), ... | #include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
#define rer(i, a, b) for (int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), ... | replace | 73 | 74 | 73 | 74 | 0 | Time: 0.024163 s.
|
p02649 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define REP(i, n) for (ll i = 0; i < n; i++)
#define MP make_pair
#define F first
#define S second
typedef long long ll;
using namespace std;
int main() {
ll n, k, s, t, a[50];
cin >> n >> k >> s >> t;
REP(i, n) cin >> a[i];
vector<map<pair<ll, ll>, ll>> dp(k);
REP(i, n) {
for (ll... | #include <bits/stdc++.h>
#define REP(i, n) for (ll i = 0; i < n; i++)
#define MP make_pair
#define F first
#define S second
typedef long long ll;
using namespace std;
int main() {
ll n, k, s, t, a[50];
cin >> n >> k >> s >> t;
REP(i, n) cin >> a[i];
map<pair<ll, ll>, ll> dp[50];
REP(i, n) {
for (ll j = k ... | replace | 11 | 12 | 11 | 12 | TLE | |
p02649 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 55;
int a[N], n;
ll c[N][N], sc[N][N];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, k, s, t;
cin >> n >> k >> s >> t;
for (int i = 0; i < 18; i++)
if ((s & (1 << i)) == 1 && (t & (1 << i)) == 0) {
cou... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 55;
int a[N], n;
ll c[N][N], sc[N][N];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, k, s, t;
cin >> n >> k >> s >> t;
for (int i = 0; i < 18; i++)
if ((s & (1 << i)) == 1 && (t & (1 << i)) == 0) {
cou... | replace | 54 | 55 | 54 | 55 | 0 | |
p02649 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using i64 = int64_t;
template <class T> using Vec = std::vector<T>;
template <class K, class V> using UM = std::unordered_map<K, V>;
using namespace std;
namespace std {
template <> struct hash<pair<int, int>> {
size_t operator()(pair<int, int> p) const noexcept {
return (size_t(p.firs... | #include <bits/stdc++.h>
using i64 = int64_t;
template <class T> using Vec = std::vector<T>;
template <class K, class V> using UM = std::unordered_map<K, V>;
using namespace std;
namespace std {
template <> struct hash<pair<int, int>> {
size_t operator()(pair<int, int> p) const noexcept {
return (size_t(p.firs... | replace | 41 | 42 | 41 | 42 | TLE | |
p02649 | C++ | Time Limit Exceeded | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define E "\n"
using namespace std;
const long long MOD = (long long)1e9 + 7;
int n, k, s, t, a[55], sz, al;
long long ans, candi[2][18], combi[60][60], F[60][60];
vector<int> vec;
int cnt_bit(int x) {
... | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define E "\n"
using namespace std;
const long long MOD = (long long)1e9 + 7;
int n, k, s, t, a[55], sz, al;
long long ans, candi[2][18], combi[60][60], F[60][60];
vector<int> vec;
int cnt_bit(long long x... | replace | 14 | 15 | 14 | 15 | TLE | |
p02649 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K, S, T;
cin >> N >> K >> S >> T;
vector<map<pair<int, int>, long long>> dp(K + 1);
dp[0][{(1 << 18) - 1, 0}] = 1;
for (int i = 0; i < N; ++i) {
int a;
cin >> a;
for (int k = K - 1; k >= 0; --k) {
for (auto &p : dp[k]) {
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K, S, T;
cin >> N >> K >> S >> T;
vector<map<pair<int, int>, long long>> dp(K + 1);
dp[0][{(1 << 18) - 1, 0}] = 1;
for (int i = 0; i < N; ++i) {
int a;
cin >> a;
if ((a & S) != S)
continue;
if ((a | T) != T)
cont... | insert | 14 | 14 | 14 | 18 | TLE | |
p02650 | C++ | Time Limit Exceeded | #pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define SZ(x) ((int)((x).size()))
template <typename T1, ty... | #pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define SZ(x) ((int)((x).size()))
template <typename T1, ty... | replace | 120 | 121 | 120 | 122 | TLE | |
p02650 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x, to) for (x = 0; x < (to); x++)
#define FORR(x, arr) for (auto &x : arr)
#define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++)
#define ALL(a) (a.begin()), ... | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x, to) for (x = 0; x < (to); x++)
#define FORR(x, arr) for (auto &x : arr)
#define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++)
#define ALL(a) (a.begin()), ... | replace | 31 | 35 | 31 | 35 | TLE | |
p02650 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define MOD 1000000007
#define MOD2 998244353
#define PRIM 3
#define INF (1 << 29)
#d... | #include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define MOD 1000000007
#define MOD2 998244353
#define PRIM 3
#define INF (1 << 29)
#d... | replace | 48 | 49 | 48 | 51 | TLE | |
p02650 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define long long long int
using namespace std;
// @author: pashka
int gcd(int a, int b) {
while (b > 0) {
int c = a % b;
a = b;
b = c;
}
return a;
}
map<pair<int, int>, int> mem;
int get(int x, int y) {
x = abs(x);
y = abs(y);
return gcd(x, y);
// typedef typen... | #include <bits/stdc++.h>
#define long long long int
using namespace std;
// @author: pashka
int gcd(int a, int b) {
while (b > 0) {
int c = a % b;
a = b;
b = c;
}
return a;
}
map<pair<int, int>, int> mem;
int get(int x, int y) {
x = abs(x);
y = abs(y);
return gcd(x, y);
// typedef typen... | replace | 37 | 40 | 37 | 44 | TLE | |
p02651 | Python | Runtime Error | def solve(n, a_list, s):
for i in range(n - 1, -1, -1):
if s[i] == "0":
r = 2 ** (a_list[i].bit_length() - 1)
for j in range(i):
if a_list[j] & r > 0:
a_list[j] = a_list[i] ^ a_list[j]
else:
if a_list[i] > 0:
ret... | def solve(n, a_list, s):
for i in range(n - 1, -1, -1):
if s[i] == "0":
if a_list[i] == 0:
continue
r = 2 ** (a_list[i].bit_length() - 1)
for j in range(i):
if a_list[j] & r > 0:
a_list[j] = a_list[i] ^ a_list[j]
... | insert | 3 | 3 | 3 | 5 | 0 | |
p02651 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define N 120
const LL k = 60;
LL n, a[N], f[80];
char s[N];
void ins(LL x) {
for (LL i = k; ~i; --i) {
if (x >> i & 1) {
if (!f[i]) {
f[i] = x;
return;
} else
x ^= f[i];
}
}
}
bool pd(LL x) {
for ... | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define N 300
const LL k = 60;
LL n, a[N], f[80];
char s[N];
void ins(LL x) {
for (LL i = k; ~i; --i) {
if (x >> i & 1) {
if (!f[i]) {
f[i] = x;
return;
} else
x ^= f[i];
}
}
}
bool pd(LL x) {
for ... | replace | 5 | 6 | 5 | 6 | 0 | |
p02651 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
template <typename T> inline T read() {
T x = 0, f = 0;
char c = getchar();
while (!isdigit(c))
f = c == '-', c = getchar();
while (isdigit(c))
x = x * 10 + c - 48, c = getchar();
return f ? -x : x;
}
#define int long long
namespace run {
const int N = 109... | #include <bits/stdc++.h>
using namespace std;
template <typename T> inline T read() {
T x = 0, f = 0;
char c = getchar();
while (!isdigit(c))
f = c == '-', c = getchar();
while (isdigit(c))
x = x * 10 + c - 48, c = getchar();
return f ? -x : x;
}
#define int long long
namespace run {
const int N = 209... | replace | 13 | 14 | 13 | 14 | 0 | |
p02651 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 110, M = 64;
ll a[N];
int n;
char s[N];
ll b[N];
ll insert(ll x) {
for (int i = 60; ~i; i--)
if (1 & (x >> i)) {
if (!b[i]) {
b[i] = x;
break;
} else
x ^= b[i];
}
return x;
}
void Main()... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1010, M = 64;
ll a[N];
int n;
char s[N];
ll b[N];
ll insert(ll x) {
for (int i = 60; ~i; i--)
if (1 & (x >> i)) {
if (!b[i]) {
b[i] = x;
break;
} else
x ^= b[i];
}
return x;
}
void Main(... | replace | 3 | 4 | 3 | 4 | 0 | |
p02651 | 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++)
// Bit Matrix
const int MAX_ROW = 110; // to be set appropriately
const int MAX_COL = 210; // to be set appropriately
struct BitMatrix {
int ... | #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++)
// Bit Matrix
const int MAX_ROW = 210; // to be set appropriately
const int MAX_COL = 110; // to be set appropriately
struct BitMatrix {
int ... | replace | 7 | 9 | 7 | 9 | 0 | |
p02651 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const int MAXN = 71, B = 61;
int t, n, flg;
ll x, k, a[MAXN], b[MAXN];
char s[MAXN];
bool ins(ll x) {
for (int i = B; i >= 0; i--) {
if ((x & (1ll << i))) {
if (b[i]) {
x ^= b[i];
} else {
b[i] = x;
break;
... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const int MAXN = 271, B = 61;
int t, n, flg;
ll x, k, a[MAXN], b[MAXN];
char s[MAXN];
bool ins(ll x) {
for (int i = B; i >= 0; i--) {
if ((x & (1ll << i))) {
if (b[i]) {
x ^= b[i];
} else {
b[i] = x;
break;
... | replace | 3 | 4 | 3 | 4 | 0 | |
p02651 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <cassert>
typedef long long int ll;
using namespace std;
// @@ !! LIM(ftwo matrix debug)
// --> ftwo f:power matrix f:<< debug
// ---- inserted library file ftwo.cc
struct Ftwo {
int8_t val;
Ftwo(ll t = 0) { val = (t == 0) ? 0 : 1; }
Ftwo(const Ftwo &t) : val(t.val) {}
Ftwo ... | #include <bits/stdc++.h>
#include <cassert>
typedef long long int ll;
using namespace std;
// @@ !! LIM(ftwo matrix debug)
// --> ftwo f:power matrix f:<< debug
// ---- inserted library file ftwo.cc
struct Ftwo {
int8_t val;
Ftwo(ll t = 0) { val = (t == 0) ? 0 : 1; }
Ftwo(const Ftwo &t) : val(t.val) {}
Ftwo ... | replace | 636 | 637 | 636 | 637 | 0 | |
p02651 | C++ | Runtime Error | // A.
#include <algorithm>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <vector>
using namespace std;
typedef long long LL;
bool possible(LL t, vector<LL> a) {
LL x = 0;
int st = 0;
int sz = (int)a.size();
sort(a.rbegin(), a.rend());
for... | // A.
#include <algorithm>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <vector>
using namespace std;
typedef long long LL;
bool possible(LL t, vector<LL> a) {
if (a.empty())
return t == 0;
LL x = 0;
int st = 0;
int sz = (int)a.size();... | insert | 16 | 16 | 16 | 18 | 0 | |
p02651 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
// type alias
typedef long long LL;
typedef pair<int, int> II;
typedef tuple<int, int, int> III;
typedef vector<int> VI;
typedef vector<string> VS;
typedef unordered_map<int, int> MAPII;
typedef unordered_set<int> SETI;
template <class T> using VV = vector<vector<T>>;
// mi... | #include <bits/stdc++.h>
using namespace std;
// type alias
typedef long long LL;
typedef pair<int, int> II;
typedef tuple<int, int, int> III;
typedef vector<int> VI;
typedef vector<string> VS;
typedef unordered_map<int, int> MAPII;
typedef unordered_set<int> SETI;
template <class T> using VV = vector<vector<T>>;
// mi... | replace | 125 | 126 | 125 | 126 | TLE | |
p02651 | C++ | Runtime Error | // 終局から考える。
// S[i] = '1'なるiについて、A[i]が{A[j], i+1≦j≦N-1, S[j] = '0'}と独立ならx≠0.
// 全て従属とする。iが大きい方から考えると、最終的にx=0(従属)にできる。
// 独立性の判定:
// ・各数を2進数ベクトルと考えて {A[j], i+1≦j≦N-1, S[j] =
// '0'}について掃き出し法をおこない、
// 表現できるベクトル集合が同一のより単純な表現に直す
// ・その表現では'1'の立つ最上位ビットの場所がdistinctだから、A[i]を作れるかを貪欲に判定できる
// 計算量はO(TN^3). 厳しい? -> 定数倍が軽いので大丈夫そ... | // 終局から考える。
// S[i] = '1'なるiについて、A[i]が{A[j], i+1≦j≦N-1, S[j] = '0'}と独立ならx≠0.
// 全て従属とする。iが大きい方から考えると、最終的にx=0(従属)にできる。
// 独立性の判定:
// ・各数を2進数ベクトルと考えて {A[j], i+1≦j≦N-1, S[j] =
// '0'}について掃き出し法をおこない、
// 表現できるベクトル集合が同一のより単純な表現に直す
// ・その表現では'1'の立つ最上位ビットの場所がdistinctだから、A[i]を作れるかを貪欲に判定できる
// 計算量はO(TN^3). 厳しい? -> 定数倍が軽いので大丈夫そ... | replace | 41 | 42 | 41 | 42 | 0 | |
p02651 | C++ | Runtime Error | #include <cstdio>
#include <iostream>
#include <math.h>
#include <string>
using namespace std;
void reduce(int arr[64][64], int lead[64], int *d) {
for (int i = 0; i < *d - 1; i++) {
if (arr[*d - 1][lead[i]] == 1) {
for (int k = lead[i]; k < 64; k++) {
arr[*d - 1][k] = arr[*d - 1][k] ^ arr[i][k];
... | #include <cstdio>
#include <iostream>
#include <math.h>
#include <string>
using namespace std;
void reduce(int arr[64][64], int lead[64], int *d) {
for (int i = 0; i < *d - 1; i++) {
if (arr[*d - 1][lead[i]] == 1) {
for (int k = lead[i]; k < 64; k++) {
arr[*d - 1][k] = arr[*d - 1][k] ^ arr[i][k];
... | replace | 57 | 58 | 57 | 59 | 0 | |
p02651 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <stdlib.h>
#include <sys/time.h>
#include <unistd.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<P, ll> T;
typedef pair<long double, ll> Ps;
const ll INF = 2e18;
const ll fact_table = 3200008;
long double Pi = 3.1415926535897932384626;
priority_q... | #include <bits/stdc++.h>
#include <stdlib.h>
#include <sys/time.h>
#include <unistd.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<P, ll> T;
typedef pair<long double, ll> Ps;
const ll INF = 2e18;
const ll fact_table = 3200008;
long double Pi = 3.1415926535897932384626;
priority_q... | replace | 104 | 106 | 104 | 106 | TLE | |
p02652 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#define X first
#define Y second
#define PB push_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int N = 1e6 + 500;
const int INF = 0x3f3f3f3f;... | #include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#define X first
#define Y second
#define PB push_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int N = 1e6 + 500;
const int INF = 0x3f3f3f3f;... | replace | 56 | 81 | 56 | 60 | TLE | |
p02652 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
#define FAST \
ios_base::sync_with_stdio(false); \
cin.tie(0);
#define pb push_back
#define eb emplace_back
#define ins insert
#define f first
#define s second
... | #include "bits/stdc++.h"
using namespace std;
#define FAST \
ios_base::sync_with_stdio(false); \
cin.tie(0);
#define pb push_back
#define eb emplace_back
#define ins insert
#define f first
#define s second
... | replace | 42 | 43 | 42 | 43 | 0 | |
p02652 | C++ | Runtime Error | #include <algorithm>
#include <cstdlib>
#include <iostream>
template <typename T> void fin(T const &t) {
std::cout << t << std::endl;
exit(0);
}
char buf[100010];
int main() {
std::cin.tie(0);
std::ios::sync_with_stdio(false);
std::cin >> buf;
int a0 = 0, a1 = 1, b0 = 0, b1 = -1;
int c0 = a0 - b0, c1 = a0... | #include <algorithm>
#include <cstdlib>
#include <iostream>
template <typename T> void fin(T const &t) {
std::cout << t << std::endl;
exit(0);
}
char buf[1000010];
int main() {
std::cin.tie(0);
std::ios::sync_with_stdio(false);
std::cin >> buf;
int a0 = 0, a1 = 1, b0 = 0, b1 = -1;
int c0 = a0 - b0, c1 = a... | replace | 7 | 8 | 7 | 8 | 0 | |
p02652 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
#define N 100010
inline int read() {
int x = 0, f = 1;
char c = getchar();
while (c < '0' || c > '9') {
if (c == '-')
f = -1;
c = getchar();
}
while (c >= '0' && c <= '9') {
x = (x << 1) + (x << 3) + c - '0';
c... | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
#define N 1000010
inline int read() {
int x = 0, f = 1;
char c = getchar();
while (c < '0' || c > '9') {
if (c == '-')
f = -1;
c = getchar();
}
while (c >= '0' && c <= '9') {
x = (x << 1) + (x << 3) + c - '0';
... | replace | 4 | 5 | 4 | 5 | 0 | |
p02652 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define llint long ... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define llint long ... | replace | 106 | 107 | 106 | 108 | 0 | |
p02652 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int n;
char s[N];
int sum[N], pmx[N], pmi[N];
int main() {
scanf("%s", s + 1);
n = strlen(s + 1);
sum[0] = 0;
pmx[0] = 0;
pmi[0] = 0;
for (int i = 1; i <= n; i++) {
sum[i] = sum[i - 1] + 1 - 2 * (s[i] == '0');
pmx[i] = max(pmx[i... | #include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int n;
char s[N];
int sum[N], pmx[N], pmi[N];
int main() {
scanf("%s", s + 1);
n = strlen(s + 1);
sum[0] = 0;
pmx[0] = 0;
pmi[0] = 0;
for (int i = 1; i <= n; i++) {
sum[i] = sum[i - 1] + 1 - 2 * (s[i] == '0');
pmx[i] = max(pmx[i... | delete | 52 | 53 | 52 | 52 | 0 | |
p02652 | C++ | Runtime Error | #include "algorithm"
#include "cmath"
#include "cstdio"
#include "cstring"
#include "iostream"
#include "map"
#include "queue"
#include "set"
#include "vector"
using namespace std;
#define MAXN 1000006
// #define int long long
#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) f... | #include "algorithm"
#include "cmath"
#include "cstdio"
#include "cstring"
#include "iostream"
#include "map"
#include "queue"
#include "set"
#include "vector"
using namespace std;
#define MAXN 1000006
// #define int long long
#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) f... | replace | 40 | 41 | 40 | 41 | 0 | |
p02653 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
int dp0[5005][5005], dp1[5005][5005], dp2[5005][5005], sum1[5005][5005];
int main() {
int n, a, b;
scanf("%d%d%d", &n, &a, &b);
if (a > b)
swap(a, b);
dp1[0][0] = 1;
for (int j = 0; j <= n; j++)
sum1[0][j] = 1... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
int dp0[5005][5005], dp1[5005][5005], dp2[5005][5005], sum1[5005][5005];
int main() {
int n, a, b;
scanf("%d%d%d", &n, &a, &b);
if (a > b)
swap(a, b);
dp1[0][0] = 1;
for (int j = 0; j <= n; j++)
sum1[0][j] = 1... | replace | 15 | 18 | 15 | 20 | -11 | |
p02653 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int maxn = 5010, P = 1000000007;
int n, A, B, ans, pw[maxn], f[maxn][maxn][2], pre[maxn][maxn][2], h[maxn];
int main() {
scanf("%d %d %d", &n, &A, &B);
if (A < B)
swap(A, B);
pw[0] = pw[1] = 1;
for (int i = 2; i <= n; i++) {
pw[i] = (pw[i - 1] + pw[i... | #include <bits/stdc++.h>
using namespace std;
const int maxn = 5010, P = 1000000007;
int n, A, B, ans, pw[maxn], f[maxn][maxn][2], pre[maxn][maxn][2], h[maxn];
int main() {
scanf("%d %d %d", &n, &A, &B);
if (A < B)
swap(A, B);
pw[0] = pw[1] = 1;
for (int i = 2; i <= n; i++) {
pw[i] = (pw[i - 1] + pw[i... | replace | 19 | 20 | 19 | 21 | -11 | |
p02653 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
typedef long long ll;
typedef long double ld;
const int N = 5000 + 7;
const int M = (int)1e9 + 7;
int streak[N][2][2], dp_streak[N], dp_0[N];
int add(int a, int b) {
a += b;
if (a >= M)
... | #include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
typedef long long ll;
typedef long double ld;
const int N = 5000 + 7;
const int M = (int)1e9 + 7;
int streak[N][2][2], dp_streak[N], dp_0[N];
int add(int a, int b) {
a += b;
if (a >= M)
... | replace | 91 | 92 | 91 | 92 | 0 | |
p02653 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rng(i, l, r) for (int i = int(l); i < int(r); i++)
#define rep(i, r) for (int i = 0; i < int(r); i++)
#define rrng(i, l, r) for (int i = int(r) - 1; i >= int(l); i--)
#define rrep(i, r) for (int i = int(r) - 1; i >= 0; i--)
#define pb push_bac... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rng(i, l, r) for (int i = int(l); i < int(r); i++)
#define rep(i, r) for (int i = 0; i < int(r); i++)
#define rrng(i, l, r) for (int i = int(r) - 1; i >= int(l); i--)
#define rrep(i, r) for (int i = int(r) - 1; i >= 0; i--)
#define pb push_bac... | replace | 305 | 306 | 305 | 306 | TLE | |
p02653 | C++ | Runtime Error | /* by Natsu Kinmoe */
#include <bits/stdc++.h>
using namespace std;
#define loop(i, n) for (int i = 0; i < (n); i++)
#define pool(i, n) for (int i = (n)-1; i >= 0; i--)
#define cont(i, n) for (int i = 1; i <= (n); i++)
#define tnoc(i, n) for (int i = (n); i >= 1; i--)
#define circ(i, a, b) for (int i = (a); i <= (b); ... | /* by Natsu Kinmoe */
#include <bits/stdc++.h>
using namespace std;
#define loop(i, n) for (int i = 0; i < (n); i++)
#define pool(i, n) for (int i = (n)-1; i >= 0; i--)
#define cont(i, n) for (int i = 1; i <= (n); i++)
#define tnoc(i, n) for (int i = (n); i >= 1; i--)
#define circ(i, a, b) for (int i = (a); i <= (b); ... | replace | 84 | 89 | 84 | 91 | -11 | |
p02653 | C++ | Runtime Error | /**
* author: otera
**/
#include <algorithm>
#include <bitset>
#include <cassert>
#include <ciso646>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <se... | /**
* author: otera
**/
#include <algorithm>
#include <bitset>
#include <cassert>
#include <ciso646>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <se... | replace | 159 | 160 | 159 | 160 | -11 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.