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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p01426 | C++ | Memory Limit Exceeded | #include "bits/stdc++.h"
#include <unordered_map>
#include <unordered_set>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;
// < "d:\d_download\visual studio
// 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual
// studio 2015\projects\programing_... | #include "bits/stdc++.h"
#include <unordered_map>
#include <unordered_set>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;
// < "d:\d_download\visual studio
// 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual
// studio 2015\projects\programing_... | replace | 11 | 12 | 11 | 12 | MLE | |
p01426 | C++ | Memory Limit Exceeded | #include "bits/stdc++.h"
#include <unordered_map>
#include <unordered_set>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
template <class T> using Table = vector<vector<T>>;
const ld eps = 1e-9;
//// < "D:\D_Download\Visual Studio
///2015\Projects\programing_contest_c++\Debug\a.txt" > "D:... | #include "bits/stdc++.h"
#include <unordered_map>
#include <unordered_set>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
template <class T> using Table = vector<vector<T>>;
const ld eps = 1e-9;
//// < "D:\D_Download\Visual Studio
///2015\Projects\programing_contest_c++\Debug\a.txt" > "D:... | replace | 13 | 14 | 13 | 14 | MLE | |
p01428 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
#define REP(i, n) for (ll i = 0; i < n; ++i)
#define RREP(i, n) for (ll i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (ll i = m; i < n; ++i)
#define RFOR(i, m, n) for (ll i = n - 1; i >= m; --i)
#define ALL(v) (v).begin(), (v).end()
#define PB(a) push_back(a)
#define UNIQUE(v) v.erase(uniqu... | #include "bits/stdc++.h"
#define REP(i, n) for (ll i = 0; i < n; ++i)
#define RREP(i, n) for (ll i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (ll i = m; i < n; ++i)
#define RFOR(i, m, n) for (ll i = n - 1; i >= m; --i)
#define ALL(v) (v).begin(), (v).end()
#define PB(a) push_back(a)
#define UNIQUE(v) v.erase(uniqu... | replace | 43 | 48 | 43 | 44 | TLE | |
p01429 | C++ | Runtime Error | #include <algorithm>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
constexpr int MAX = 1011;
int N, M, L;
ll memo[MAX][MAX];
vector<ll> K, sum;
ll calc(int l, int r) { return (sum[K[r] + 1] - sum[K[l]]) / L; }
ll solve(int l, int r) {
ll &res = memo[l][r];
... | #include <algorithm>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
constexpr int MAX = 2010;
int N, M, L;
ll memo[MAX][MAX];
vector<ll> K, sum;
ll calc(int l, int r) { return (sum[K[r] + 1] - sum[K[l]]) / L; }
ll solve(int l, int r) {
ll &res = memo[l][r];
... | replace | 8 | 9 | 8 | 9 | 0 | |
p01430 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = (int)(s); i < (int)(t); ++i)
#define each(a, b) for (auto(a) : (b... | #include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = (int)(s); i < (int)(t); ++i)
#define each(a, b) for (auto &(a) : ... | replace | 8 | 9 | 8 | 9 | TLE | |
p01431 | C++ | Memory Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define all(c) c.begin(), c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x, y) x = min(x, y)
#define chmax(... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define all(c) c.begin(), c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x, y) x = min(x, y)
#define chmax(... | replace | 19 | 20 | 19 | 20 | MLE | |
p01432 | C++ | Runtime Error | #include <algorithm>
#include <stdio.h>
#include <vector>
using namespace std;
const double EPS = 1e-8;
typedef vector<double> vec;
typedef vector<vec> mat;
inline double ABS(double a) { return max(a, -a); }
vec gauss_jordan(const mat &A, const vec &b) {
int n = A.size();
mat B(n, vec(n + 1));
for (int i = 0; i <... | #include <algorithm>
#include <stdio.h>
#include <vector>
using namespace std;
const double EPS = 1e-8;
typedef vector<double> vec;
typedef vector<vec> mat;
inline double ABS(double a) { return max(a, -a); }
vec gauss_jordan(const mat &A, const vec &b) {
int n = A.size();
mat B(n, vec(n + 1));
for (int i = 0; i <... | insert | 50 | 50 | 50 | 51 | 0 | |
p01432 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) a.begin(), a.end()
#define MS(m, v) memset(m, v, sizeof(m))
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef ... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) a.begin(), a.end()
#define MS(m, v) memset(m, v, sizeof(m))
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef ... | insert | 172 | 172 | 172 | 176 | 0 | |
p01434 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define all(c) (c).begin(), (c).end()
#define mp make_pair
#define ... | #include <algorithm>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define all(c) (c).begin(), (c).end()
#define mp make_pair
#define ... | replace | 28 | 29 | 28 | 29 | 0 | |
p01434 | C++ | Runtime Error | #include <bits/stdc++.h>
#define N 10005
using namespace std;
long long n, m, s[N], t[N], p[N], d[N], ans;
int bynary_search(int x) {
int l = 0, r = m;
while (l < r) {
int mid = (l + r) / 2;
if (x <= p[mid])
r = mid;
else
l = mid + 1;
}
return l;
}
int main() {
cin >> n >> m;
for (... | #include <bits/stdc++.h>
#define N 100005
using namespace std;
long long n, m, s[N], t[N], p[N], d[N], ans;
int bynary_search(int x) {
int l = 0, r = m;
while (l < r) {
int mid = (l + r) / 2;
if (x <= p[mid])
r = mid;
else
l = mid + 1;
}
return l;
}
int main() {
cin >> n >> m;
for ... | replace | 1 | 2 | 1 | 2 | 0 | |
p01434 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int n, m;
int s[10010], t[10010];
int p[10010];
int a[10010];
int main() {
cin >> n >> m, m++;
for (int i = 0; i < n; i++) {
cin >> s[i] >> t[i];
}
for (int i = 1; i < m; i++) {
cin >> p[i];
}
sort(p, p + m);
long long res = 0;
for (int i = 0; i <... | #include <bits/stdc++.h>
using namespace std;
int n, m;
int s[100010], t[100010];
int p[100010];
int a[100010];
int main() {
cin >> n >> m, m++;
for (int i = 0; i < n; i++) {
cin >> s[i] >> t[i];
}
for (int i = 1; i < m; i++) {
cin >> p[i];
}
sort(p, p + m);
long long res = 0;
for (int i = 0;... | replace | 4 | 7 | 4 | 7 | 0 | |
p01435 | C++ | Runtime Error | #pragma GCC optimize("Ofast")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unordered_map>
#include <un... | #pragma GCC optimize("Ofast")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unordered_map>
#include <un... | replace | 235 | 236 | 235 | 236 | 0 | |
p01435 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;
#define EACH(i, a) for (auto &i : a)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define RFOR(i, a, b) for (ll i = (b)-1; i >= (a); i--)
#define REP(i, n) for (l... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;
#define EACH(i, a) for (auto &i : a)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define RFOR(i, a, b) for (ll i = (b)-1; i >= (a); i--)
#define REP(i, n) for (l... | replace | 83 | 84 | 83 | 84 | TLE | |
p01437 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <v... | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <v... | replace | 75 | 77 | 75 | 77 | TLE | |
p01437 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <st... | #include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <st... | replace | 89 | 91 | 89 | 94 | TLE | |
p01437 | C++ | Time Limit Exceeded | #include <algorithm>
#include <array>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
// BEGIN CUT HE... | #include <algorithm>
#include <array>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
// BEGIN CUT HE... | replace | 46 | 47 | 46 | 47 | TLE | |
p01437 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <st... | #include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <st... | replace | 58 | 59 | 58 | 60 | TLE | |
p01437 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
int todir[256];
char tochr[4];
int h, w;
long long l;
string c[110];
int vis[110][110][4];
int main() {
for (int i = 0; i < 4; i++) {
todir["NESW"[i]] = i;
tochr[i] = "NESW"[i];
}
while (cin ... | #include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
int todir[256];
char tochr[4];
int h, w;
long long l;
string c[110];
int vis[110][110][4];
int main() {
for (int i = 0; i < 4; i++) {
todir["NESW"[i]] = i;
tochr[i] = "NESW"[i];
}
while (cin ... | replace | 48 | 49 | 48 | 50 | TLE | |
p01437 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define ALL(c) c.begin(), c.end()
#define RALL(c) c.rbegin(), c.... | #include <algorithm>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define ALL(c) c.begin(), c.end()
#define RALL(c) c.rbegin(), c.... | replace | 110 | 114 | 110 | 112 | TLE | |
p01437 | C++ | Time Limit Exceeded | // 11
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
for (long long h, w, l; cin >> h >> w >> l, h | w | l;) {
bool s[102][102] = {};
int x, y, d;
string ds = "NESW";
for (int i = 1; i <= h; i++) {
for (int j = 1; j <= w; j++) {
char c;
cin >> c;
... | // 11
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
for (long long h, w, l; cin >> h >> w >> l, h | w | l;) {
bool s[102][102] = {};
int x, y, d;
string ds = "NESW";
for (int i = 1; i <= h; i++) {
for (int j = 1; j <= w; j++) {
char c;
cin >> c;
... | replace | 30 | 31 | 30 | 31 | TLE | |
p01438 | C++ | Memory Limit Exceeded | // #define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#def... | // #define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#def... | replace | 28 | 29 | 28 | 29 | MLE | |
p01438 | C++ | Runtime Error | // Header {{{
// includes {{{
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numer... | // Header {{{
// includes {{{
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numer... | replace | 288 | 289 | 288 | 289 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p01438 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long // <-----!!!!!!!!!!!!!!!!!!!
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define rrep2(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define al... | #include <bits/stdc++.h>
using namespace std;
#define int long long // <-----!!!!!!!!!!!!!!!!!!!
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define rrep2(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define al... | replace | 31 | 32 | 31 | 32 | -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)
|
p01438 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define loop(n, i) for (int i = 0; i < n; i++)
#define all(v) v.begin(), v.end()
#define HERE cout << "HERE: " << __LINE__ << endl;
#define INSP(v) cout << v << " at " << __LINE__ << endl;
using namespace std;
typedef long long ll;
ll dp[101][65536];
int main() {
while (1) {
fill(dp[0]... | #include <bits/stdc++.h>
#define loop(n, i) for (int i = 0; i < n; i++)
#define all(v) v.begin(), v.end()
#define HERE cout << "HERE: " << __LINE__ << endl;
#define INSP(v) cout << v << " at " << __LINE__ << endl;
using namespace std;
typedef long long ll;
ll dp[101][65536];
int main() {
while (1) {
fill(dp[0]... | insert | 17 | 17 | 17 | 19 | TLE | |
p01438 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
typedef pair<int, int> pii;
struct Guy {
int sc;
int L;
bool ok;
};
typedef long long ll;
int n;
Guy guys[101];
ll dp[2][1 << 17];
ll dfs(int pos, int s) {
if (pos == n)
return 0;
if (dp[pos][s] != -1)... | #include <algorithm>
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
typedef pair<int, int> pii;
struct Guy {
int sc;
int L;
bool ok;
};
typedef long long ll;
int n;
Guy guys[101];
ll dp[2][1 << 17];
ll dfs(int pos, int s) {
if (pos == n)
return 0;
if (dp[pos][s] != -1)... | replace | 78 | 85 | 78 | 85 | TLE | |
p01442 | C++ | Memory Limit Exceeded | #include "bits/stdc++.h"
#include <unordered_map>
#include <unordered_set>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
template <class T> using Table = vector<vector<T>>;
ld eps = 1e-9;
struct aa {
int x;
int y;
int n;
int w;
};
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] ... | #include "bits/stdc++.h"
#include <unordered_map>
#include <unordered_set>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
template <class T> using Table = vector<vector<T>>;
ld eps = 1e-9;
struct aa {
int x;
int y;
int n;
int w;
};
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] ... | replace | 76 | 78 | 76 | 84 | MLE | |
p01443 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int(i) = 0; (i) < (int)(n); ++(i))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout << #x " = " << ((x)) << endl
template <class T, class U>
ostream &operator<<(ost... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int(i) = 0; (i) < (int)(n); ++(i))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout << #x " = " << ((x)) << endl
template <class T, class U>
ostream &operator<<(ost... | replace | 68 | 69 | 68 | 69 | 0 | |
p01447 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
for (;;) {
int n;
cin >> n;
if (n == 0)
break;
int ret = 0;
while (n != 1) {
if (n % 3 == 0) {
n /= 3;
} else {
n /= 3;
n++;
}
ret++;
}
cout << ret << endl;
}
return 0;
} | #include <iostream>
using namespace std;
int main() {
int n;
while (cin >> n) {
if (n == 0)
break;
int ret = 0;
while (n != 1) {
if (n % 3 == 0) {
n /= 3;
} else {
n /= 3;
n++;
}
ret++;
}
cout << ret << endl;
}
return 0;
} | replace | 3 | 6 | 3 | 5 | TLE | |
p01447 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int calc(int n) {
return n <= 1 ? 0 : (n % 3 ? calc(n / 3 + 1) : calc(n / 3)) + 1;
}
int main() {
for (int N; cin >> N, N; cout << calc(N) << '\n')
;
return 0;
} | #include <iostream>
using namespace std;
int calc(int n) {
return n <= 1 ? 0 : (n % 3 ? calc(n / 3 + 1) : calc(n / 3)) + 1;
}
int main() {
for (int N; cin >> N; cout << calc(N) << '\n')
;
return 0;
} | replace | 9 | 10 | 9 | 10 | TLE | |
p01447 | C++ | Time Limit Exceeded | // Earth Invasion Diary of Miyabi-sensei
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll N;
while (cin >> N, N != 0)
cout << ceil(log((double)N) / log(3.0)) << endl;
return 0;
} | // Earth Invasion Diary of Miyabi-sensei
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll N;
cin >> N;
cout << ceil(log((double)N) / log(3.0)) << endl;
return 0;
} | replace | 8 | 10 | 8 | 10 | TLE | |
p01447 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, ans = 0;
cin >> n;
while (n > 1)
n = n / 3 + min(1, n % (n / 3)), ans++;
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, ans = 0;
cin >> n;
while (n > 1)
n = n / 3 + min(1, n % 3), ans++;
cout << ans << endl;
return 0;
} | replace | 6 | 7 | 6 | 7 | -8 | |
p01448 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define PI 4 * atan(1)
#define INF 1e8
typedef long long ll;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main() {
int N;
cin >> N;
vector<int> c(N + 1, 0);
for (int i = 0; i < N; i++) {
int a, b;
cin >> a >> b;
c[a - 1]++;
c[b]--;
... | #include <bits/stdc++.h>
using namespace std;
#define PI 4 * atan(1)
#define INF 1e8
typedef long long ll;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main() {
int N;
cin >> N;
vector<int> c(100000 + 2, 0);
for (int i = 0; i < N; i++) {
int a, b;
cin >> a >> b;
c[a - 1]++;
c[b]... | replace | 14 | 15 | 14 | 15 | -6 | malloc(): corrupted top size
|
p01448 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
vector<int> F;
cin >> N;
for (int i = 0; i < N + 1; i++) {
F.push_back(0);
}
for (int i = 0; i < N; i++) {
int x, y;
cin >> x >> y;
int xn = max(0, x - 1);
F[xn]++;
if (y <= N) {
... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
vector<int> F;
cin >> N;
for (int i = 0; i < N + 1; i++) {
F.push_back(0);
}
for (int i = 0; i < N; i++) {
int x, y;
cin >> x >> y;
int xn = max(0, x - 1);
if (xn <= N) {
F[xn]++... | replace | 19 | 20 | 19 | 22 | 0 | |
p01449 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
int main() {
int n;
std::cin >> n;
vector<int> p(n), cell(n, 1e9);
for (int i = 0; i < n; i++) {
std::cin >> p[i];
}
queue<pii> que;
cell[0] = 0;
que.push(pii(0, 0));
while (not que.empty()) {
int s = que.front().first;... | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
int main() {
int n;
std::cin >> n;
vector<int> p(n), cell(n, 1e9);
for (int i = 0; i < n; i++) {
std::cin >> p[i];
}
queue<pii> que;
cell[0] = 0;
que.push(pii(0, 0));
while (not que.empty()) {
int s = que.front().first;... | replace | 23 | 24 | 23 | 24 | TLE | |
p01449 | C++ | Time Limit Exceeded | #include <iostream>
#include <queue>
#include <string.h>
#include <vector>
using namespace std;
vector<int> T;
vector<int> M;
vector<bool> check;
int N;
const int NOT = -2;
int calc(int idx) {
if (T[idx] == NOT)
return NOT;
if (T[idx] >= 0)
return T[idx];
if (check[idx]) {
T[idx] = NOT;
return N... | #include <iostream>
#include <queue>
#include <string.h>
#include <vector>
using namespace std;
vector<int> T;
vector<int> M;
vector<bool> check;
int N;
const int NOT = -2;
int calc(int idx) {
if (T[idx] == NOT)
return NOT;
if (T[idx] >= 0)
return T[idx];
if (check[idx]) {
T[idx] = NOT;
return N... | replace | 36 | 37 | 36 | 37 | TLE | |
p01449 | C++ | Memory Limit Exceeded | #include <iostream>
#include <queue>
using namespace std;
int main() {
int N, p[100000], v[100000];
cin >> N;
for (int i = 0; i < N; i++) {
cin >> p[i];
v[i] = (1 << 24);
}
queue<int> q;
q.push(0);
v[0] = 0;
while (!q.empty()) {
int t = q.front();
q.pop();
if (t == N - 1) {
... | #include <iostream>
#include <queue>
using namespace std;
int main() {
int N, p[100000], v[100000];
cin >> N;
for (int i = 0; i < N; i++) {
cin >> p[i];
v[i] = (1 << 24);
}
queue<int> q;
q.push(0);
v[0] = 0;
while (!q.empty()) {
int t = q.front();
q.pop();
if (t == N - 1) {
... | replace | 35 | 36 | 35 | 36 | MLE | |
p01449 | C++ | Memory Limit Exceeded | #include <cstdio>
#include <map>
#include <queue>
#define fst first
#define snd second
using namespace std;
typedef pair<int, int> que;
int p[100500];
char tbl[100500];
int main(void) {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++)
scanf("%d", &p[i]);
priority_queue<que> q;
q.push(que(-0, 0));
... | #include <cstdio>
#include <map>
#include <queue>
#define fst first
#define snd second
using namespace std;
typedef pair<int, int> que;
int p[100500];
char tbl[100500];
int main(void) {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++)
scanf("%d", &p[i]);
priority_queue<que> q;
q.push(que(-0, 0));
... | replace | 37 | 38 | 37 | 38 | MLE | |
p01449 | C++ | Memory Limit Exceeded | #include <algorithm>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n);... | #include <algorithm>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n);... | replace | 32 | 33 | 32 | 33 | MLE | |
p01450 | C++ | Runtime Error | #include "bits/stdc++.h"
#include <unordered_map>
#include <unordered_set>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
template <class T> using Table = vector<vector<T>>;
const ld eps = 1e-9;
// < "D:\D_Download\Visual Studio
// 2015\Projects\programing_contest_c++\Debug\a.txt"
int dp[... | #include "bits/stdc++.h"
#include <unordered_map>
#include <unordered_set>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
template <class T> using Table = vector<vector<T>>;
const ld eps = 1e-9;
// < "D:\D_Download\Visual Studio
// 2015\Projects\programing_contest_c++\Debug\a.txt"
int dp[... | replace | 74 | 75 | 74 | 75 | 0 | |
p01450 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef long long int ll;
const int MAX_N = 205;
const int MAX_W = 10005;
const ll MOD = 1000000007;
int N, W;
ll dp[MAX_N][MAX_W];
ll func(vector<ll> &vec, int sum, int id) {
for (int i = 0; i <= N; i++)
for (int j = 0; j <= W; j... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef long long int ll;
const int MAX_N = 205;
const int MAX_W = 10005;
const ll MOD = 1000000007;
int N, W;
ll dp[MAX_N][MAX_W];
ll func(vector<ll> &vec, int sum, int id) {
for (int i = 0; i <= N; i++)
for (int j = 0; j <= W; j... | insert | 53 | 53 | 53 | 55 | 0 | |
p01450 | C++ | Time Limit Exceeded | #define _CRT_SECURE_NO_WARNINGS 1
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <forward_list>
#include <functional>
#include <iomanip>
#include <iostream>
#include... | #define _CRT_SECURE_NO_WARNINGS 1
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <forward_list>
#include <functional>
#include <iomanip>
#include <iostream>
#include... | replace | 62 | 63 | 62 | 63 | TLE | |
p01450 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define PI 3.1415926535897932384626433832795028841971
#define INF 1000000000
#define EPS 1e-10
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<double, double> P;
typedef pair<double, P> PQ;
int n, w;
int a[200];
ll dp... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define PI 3.1415926535897932384626433832795028841971
#define INF 1000000000
#define EPS 1e-10
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<double, double> P;
typedef pair<double, P> PQ;
int n, w;
int a[200];
ll dp... | insert | 35 | 35 | 35 | 37 | 0 | |
p01450 | C++ | Runtime Error | #include <bits/stdc++.h>
#define range(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, b) for (int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x) cerr << #x << " = " << (x) << endl;
// const int INF = 1e8;
using namespace std;
#define int long long
const int M = 1000000007;
int dp[2... | #include <bits/stdc++.h>
#define range(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, b) for (int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x) cerr << #x << " = " << (x) << endl;
// const int INF = 1e8;
using namespace std;
#define int long long
const int M = 1000000007;
int dp[2... | insert | 33 | 33 | 33 | 35 | 0 | |
p01450 | C++ | Memory Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <set>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
inline int getInt() {
int s;
scanf("%d", &s);
return s;
}
using namespace std;
const int mod = 1000000007;
int a[100000 + 10];
int dp[200][100000 + 10];
int w, n;
int memo;
int solve(i... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <set>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
inline int getInt() {
int s;
scanf("%d", &s);
return s;
}
using namespace std;
const int mod = 1000000007;
int a[10000 + 10];
int dp[200][10000 + 10];
int w, n;
int memo;
int solve(int... | replace | 15 | 17 | 15 | 17 | MLE | |
p01450 | C++ | Runtime Error | #include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <s... | #include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <s... | replace | 70 | 75 | 70 | 75 | 0 | |
p01450 | C++ | Memory Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define All(A) A.begin(), A.end()
#define RAll(A) A.rbegin(), A.rend()
typedef long long LL;
typedef pair<double, double> P;
const LL mod = 1e9 + 7;
const LL LINF = 1LL << 6... | #include <bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define All(A) A.begin(), A.end()
#define RAll(A) A.rbegin(), A.rend()
typedef long long LL;
typedef pair<double, double> P;
const LL mod = 1e9 + 7;
const LL LINF = 1LL << 6... | replace | 15 | 16 | 15 | 16 | MLE | |
p01450 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define INF 1000000007
typedef /*long long*/ int LLI;
int n;
int W;
int myws[201];
int imos[201];
LLI dp[2][1145][201];
int main() {
scanf("%d%d", &n, &W);
for (int i = 1; i <= n; i++) {
scanf("%d", &myws[i]);
}
sort(myws + 1, myws + n ... | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define INF 1000000007
typedef /*long long*/ int LLI;
int n;
int W;
int myws[201];
int imos[201];
LLI dp[2][11451][201];
int main() {
scanf("%d%d", &n, &W);
for (int i = 1; i <= n; i++) {
scanf("%d", &myws[i]);
}
sort(myws + 1, myws + n... | replace | 11 | 12 | 11 | 12 | 0 | |
p01450 | C++ | Runtime Error | #ifndef LOCAL
#pragma GCC optimize("Ofast")
#endif
#include <algorithm>
#include <bitset>
#include <cassert>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unorde... | #ifndef LOCAL
#pragma GCC optimize("Ofast")
#endif
#include <algorithm>
#include <bitset>
#include <cassert>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unorde... | replace | 349 | 350 | 349 | 350 | 0 | |
p01450 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
using namespace std;
int w[400], n, W, dp[20005];
int main() {
cin >> n >> W;
for (int i = 0; i < n; i++)
cin >> w[i];
sort(w, w + n);
int sum = 0;
int cnt = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j <= W; j++)
dp[j] = 0;
dp[cnt] = 1;
f... | #include <algorithm>
#include <iostream>
using namespace std;
int w[400], n, W, dp[20005];
int main() {
cin >> n >> W;
for (int i = 0; i < n; i++)
cin >> w[i];
sort(w, w + n);
int sum = 0;
int cnt = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j <= W; j++)
dp[j] = 0;
dp[cnt] = 1;
f... | insert | 26 | 26 | 26 | 28 | 0 | |
p01452 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const long long int MOD = 1000000007;
const int INF = 1000000000;
ll n, m, k;
ll kai[300000];
ll mod_pow(ll x, ll y) {
ll ret = 1;
while (y) {
if (y & 1)
ret = ret ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const long long int MOD = 1000000007;
const int INF = 1000000000;
ll n, m, k;
ll kai[300000];
ll mod_pow(ll x, ll y) {
ll ret = 1;
while (y) {
if (y & 1)
ret = ret ... | replace | 31 | 32 | 31 | 32 | 0 | |
p01452 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int, int> pii;
#define REP(i, n) for (ll i = 0; i < n; ++i)
#define REPR(i, n) for (ll i = 1; i < n; ++i)
#define FOR(i, a, b) for (ll i = a; i < b; ++i)
#define ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int, int> pii;
#define REP(i, n) for (ll i = 0; i < n; ++i)
#define REPR(i, n) for (ll i = 1; i < n; ++i)
#define FOR(i, a, b) for (ll i = a; i < b; ++i)
#define ... | replace | 36 | 37 | 36 | 37 | 0 | |
p01452 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdio.h>
#includ... | #include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdio.h>
#includ... | replace | 72 | 73 | 72 | 73 | 0 | |
p01452 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < b; i++)
#define rrep(i, a, b) for (int i = a; i >= b; i--)
#define fore(i, a) for (auto &i : a)
#define all(x) (x).begin(), (x).end()
#pragma GCC optimize("-O3")
using namespace std;
void _main();
int main() {
cin.tie(0);
ios::sync_with_stdio(false);... | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < b; i++)
#define rrep(i, a, b) for (int i = a; i >= b; i--)
#define fore(i, a) for (auto &i : a)
#define all(x) (x).begin(), (x).end()
#pragma GCC optimize("-O3")
using namespace std;
void _main();
int main() {
cin.tie(0);
ios::sync_with_stdio(false);... | replace | 128 | 129 | 128 | 129 | 0 | |
p01452 | C++ | Runtime Error | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < ((int)(n)); i++)
#define reg(i, a, b) for (int i = ((int)(a)); i... | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < ((int)(n)); i++)
#define reg(i, a, b) for (int i = ((int)(a)); i... | replace | 42 | 43 | 42 | 43 | 0 | |
p01453 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
typedef long long LL;
struct position {
LL x;
LL y;
LL count;
};
int main() {
LL w, h;
LL houkou[5] = {0, 1, 0, -1, 0};
cin >> w >> h;
vector<vector<LL>> field(h, vector<LL... | #include <bits/stdc++.h>
using namespace std;
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
typedef long long LL;
struct position {
LL x;
LL y;
LL count;
};
int main() {
LL w, h;
LL houkou[5] = {0, 1, 0, -1, 0};
cin >> w >> h;
vector<vector<LL>> field(h, vector<LL... | replace | 103 | 104 | 103 | 104 | TLE | |
p01453 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define reep(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) reep((i), 0, (n))
#define PB push_back
#define mkp make_pair
#define F first
#define S second
#define INF 0x3f3f3f3f
#define EPS 1e-8
typedef vector<int> vint;
typedef pair<int, int> pii;
int main() ... | #include <bits/stdc++.h>
using namespace std;
#define reep(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) reep((i), 0, (n))
#define PB push_back
#define mkp make_pair
#define F first
#define S second
#define INF 0x3f3f3f3f
#define EPS 1e-8
typedef vector<int> vint;
typedef pair<int, int> pii;
int main() ... | delete | 90 | 92 | 90 | 90 | TLE | |
p01453 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
/*
*/
using namespace std;
typedef pair<long long int, pair<long long int, long long int>> one;
#define mod 1000000007LL
int main() {
long long int W, H;
cin >> W >> H;
vector<string> D(H);
long long int counttile = 0;
pair<long long int, long long int> start, goal;
vector<pair<... | #include <bits/stdc++.h>
/*
*/
using namespace std;
typedef pair<long long int, pair<long long int, long long int>> one;
#define mod 1000000007LL
int main() {
long long int W, H;
cin >> W >> H;
vector<string> D(H);
long long int counttile = 0;
pair<long long int, long long int> start, goal;
vector<pair<... | replace | 93 | 94 | 93 | 94 | TLE | |
p01457 | C++ | Runtime Error | // Header {{{
// includes {{{
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numer... | // Header {{{
// includes {{{
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numer... | replace | 345 | 346 | 345 | 346 | 0 | |
p01459 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int N, M, A;
string s[111];
int dp[11][11][4][111][111];
bool in(int y, int x) { return 0 <= y && y < N && 0 <= x && x < M; }
int P(int d) {
if (d & 1)
return (d + 1) % 4;
return (d + 3) % 4;
}
int Q(int d) {
if (d & 1)
return (d + 3) % 4;
return (d + 1) % 4... | #include <bits/stdc++.h>
using namespace std;
int N, M, A;
string s[111];
int dp[111][111][4][11][11];
bool in(int y, int x) { return 0 <= y && y < N && 0 <= x && x < M; }
int P(int d) {
if (d & 1)
return (d + 1) % 4;
return (d + 3) % 4;
}
int Q(int d) {
if (d & 1)
return (d + 3) % 4;
return (d + 1) % 4... | replace | 4 | 5 | 4 | 5 | 0 | |
p01461 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define reps(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define rep(i, n) reps(i, 0, n)
#define MAX_N 500005
using vint = vector<int>;
using Graph = vector<vint>;
int n;
Graph graph;
int dp1[MAX_N];
void dfs1(int root) {
memset(dp1, -1... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define reps(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define rep(i, n) reps(i, 0, n)
#define MAX_N 500005
using vint = vector<int>;
using Graph = vector<vint>;
int n;
Graph graph;
int dp1[MAX_N];
void dfs1(int root) {
memset(dp1, -1... | insert | 86 | 86 | 86 | 87 | TLE | |
p01462 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int V, E;
double P, Q;
vector<int> G[15];
void printbit(int S) {
for (int i = 0; i < V; i++) {
cout << (S >> i & 1) << ' ';
}
cout << endl;
}
double func(int S, int U) {
double res = 1;
for (int i = 0; i < V; i++) {
if (S >> i & 1) {
for (int j = ... | #include <bits/stdc++.h>
using namespace std;
int V, E;
double P, Q;
vector<int> G[15];
void printbit(int S) {
for (int i = 0; i < V; i++) {
cout << (S >> i & 1) << ' ';
}
cout << endl;
}
double func(int S, int U) {
double res = 1;
for (int i = 0; i < V; i++) {
if (S >> i & 1) {
for (int j = ... | replace | 52 | 53 | 52 | 53 | -11 | |
p01463 | C++ | Runtime Error | #include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define EPS (1e-8)
#define equals(a, b) (fabs((a) - (b)) < EPS)
#define COUNTER_CLOCKWISE 1
#define CLOCKWISE -1
#define ONLINE_BACK 2
#define ONLINE_FRONT -2
#define ON_SEGMENT 0
using namespace std;
class Point... | #include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define EPS (1e-7)
#define equals(a, b) (fabs((a) - (b)) < EPS)
#define COUNTER_CLOCKWISE 1
#define CLOCKWISE -1
#define ONLINE_BACK 2
#define ONLINE_FRONT -2
#define ON_SEGMENT 0
using namespace std;
class Point... | replace | 4 | 5 | 4 | 5 | 0 | |
p01465 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ALL(a) (a).begin(), (a).end()
#define ll long long
using namespace std;
const ll MOD = (ll)1e9 + 7;
string str;
// vector<ll> dp;
ll dp[20];
ll power(int num) {
ll ret = 1;
for (int i = 0; i < 20; i++) {
if ((num & (1 << i))) {
ret = (ret * dp[i]) % MOD;
}
}
/... | #include <bits/stdc++.h>
#define ALL(a) (a).begin(), (a).end()
#define ll long long
using namespace std;
const ll MOD = (ll)1e9 + 7;
// string str;
char str[1000001];
// vector<ll> dp;
ll dp[20];
ll power(int num) {
ll ret = 1;
for (int i = 0; i < 20; i++) {
if ((num & (1 << i))) {
ret = (ret * dp[i]... | replace | 9 | 10 | 9 | 11 | 0 | |
p01465 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cctype>
#include <cstdlib>
#include <iostream>
#include <utility>
#include <vector>
using namespace std;
constexpr long long mod = 1000000007;
typedef pair<long long, long long> result; // true, false
#define T first
#define F second
struct parse_t {
char c;
resu... | #include <algorithm>
#include <cassert>
#include <cctype>
#include <cstdlib>
#include <iostream>
#include <utility>
#include <vector>
using namespace std;
constexpr long long mod = 1000000007;
typedef pair<long long, long long> result; // true, false
#define T first
#define F second
struct parse_t {
char c;
resu... | replace | 29 | 30 | 29 | 30 | -11 | |
p01465 | C++ | Memory Limit Exceeded | #include "bits/stdc++.h"
#include <unordered_map>
#include <unordered_set>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
template <class T> using Table = vector<vector<T>>;
const ld eps = 1e-9;
// < "D:\D_Download\Visual Studio
// 2015\Projects\programing_contest_c++\Debug\a.txt" > "D:\D... | #include "bits/stdc++.h"
#include <unordered_map>
#include <unordered_set>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
template <class T> using Table = vector<vector<T>>;
const ld eps = 1e-9;
// < "D:\D_Download\Visual Studio
// 2015\Projects\programing_contest_c++\Debug\a.txt" > "D:\D... | delete | 14 | 86 | 14 | 14 | MLE | |
p01468 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#inclu... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#inclu... | insert | 412 | 412 | 412 | 413 | TLE | |
p01468 | C++ | Time Limit Exceeded | #include <algorithm> // other
#include <bitset>
#include <cassert> // c
#include <complex>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream> // io
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#inclu... | #include <algorithm> // other
#include <bitset>
#include <cassert> // c
#include <complex>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream> // io
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#inclu... | replace | 382 | 385 | 382 | 385 | TLE | |
p01468 | C++ | Time Limit Exceeded | #include <algorithm>
#include <assert.h>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;... | #include <algorithm>
#include <assert.h>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;... | insert | 162 | 162 | 162 | 163 | TLE | |
p01469 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <s... | #include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <s... | replace | 52 | 53 | 52 | 53 | 0 | |
p01470 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
typedef long long ll;
ll mod = 8589934609ll;
ll mul(ll x, ll y) { // x * y
ll res = (x * (y >> 30)) % mod;
for (int i = 0; i < 30; ++i)
res = (res << 1) % mod;
res += x * (((y >> 30) << 30) ^ y);
res %= mod;
return res;
}
ll powmod(ll x, ll p) {
if (p == 0)
... | #include <iostream>
using namespace std;
typedef long long ll;
ll mod = 8589934609ll;
ll mul(ll x, ll y) { // x * y
ll res = (x * (y >> 30)) % mod;
res = (res << 15) % mod;
res = (res << 15) % mod;
res += x * (((y >> 30) << 30) ^ y);
res %= mod;
return res;
}
ll powmod(ll x, ll p) {
if (p == 0)
r... | replace | 9 | 11 | 9 | 12 | TLE | |
p01471 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
struct node {
double w, v, u;
};
vector<node> list;
bool cmp(node A, node B) { return A.v / A.w > B.v / B.w; }
int main() {
// freopen("input.txt","r",stdin);
int N;
double W;
while (scanf("%d%lf", &N, &W) == 2) ... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
struct node {
double w, v, u;
};
vector<node> list;
bool cmp(node A, node B) { return A.v / A.w > B.v / B.w; }
int main() {
// freopen("input.txt","r",stdin);
int N;
double W;
while (scanf("%d%lf", &N, &W) == 2) ... | replace | 37 | 38 | 37 | 38 | 0 | |
p01473 | C++ | Time Limit Exceeded | #include <iostream>
#include <map>
#include <string>
#define rep(i, a, b) for (int i = a; i < b; i++)
using namespace std;
typedef long long ll;
string s;
ll fact(ll x) {
if (x == 1)
return 1;
return x * fact(x - 1);
}
int main() {
cin >> s;
map<char, int> mp;
rep(i, 0, s.size()) mp[s[i]]++;
int cnt... | #include <iostream>
#include <map>
#include <string>
#define rep(i, a, b) for (int i = a; i < b; i++)
using namespace std;
typedef long long ll;
string s;
ll fact(ll x) {
if (x == 0)
return 1;
return x * fact(x - 1);
}
int main() {
cin >> s;
map<char, int> mp;
rep(i, 0, s.size()) mp[s[i]]++;
int cnt... | replace | 10 | 11 | 10 | 11 | TLE | |
p01477 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define fr(i, c) for (__type... | #include <algorithm>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define fr(i, c) for (__type... | delete | 119 | 121 | 119 | 119 | 0 | |
p01478 | C++ | Memory Limit Exceeded | #include <iostream>
#include <queue>
using namespace std;
int dp[1 << 24], x[8][8];
queue<int> Q;
int main() {
int n;
cin >> n;
int minp = 0, maxp = 0;
for (int i = 0; i < n; i++) {
minp += (n - 1 - i) * (1 << (3 * i));
maxp += i * (1 << (3 * i));
}
for (int i = minp; i <= maxp; i++)
dp[i] = 100... | #include <iostream>
#include <queue>
using namespace std;
int dp[16434825], x[8][8];
queue<int> Q;
int main() {
int n;
cin >> n;
int minp = 0, maxp = 0;
for (int i = 0; i < n; i++) {
minp += (n - 1 - i) * (1 << (3 * i));
maxp += i * (1 << (3 * i));
}
for (int i = minp; i <= maxp; i++)
dp[i] = 10... | replace | 3 | 4 | 3 | 4 | MLE | |
p01478 | C++ | Runtime Error | #include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
typedef pair<int, int> pii;
const int INF = 1000000000;
inline int swap(int cur, int i, int j) {
int result = cur & ~(7 << (i * 3)) & ~(7 << (j * 3));
result |= ((cur >> (i * 3)) & 7) << (j * 3);
result |= ((cur >> (j * 3... | #include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
typedef pair<int, int> pii;
const int INF = 1000000000;
inline int swap(int cur, int i, int j) {
int result = cur & ~(7 << (i * 3)) & ~(7 << (j * 3));
result |= ((cur >> (i * 3)) & 7) << (j * 3);
result |= ((cur >> (j * 3... | replace | 20 | 21 | 20 | 21 | 0 | |
p01478 | C++ | Memory Limit Exceeded | // 33
#include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
struct S {
int t;
vector<int> v;
bool operator<(S a) const { return t > a.t; }
};
int fact(int x) { return (x == 1) ? 1 : x * fact(x - 1); }
int dec(vector<int> v) {
vector<int> n(v.size());
for (int i =... | // 33
#include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
struct S {
int t;
vector<int> v;
bool operator<(S a) const { return t > a.t; }
};
int fact(int x) { return (x == 1) ? 1 : x * fact(x - 1); }
int dec(vector<int> v) {
vector<int> n(v.size());
for (int i =... | replace | 62 | 63 | 62 | 64 | MLE | |
p01478 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
using namespace std;
int cost[9][9];
struct node {
string num;
int cost;
node(string n, int c) : num(n), cost(c) {}
node() {}
bool operator>(const node &arg) const { return cost >... | #include <algorithm>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
using namespace std;
int cost[9][9];
struct node {
string num;
int cost;
node(string n, int c) : num(n), cost(c) {}
node() {}
bool operator>(const node &arg) const { return cost >... | replace | 55 | 57 | 55 | 59 | TLE | |
p01478 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
const int INF = 1e+9;
const int MAX_V = 8;
struct edge {
int to, cost;
};
typedef pair<int, int> P;
int n;
int c[10][10];
map<vector<int>, int> m;
int fact[9] = {1, 1, 2, 6, 24, 120, 720, 5040, 40320};
i... | #include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
const int INF = 1e+9;
const int MAX_V = 40320;
struct edge {
int to, cost;
};
typedef pair<int, int> P;
int n;
int c[10][10];
map<vector<int>, int> m;
int fact[9] = {1, 1, 2, 6, 24, 120, 720, 5040, 40320}... | replace | 8 | 9 | 8 | 9 | 0 | |
p01479 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i+... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i+... | replace | 61 | 62 | 61 | 62 | -11 | |
p01479 | C++ | Runtime Error | // 59
#include <iostream>
using namespace std;
int main() {
char s[1001];
cin >> s;
char p = 0;
int l = 0;
char r;
int rl = -1;
for (int i = 0; s[i]; i += (p == 'e') ? 3 : 7) {
if (p == s[i]) {
l = 0;
}
l++;
p = s[i];
if (l > rl) {
rl = l;
r = p;
}
}
cout <<... | // 59
#include <iostream>
using namespace std;
int main() {
char s[7 * 1001];
cin >> s;
char p = 0;
int l = 0;
char r;
int rl = -1;
for (int i = 0; s[i]; i += (p == 'e') ? 3 : 7) {
if (p == s[i]) {
l = 0;
}
l++;
p = s[i];
if (l > rl) {
rl = l;
r = p;
}
}
cou... | replace | 6 | 7 | 6 | 7 | 0 | |
p01479 | C++ | Runtime Error | #include <algorithm>
#include <functional>
#include <stdio.h>
#include <vector>
using namespace std;
struct S {
int length, ancestor;
bool operator>(const S &s) const { return length > s.length; }
};
vector<S> v;
S s;
void F(int id) {
if (s.ancestor == id) {
v.push_back(s);
s.length = 1;
s.ancestor =... | #include <algorithm>
#include <functional>
#include <stdio.h>
#include <vector>
using namespace std;
struct S {
int length, ancestor;
bool operator>(const S &s) const { return length > s.length; }
};
vector<S> v;
S s;
void F(int id) {
if (s.ancestor == id) {
v.push_back(s);
s.length = 1;
s.ancestor =... | replace | 23 | 24 | 23 | 24 | 0 | |
p01481 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#includ... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#includ... | replace | 134 | 135 | 134 | 135 | 0 | |
p01481 | C++ | Runtime Error | #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#inc... | #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#inc... | insert | 56 | 56 | 56 | 59 | 0 | |
p01481 | C++ | Runtime Error | #include <iostream>
#include <stack>
using namespace std;
// union_find begin
#define MAX 500000
struct node {
int parent, size;
};
node tree[MAX];
void init() {
for (int i = 0; i < MAX; i++) {
tree[i].parent = i;
tree[i].size = 1;
}
}
/*
int find(int x){
if(tree[x].parent==x)return x;
tree[x].parent... | #include <iostream>
#include <stack>
using namespace std;
// union_find begin
#define MAX 5000000
struct node {
int parent, size;
};
node tree[MAX];
void init() {
for (int i = 0; i < MAX; i++) {
tree[i].parent = i;
tree[i].size = 1;
}
}
/*
int find(int x){
if(tree[x].parent==x)return x;
tree[x].paren... | replace | 5 | 6 | 5 | 6 | 0 | |
p01481 | C++ | Runtime Error | #include <iostream>
#include <string>
#define N1 1000 + 1
using namespace std;
int find(int);
void unite(int, int);
bool same(int, int);
int tree[N1 * N1];
string str[N1];
int main() {
int W, H, N, x, y, findy, findx;
int dx[4] = {0, 1, 0, -1};
int dy[4] = {-1, 0, 1, 0};
cin >> W >> H;
for (int i = 0; i < H; ... | #include <iostream>
#include <string>
#define N1 (1000 + 1)
using namespace std;
int find(int);
void unite(int, int);
bool same(int, int);
int tree[N1 * N1];
string str[N1];
int main() {
int W, H, N, x, y, findy, findx;
int dx[4] = {0, 1, 0, -1};
int dy[4] = {-1, 0, 1, 0};
cin >> W >> H;
for (int i = 0; i < H... | replace | 2 | 3 | 2 | 3 | 0 | |
p01484 | C++ | Memory Limit Exceeded | #include <algorithm>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <sstream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define fr(i, c) for (__typeof(c.begin()) i... | #include <algorithm>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <sstream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define fr(i, c) for (__typeof(c.begin()) i... | replace | 120 | 121 | 120 | 121 | MLE | |
p01486 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
bool iscat(string s) {
int l = s.length();
if (l == 0 || s == "mew")
return true;
if (s[0] != 'm' || s[l - 1] != 'w' || l % 3 != 0)
return false;
int id = 1;
int n;
while ((n = s.find('e', id)) != string::npos) {
string s1 = s.substr(1, n - 1);
string... | #include <iostream>
using namespace std;
bool iscat(string s) {
int l = s.length();
if (l == 0 || s == "mew")
return true;
if (s[0] != 'm' || s[l - 1] != 'w' || l % 3 != 0)
return false;
int m = 0, e = 0, w = 0;
for (int i = 0; i < l; i++) {
switch (s[i]) {
case 'm':
m++;
break;
... | insert | 7 | 7 | 7 | 23 | TLE | |
p01486 | C++ | Runtime Error | #include <iostream>
#include <string>
using namespace std;
string S;
int dp[510][510];
bool rec(int l, int r) {
cerr << l << " " << r << endl;
if (dp[l][r] != -1)
return dp[l][r];
dp[l][r] = 0;
if (l > r)
return dp[l][r] = 1;
if (S[l] != 'm' || S[r] != 'w')
return dp[l][r] = 0;
for (int i = l ... | #include <iostream>
#include <string>
using namespace std;
string S;
int dp[510][510];
bool rec(int l, int r) {
if (dp[l][r] != -1)
return dp[l][r];
dp[l][r] = 0;
if (l > r)
return dp[l][r] = 1;
if (S[l] != 'm' || S[r] != 'w')
return dp[l][r] = 0;
for (int i = l + 1; i < r; i++) {
if (S[i] =... | delete | 8 | 9 | 8 | 8 | 0 | 0 11
1 1
3 10
4 3
5 9
4 6
8 9
4 8
10 9
1 3
5 10
1 6
2 1
3 5
4 3
5 4
2 3
5 5
8 10
9 8
10 9
1 8
10 10
|
p01486 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); ++i)
bool iscat(const string &S_) {
map<string, int> vis;
function<bool(const string &)> dfs = [&](const string &S) {
if (S.empty())
return true;
if (S[0] != 'm' || S.back() != 'w')
return false;
if ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); ++i)
bool iscat(const string &S_) {
map<string, int> vis;
function<bool(const string &)> dfs = [&](const string &S) {
if (S.empty())
return true;
if (S[0] != 'm' || S.back() != 'w')
return false;
if ... | replace | 14 | 16 | 14 | 15 | TLE | |
p01486 | C++ | Runtime Error | #include <iostream>
#include <stack>
#include <string>
using namespace std;
void catChecker(string str) {
stack<char> cnt;
for (int i = 0; i < str.size(); i++) {
char c = str.at(i);
if (c == 'm') {
cnt.push(c);
} else if (c == 'e' && cnt.top() == 'm') {
cnt.pop();
cnt.push(c);
... | #include <iostream>
#include <stack>
#include <string>
using namespace std;
void catChecker(string str) {
stack<char> cnt;
for (int i = 0; i < str.size(); i++) {
char c = str.at(i);
if (c == 'm') {
cnt.push(c);
} else if (!cnt.empty()) {
if (c == 'e' && cnt.top() == 'm') {
cnt.p... | replace | 15 | 20 | 15 | 25 | 0 | |
p01486 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include ... | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include ... | replace | 85 | 86 | 85 | 86 | 0 | |
p01486 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctype.h>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
int main()... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctype.h>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
int main()... | replace | 25 | 26 | 25 | 26 | 0 | |
p01486 | C++ | Time Limit Exceeded | #include <cstdio>
#include <iostream>
#include <string>
using namespace std;
bool dfs(string s) {
int res = 0;
if (!s.size())
return 1;
if (s[0] != 'm' || s[s.size() - 1] != 'w')
return 0;
for (int i = 0; i < s.size(); i++) {
if (s[i] != 'e')
continue;
string a = s.substr(1, i - 1);
... | #include <cstdio>
#include <iostream>
#include <string>
using namespace std;
bool dfs(string s) {
int res = 0;
if (!s.size())
return 1;
if (s[0] != 'm' || s[s.size() - 1] != 'w')
return 0;
for (int i = 0; i < s.size(); i++) {
if (s[i] != 'e')
continue;
string a = s.substr(1, i - 1);
... | replace | 27 | 28 | 27 | 47 | TLE | |
p01486 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
char str[1024];
bool f[1024][1024];
int main() {
scanf("%s", str);
int n = strlen(str);
for (int i = 0; i < n; i++) {
f[i][i] = true;
}
for (int t = 0; t < n; t++) {
for (int w1 = 0; w1 < n; w1 += 3) {
for (int w2 = 0; w2 < n; w2 += 3) {
fo... | #include <bits/stdc++.h>
using namespace std;
char str[1024];
bool f[1024][1024];
int main() {
scanf("%s", str);
int n = strlen(str);
for (int i = 0; i < n; i++) {
f[i][i] = true;
}
for (int t = 0; t < n / 2; t++) {
for (int w1 = 0; w1 < n; w1 += 3) {
for (int w2 = 0; w2 < n; w2 += 3) {
... | replace | 12 | 13 | 12 | 13 | TLE | |
p01486 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
template <class T> inline T sqr(T x) { return x * x; }
typedef vector<int> v... | #include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
int v;
istringstream sin(s);
sin >> v;
return v;
}
template <class T> inline string toString(T x) {
ostringstream sout;
sout << x;
return sout.str();
}
template <class T> inline T sqr(T x) { return x * x; }
typedef vector<int> v... | replace | 61 | 63 | 61 | 62 | 0 | d = 3
i = 3
j = 4
d = 3
i = 8
j = 9
d = 6
i = 0
j = 2
d = 6
i = 0
j = 4
d = 6
i = 1
j = 2
d = 6
i = 1
j = 4
d = 9
i = 3
j = 4
d = 9
i = 3
j = 7
d = 9
i = 3
j = 9
d = 12
i = 0
j = 2
d = 12
i = 0
j = 4
d = 12
i = 0
j = 7
d = 12
i = 0
j = 9
|
p01487 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
#include <unordered_map>
#include <unordered_set>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
template <class T> using Table = vector<vector<T>>;
vector<pair<int, int>> colors;
vector<vector<int>> edges;
pair<int, int> dfs(const int now, const int num) {
cons... | #include "bits/stdc++.h"
#include <unordered_map>
#include <unordered_set>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
template <class T> using Table = vector<vector<T>>;
vector<pair<int, int>> colors;
vector<vector<int>> edges;
pair<int, int> dfs(const int now, const int num) {
cons... | insert | 80 | 80 | 80 | 81 | TLE | |
p01487 | C++ | Runtime Error | #include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
int n, m, a, b, d, u[200000];
vector<int> x[100000], c[100000], H;
bool used[100000], f[200009], g[200009];
vector<pair<int, int>> I;
bool solve() {
vector<int> col(n, -1);
for (int i = 0; i < d; i++) {
q... | #include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
int n, m, a, b, d, u[200000];
vector<int> x[100000], c[100000], H;
bool used[100000], f[200009], g[200009];
vector<pair<int, int>> I;
bool solve() {
vector<int> col(n, -1);
for (int i = 0; i < d; i++) {
q... | insert | 52 | 52 | 52 | 56 | -8 | |
p01487 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int(i) = 0; (i) < (int)(n); ++(i))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout << #x " = " << ((x)) << endl
template <class T, class U>
ostream &operator<<(ost... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int(i) = 0; (i) < (int)(n); ++(i))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout << #x " = " << ((x)) << endl
template <class T, class U>
ostream &operator<<(ost... | replace | 148 | 149 | 148 | 149 | 0 | |
p01487 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define MAX_N 100000
#define INF 100000000
#define MOD 1000000007
#define RANK 1000000000
#define EPS 1e-10
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> IP;
struct UF {
int par[MAX_N];
int rank[MAX_N... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define MAX_N 100000
#define INF 100000000
#define MOD 1000000007
#define RANK 1000000000
#define EPS 1e-10
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> IP;
struct UF {
int par[MAX_N];
int rank[MAX_N... | replace | 106 | 107 | 106 | 107 | TLE | |
p01488 | C++ | Runtime Error | #include <algorithm>
#include <map>
#include <queue>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
char str[16];
map<string, int> m;
vector<pair<int, int>> g[100000];
vector<pair<int, int>> ijk[50000];
pair<int, int> IJK[100000];
vector<int> num[50000];
vector<int> dist[50000];
vector<int>... | #include <algorithm>
#include <map>
#include <queue>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
char str[16];
map<string, int> m;
vector<pair<int, int>> g[100000];
vector<pair<int, int>> ijk[50000];
pair<int, int> IJK[100000];
vector<int> num[50000];
vector<int> dist[50000];
vector<int>... | replace | 15 | 16 | 15 | 16 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.