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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p01316 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define INF 1LL << 50
int main() {
int n, m;
while (cin >> n >> m) {
if (n == 0 && m == 0)
break;
... | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define INF 1LL << 50
int main() {
int n, m;
while (cin >> n >> m) {
if (n == 0 && m == 0)
break;
... | replace | 27 | 28 | 27 | 28 | -11 | |
p01316 | C++ | Memory Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repl(i, 0, n)
#define each(itr, v) for (auto itr : v)
#define pb(s) push_back(s)
#define maxch(x, y) x = max(x, y)
#define minch(x, y) x = min(x, y)
#define ... | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repl(i, 0, n)
#define each(itr, v) for (auto itr : v)
#define pb(s) push_back(s)
#define maxch(x, y) x = max(x, y)
#define minch(x, y) x = min(x, y)
#define ... | replace | 35 | 36 | 35 | 36 | MLE | |
p01316 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n, m;
while (cin >> n >> m, n) {
vector<int> code(m), value(n);
for (int i = 0; i < m; i++)
cin >> code[i];
for (int i = 0; i < n; i++)
cin >> value[i];
vector<vector<int>>... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n, m;
while (cin >> n >> m, n) {
vector<int> code(m), value(n);
for (int i = 0; i < m; i++)
cin >> code[i];
for (int i = 0; i < n; i++)
cin >> value[i];
vector<vector<int>>... | replace | 15 | 16 | 15 | 16 | -6 | free(): invalid size
|
p01316 | C++ | Memory Limit Exceeded | #include <algorithm>
#include <array>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <list>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <vector>
const int MOD = 1000000007;
const int INF = 1000000000;
using name... | #include <algorithm>
#include <array>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <list>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <vector>
const int MOD = 1000000007;
const int INF = 1000000000;
using name... | replace | 114 | 115 | 114 | 115 | MLE | |
p01316 | C++ | Memory Limit Exceeded | #include <algorithm>
#include <assert.h>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define REP(j, n) for (int(j) = 0; j < (int)(n); ++j)
#define FOR(j, k, n) for (int(j) = (k); j < (int)(n); ++j)... | #include <algorithm>
#include <assert.h>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define REP(j, n) for (int(j) = 0; j < (int)(n); ++j)
#define FOR(j, k, n) for (int(j) = (k); j < (int)(n); ++j)... | replace | 21 | 22 | 21 | 22 | MLE | |
p01317 | C++ | Time Limit Exceeded | #include <cstdio>
#include <iostream>
using namespace std;
const int MAX_N = 210;
const int MAX_T = 1005;
const int INF = 2 * MAX_N * MAX_T;
int N, M, R;
int sea[MAX_N][MAX_N];
int land[MAX_N][MAX_N];
const int MAX_R = 1005;
int O[MAX_R];
int dp[MAX_R][MAX_N];
void show(char s) {
printf("\n");
if (s == 'L') {
p... | #include <cstdio>
#include <iostream>
using namespace std;
const int MAX_N = 210;
const int MAX_T = 1005;
const int INF = 2 * MAX_N * MAX_T;
int N, M, R;
int sea[MAX_N][MAX_N];
int land[MAX_N][MAX_N];
const int MAX_R = 1005;
int O[MAX_R];
int dp[MAX_R][MAX_N];
void show(char s) {
printf("\n");
if (s == 'L') {
p... | insert | 44 | 44 | 44 | 46 | TLE | |
p01317 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define loop(i, s, n) for (int i = s; i < n; i++)
#define all(in) in.begin(), in.end()
#define rep(i, n) for (int i = 0; i < n; i++)
#define loop(i, s, n) for (int i = s; i < n; i++)
#define all(in) in.begin(), in.end()
#define MP make_pair
#define ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define loop(i, s, n) for (int i = s; i < n; i++)
#define all(in) in.begin(), in.end()
#define rep(i, n) for (int i = 0; i < n; i++)
#define loop(i, s, n) for (int i = s; i < n; i++)
#define all(in) in.begin(), in.end()
#define MP make_pair
#define ... | replace | 72 | 73 | 72 | 73 | 0 | |
p01317 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long ll;
const ll inf = 0x1f1f1f1f1f1f1f1f; //?造了一个三倍之后不会溢出的?.....
const ll maxn = 205;
ll land[maxn][maxn], sea[maxn][maxn], num[maxn], cost[maxn][maxn];
void init(int n) {
memset(land, inf, sizeof(land));
memset(sea, inf, ... | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long ll;
const ll inf = 0x1f1f1f1f1f1f1f1f; //?造了一个三倍之后不会溢出的?.....
const ll maxn = 205;
ll land[maxn][maxn], sea[maxn][maxn], num[maxn * 5], cost[maxn * 5][maxn];
void init(int n) {
memset(land, inf, sizeof(land));
memset(se... | replace | 7 | 8 | 7 | 8 | 0 | |
p01317 | C++ | Runtime Error | // AOJ 2200 (http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2200)
#include <algorithm>
#include <cstdio>
#include <limits>
#include <queue>
#include <vector>
#define rep(i, a) for (int i = 0; i < (a); ++i)
const int MAX_N = 200, MAX_R = 1000, INF = std::numeric_limits<int>::max() >> 4;
int N, M, R;
int land... | // AOJ 2200 (http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2200)
#include <algorithm>
#include <cstdio>
#include <limits>
#include <queue>
#include <vector>
#define rep(i, a) for (int i = 0; i < (a); ++i)
const int MAX_N = 200, MAX_R = 1000, INF = std::numeric_limits<int>::max() >> 4;
int N, M, R;
int land... | replace | 13 | 14 | 13 | 14 | 0 | |
p01317 | C++ | Time Limit Exceeded | #include <algorithm>
#include <climits>
#include <functional>
#include <iostream>
#include <queue>
#include <utility>
#include <cstdio>
using namespace std;
#define REP(var, count) for (int var = 0; var < count; var++)
const int IPPAI = 214748364;
int umi[210][210];
int riku[210][210];
int cmpl[1010][210]; //????... | #include <algorithm>
#include <climits>
#include <functional>
#include <iostream>
#include <queue>
#include <utility>
#include <cstdio>
using namespace std;
#define REP(var, count) for (int var = 0; var < count; var++)
const int IPPAI = 214748364;
int umi[210][210];
int riku[210][210];
int cmpl[1010][210]; //????... | replace | 123 | 125 | 123 | 125 | TLE | |
p01317 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1LL << 50;
ll land[200][200];
ll sea[200][200];
ll dp[1010][200];
int z[1000];
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N, M, R;
while (cin >> N >> M, N) {
fill((ll *)begin(land), (ll *)end(land), INF);
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1LL << 50;
ll land[200][200];
ll sea[200][200];
ll dp[1010][200];
int z[1000];
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N, M, R;
while (cin >> N >> M, N) {
fill((ll *)begin(land), (ll *)end(land), INF);
... | replace | 58 | 59 | 58 | 59 | 0 | |
p01317 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#define maxn 205
#define maxr 1005
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
int fl[maxn][maxn], fs[maxn][maxn], dp[maxr][maxn], n, m, r, a[maxn];
int main() {
while (~scanf("%d%d", &n, &m) && (n + m... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#define maxn 205
#define maxr 1005
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
int fl[maxn][maxn], fs[maxn][maxn], dp[maxr][maxn], n, m, r, a[maxr];
int main() {
while (~scanf("%d%d", &n, &m) && (n + m... | replace | 10 | 11 | 10 | 11 | 0 | |
p01317 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, k, n) for (int i = (k); i < (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))
#define D10 fixed << setprecision(10)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, k, n) for (int i = (k); i < (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))
#define D10 fixed << setprecision(10)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii... | replace | 80 | 81 | 80 | 81 | 0 | |
p01317 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <set>
#include <vector>
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<VVI> VVVI;
const int INF = 1 << 22;
int N, M, R;
void wf(VVI &adj) {
for (int k = 0; k < N; ++k) {
for (int i = 0; i < N; ++i) {
for (int j = 0; j < N... | #include <algorithm>
#include <iostream>
#include <set>
#include <vector>
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<VVI> VVVI;
const int INF = 1 << 22;
int N, M, R;
void wf(VVI &adj) {
for (int k = 0; k < N; ++k) {
for (int i = 0; i < N; ++i) {
for (int j = 0; j < N... | replace | 45 | 46 | 45 | 46 | 0 | |
p01317 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
type... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
type... | replace | 77 | 78 | 77 | 78 | 0 | |
p01317 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define r(i, n) for (int i = 0; i < n; i++)
int v1[203][203], v2[203][203], a1, a2, a3, n, m;
int dp[2][203][203], t, x, pre;
char c;
int main() {
while (cin >> n >> m, n) {
int ans = 1e8;
r(i, 2) r(j, 203) r(k, 203) dp[i][j][k] = 1e8;
r(i, 203) r(j, 203) v1[i... | #include <bits/stdc++.h>
using namespace std;
#define r(i, n) for (int i = 0; i < n; i++)
int v1[203][203], v2[203][203], a1, a2, a3, n, m;
int dp[2][203][203], t, x, pre;
char c;
int main() {
while (cin >> n >> m, n) {
int ans = 1e8;
r(i, 2) r(j, 203) r(k, 203) dp[i][j][k] = 1e8;
r(i, 203) r(j, 203) v1[i... | replace | 11 | 12 | 11 | 12 | 0 | |
p01317 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#define pb push_back
#define all(in) in.begin(), in.end()
#define shosu(x) fixed << setprecision(x)
#define loop(i, a, b) for (int i = a; i <... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#define pb push_back
#define all(in) in.begin(), in.end()
#define shosu(x) fixed << setprecision(x)
#define loop(i, a, b) for (int i = a; i <... | replace | 123 | 124 | 123 | 124 | 0 | |
p01318 | C++ | Time Limit Exceeded | #include <algorithm>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
typedef long long LL;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<int>... | #include <algorithm>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
typedef long long LL;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<int>... | replace | 243 | 244 | 243 | 244 | TLE | |
p01319 | C++ | Runtime Error | #include <algorithm>
#include <assert.h>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <vector>
using namespace std;
typedef long long ll;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s,... | #include <algorithm>
#include <assert.h>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <vector>
using namespace std;
typedef long long ll;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s,... | replace | 30 | 31 | 30 | 31 | 0 | |
p01321 | C++ | Runtime Error | #include <bits/stdc++.h>
#define INF 1 << 29
using namespace std;
int main() {
int a, b;
while (scanf("%d%d", &a), a) {
int MIN = 1 << 29, MAX = -(1 << 29);
for (int c = 0; c < a; c++) {
int s = 0;
int e;
for (int d = 0; d < 5; d++) {
scanf("%d", &e);
s += e;
}
... | #include <bits/stdc++.h>
#define INF 1 << 29
using namespace std;
int main() {
int a, b;
while (scanf("%d", &a), a) {
int MIN = 1 << 29, MAX = -(1 << 29);
for (int c = 0; c < a; c++) {
int s = 0;
int e;
for (int d = 0; d < 5; d++) {
scanf("%d", &e);
s += e;
}
M... | replace | 6 | 7 | 6 | 7 | -11 | |
p01321 | C++ | Time Limit Exceeded | #include <cstring>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
#define INF 10000000
int mini(int a, int b) {
if (a < b) {
return a;
} else {
return b;
}
}
int maxim(int a, int b) {
if (a > b) {
return a;
} else {
return ... | #include <cstring>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
#define INF 10000000
int mini(int a, int b) {
if (a < b) {
return a;
} else {
return b;
}
}
int maxim(int a, int b) {
if (a > b) {
return a;
} else {
return ... | insert | 27 | 27 | 27 | 29 | TLE | |
p01322 | C++ | Time Limit Exceeded | #include <iostream>
#include <stdio.h>
#include <string>
using namespace std;
struct R {
string y;
int C;
};
int main() {
int N, M;
while (1) {
struct R n[101];
cin >> N >> M;
for (int i = 0; i < N; i++) {
cin >> n[i].y;
cin >> n[i].C;
}
string str;
int s = 0;
for (i... | #include <iostream>
#include <stdio.h>
#include <string>
using namespace std;
struct R {
string y;
int C;
};
int main() {
int N, M;
while (1) {
struct R n[101];
cin >> N;
if (N == 0)
break;
cin >> M;
for (int i = 0; i < N; i++) {
cin >> n[i].y;
cin >> n[i].C;
}
... | replace | 17 | 18 | 17 | 21 | TLE | |
p01322 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
bool check(string a, string b) {
for (int i = 0; i < 8; i++) {
if (a[i] == '*')
continue;
if (a[i] != b[i])
return 0;
}
return 1;
}
int main() {
int n, m;
while (1) {
cin >> n >> m;
if (!n && !m)
break;
string a[101], b[101]... | #include <bits/stdc++.h>
using namespace std;
bool check(string a, string b) {
for (int i = 0; i < 8; i++) {
if (a[i] == '*')
continue;
if (a[i] != b[i])
return 0;
}
return 1;
}
int main() {
int n, m;
while (1) {
cin >> n >> m;
if (!n && !m)
break;
string a[101], b[1001... | replace | 19 | 21 | 19 | 21 | 0 | |
p01322 | C++ | Runtime Error | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define f first
#define s second
#define mp make_pair
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define ... | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define f first
#define s second
#define mp make_pair
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define ... | replace | 31 | 32 | 31 | 32 | 0 | |
p01322 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <string>
#include <vector>
#define loop(i, a, b) for (int i = a; i < b; i++)
#define rep(i, a) loop(i, 0, a)
#define pb(in, tmp) in.push_back(tmp)
#define all(in) in.begin(), in.end()
const double PI = acos(-1);
using na... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <string>
#include <vector>
#define loop(i, a, b) for (int i = a; i < b; i++)
#define rep(i, a) loop(i, 0, a)
#define pb(in, tmp) in.push_back(tmp)
#define all(in) in.begin(), in.end()
const double PI = acos(-1);
using na... | replace | 28 | 29 | 28 | 29 | 0 | |
p01323 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
char f[12][6];
bool checked[12][6];
int dx[4] = {0, -1, 0, 1};
int dy[4] = {1, 0, -1, 0};
int checkfrom(int i, int j) {
pair<int, int> tmp;
deque<pair<int, int>> q;
vector<pair<... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
char f[12][6];
bool checked[12][6];
int dx[4] = {0, -1, 0, 1};
int dy[4] = {1, 0, -1, 0};
int checkfrom(int i, int j) {
pair<int, int> tmp;
deque<pair<int, int>> q;
vector<pair<... | replace | 100 | 101 | 100 | 101 | TLE | |
p01324 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
map<string, vector<pair<string, i... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
map<string, vector<pair<string, i... | delete | 31 | 32 | 31 | 31 | TLE | |
p01324 | C++ | Runtime Error | #include <algorithm>
#include <map>
#include <stdio.h>
#include <string>
using namespace std;
char in[30];
int UF[300];
int w[300];
pair<int, int> FIND(int a) {
if (UF[a] < 0)
return make_pair(a, 0);
pair<int, int> ret = FIND(UF[a]);
ret.second += w[a];
return ret;
}
bool ok = true;
void UNION(int a, int b,... | #include <algorithm>
#include <map>
#include <stdio.h>
#include <string>
using namespace std;
char in[30];
int UF[300];
int w[300];
pair<int, int> FIND(int a) {
if (UF[a] < 0)
return make_pair(a, 0);
pair<int, int> ret = FIND(UF[a]);
ret.second += w[a];
return ret;
}
bool ok = true;
void UNION(int a, int b,... | replace | 27 | 30 | 27 | 30 | 0 | |
p01324 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <string>
using namespace std;
const int MAX_M = 101;
const int INF = 1 << 24;
map<string, int> id;
int G[MAX_M][MAX_M];
int M;
int getId(string s) {
if (id.find(s) == id.end()) {
id[s] = M++;
}
return id[s];
}
bool solve() {
for (int k = 0; ... | #include <algorithm>
#include <iostream>
#include <map>
#include <string>
using namespace std;
const int MAX_M = 201;
const int INF = 1 << 24;
map<string, int> id;
int G[MAX_M][MAX_M];
int M;
int getId(string s) {
if (id.find(s) == id.end()) {
id[s] = M++;
}
return id[s];
}
bool solve() {
for (int k = 0; ... | replace | 5 | 6 | 5 | 6 | 0 | |
p01324 | C++ | Time Limit Exceeded | #include <iostream>
#include <list>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
int *find(
std::unordered_map<std::string, std::unordered_map<std::string, int>> *map,
const std::string &s1, const std::string &s2) {
auto it1 = map->find(s1);
if (it1 == map->end())
return NULL;
... | #include <iostream>
#include <list>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
int *find(
std::unordered_map<std::string, std::unordered_map<std::string, int>> *map,
const std::string &s1, const std::string &s2) {
auto it1 = map->find(s1);
if (it1 == map->end())
return NULL;
... | replace | 28 | 30 | 28 | 30 | TLE | |
p01329 | C++ | Memory Limit Exceeded | #include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using na... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using na... | replace | 51 | 52 | 51 | 52 | MLE | |
p01329 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
#define V(x, y, z) ((x)*1000000 + (y)*1000 + (z))
#define inf 1000000000
using namespace std;
int W, H;
char map[55][55];
int P;
string S[15];
int sx, sy, gx, gy;
vector<string> vec;
int Next[105][4];
bool ng[105][4];
const... | #include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
#define V(x, y, z) ((x)*1000000 + (y)*1000 + (z))
#define inf 1000000000
using namespace std;
int W, H;
char map[55][55];
int P;
string S[15];
int sx, sy, gx, gy;
vector<string> vec;
int Next[105][4];
bool ng[105][4];
const... | replace | 118 | 119 | 118 | 119 | 0 | |
p01329 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int INF = 1e8;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
string D = "DRUL";
const int var = 4;
int trans(char c) {
switch (c) {
case 'R':
return 0;
case 'D':
return 1;
case 'L':
return 2;
case 'U':
return 3;
defau... | #include <bits/stdc++.h>
using namespace std;
const int INF = 1e8;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
string D = "DRUL";
const int var = 4;
int trans(char c) {
switch (c) {
case 'R':
return 0;
case 'D':
return 1;
case 'L':
return 2;
case 'U':
return 3;
defau... | replace | 35 | 36 | 35 | 36 | 0 | |
p01334 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(a) (a).begin(), (a).end()
#define pb push_back
#ifdef Debug
#define dump(x) cerr << #x << " = " << (x) << endl
#else
#define dump(x)
#... | #include "bits/stdc++.h"
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(a) (a).begin(), (a).end()
#define pb push_back
#ifdef Debug
#define dump(x) cerr << #x << " = " << (x) << endl
#else
#define dump(x)
#... | replace | 17 | 19 | 17 | 19 | 0 | |
p01335 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef vector<int> vi;
int main() {
int buckets[14];
int buckets2[5];
bool firsttime = true;
while (1) {
int n;
cin >> n;
if (!n)
break;
if... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef vector<int> vi;
int main() {
int buckets[14];
int buckets2[5];
bool firsttime = true;
int n;
while (cin >> n) {
if (!n)
break;
if (!firstt... | replace | 14 | 17 | 14 | 16 | TLE | |
p01335 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
using namespace std;
int h[5], s[5];
int v[13][4];
int m[128];
int k[10];
int H() {
for (int i = 1; i < 5; ++i)
if (s[i] - s[i - 1])
return 0;
return 1;
}
int X() { return h[1] + 1 == h[2] && h[2] + 1 == h[3] && h[3] + 1 == h[4]; }
int S() { return X() && h[0] + 1 ==... | #include <algorithm>
#include <cstdio>
using namespace std;
int h[5], s[5];
int v[13][4];
int m[128];
int k[10];
int H() {
for (int i = 1; i < 5; ++i)
if (s[i] - s[i - 1])
return 0;
return 1;
}
int X() { return h[1] + 1 == h[2] && h[2] + 1 == h[3] && h[3] + 1 == h[4]; }
int S() { return X() && h[0] + 1 ==... | replace | 50 | 51 | 50 | 51 | TLE | |
p01340 | C++ | Time Limit Exceeded | #include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
int H, W;
char c[10][10];
int gr[10][10];
string dir = "LURD";
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
int usd[32];
int getIndex(int x, int y, int dx, int dy) {
x += dx;
y += dy;
while (!(x < 0 || y < 0 || x >= W || y >... | #include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
int H, W;
char c[10][10];
int gr[10][10];
string dir = "LURD";
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};
int usd[32];
int getIndex(int x, int y, int dx, int dy) {
x += dx;
y += dy;
while (!(x < 0 || y < 0 || x >= W || y >... | replace | 56 | 59 | 56 | 59 | TLE | |
p01341 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <stdio.h>
#include <vector>
#define MAX_N 1005
#define MAX_R 20005
using namespace std;
typedef struct edge {
int from, to, cost;
} edge;
bool mcmp(edge x, edge y) { return x.cost < y.cost; }
int uft[MAX_N];
vector<edge> e;
void init(int n) {
int i;
for (i = 0; i... | #include <algorithm>
#include <cmath>
#include <stdio.h>
#include <vector>
#define MAX_N 10005
using namespace std;
typedef struct edge {
int from, to, cost;
} edge;
bool mcmp(edge x, edge y) { return x.cost < y.cost; }
int uft[MAX_N];
vector<edge> e;
void init(int n) {
int i;
for (i = 0; i <= n; i++)
uft... | replace | 4 | 6 | 4 | 5 | 0 | |
p01341 | C++ | Runtime Error | // kruskal tree
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <vector>
using namespace std;
#define M 10000
int parent[M], a[M], b[M];
pair<double, int> node[M];
int root(int a) { return parent[a] == a ? a : parent[a] = root(parent[a]); }
int unite(int a, int b) {
int x = root(a), y = root(b);
if... | // kruskal tree
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <vector>
using namespace std;
#define M 99999
int parent[M], a[M], b[M];
pair<double, int> node[M];
int root(int a) { return parent[a] == a ? a : parent[a] = root(parent[a]); }
int unite(int a, int b) {
int x = root(a), y = root(b);
if... | replace | 6 | 7 | 6 | 7 | 0 | |
p01341 | C++ | Memory Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
struct edge {
int u, v;
double w;
edge() { u = v = w = 0; }
edge(int uu, int vv, double ww) {
u = uu;
v = vv;
w = ww;
}
bool operator<(const edge &b) const { return w > b.w; }
};
... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
struct edge {
int u, v;
double w;
edge() { u = v = w = 0; }
edge(int uu, int vv, double ww) {
u = uu;
v = vv;
w = ww;
}
bool operator<(const edge &b) const { return w > b.w; }
};
... | replace | 30 | 32 | 30 | 32 | MLE | |
p01341 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <stdio.h>
#include <string.h>
#include <vector>
#define N 100005
#define P pair<int, int>
#define ll long long
#define mk(a, b) make_pair(a, b)
#define mem(a, b) memset(a, b, sizeof(a))
using namespace s... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <stdio.h>
#include <string.h>
#include <vector>
#define N 100005
#define P pair<int, int>
#define ll long long
#define mk(a, b) make_pair(a, b)
#define mem(a, b) memset(a, b, sizeof(a))
using namespace s... | replace | 81 | 84 | 81 | 84 | 0 | |
p01341 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
struct Way {
int p, q, cost;
Way() {}
Way(int _p, int _q, int _cost) {
p = _p;
q = _q;
cost = _cost;
}
bool operator<(const Way &a) const { return cost > a.cost; }
};
struct Node {
... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
struct Way {
int p, q, cost;
Way() {}
Way(int _p, int _q, int _cost) {
p = _p;
q = _q;
cost = _cost;
}
bool operator<(const Way &a) const { return cost > a.cost; }
};
struct Node {
... | replace | 53 | 54 | 53 | 54 | -11 | |
p01341 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
int n, m;
struct edge {
int u, v;
double w;
edge(int _u, int _v, double _w) : u(_u), v(_v), w(_w) ... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
int n, m;
struct edge {
int u, v;
double w;
edge(int _u, int _v, double _w) : u(_u), v(_v), w(_w) ... | replace | 19 | 20 | 19 | 20 | 0 | |
p01341 | C++ | Runtime Error | /*
Á·Ï°Ì⣺Save your cats_AOJ 2224
¼õÈ¥×îÉÙ¡¢Ð¡µÄ±ß£¬Ê¹µÃÕû¸öÆ½ÃæÁ¬Í¨£»
¼´ÎªÇó×î´óÉú³ÉÊ÷ÎÊÌ⣬µ«×¢ÒâÇóµÄÊDzÃÈ¥µÄ·¾¶¡£
*/
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
const int MAX_E = 10007, MAX_V = 10007;
int mark[MAX_E];
pair<int, int> ver[MAX_V];... | /*
Á·Ï°Ì⣺Save your cats_AOJ 2224
¼õÈ¥×îÉÙ¡¢Ð¡µÄ±ß£¬Ê¹µÃÕû¸öÆ½ÃæÁ¬Í¨£»
¼´ÎªÇó×î´óÉú³ÉÊ÷ÎÊÌ⣬µ«×¢ÒâÇóµÄÊDzÃÈ¥µÄ·¾¶¡£
*/
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
const int MAX_E = 49995007, MAX_V = 10007;
int mark[MAX_E];
pair<int, int> ver[MAX_... | replace | 12 | 13 | 12 | 13 | 0 | |
p01341 | C++ | Runtime Error | /*
* @Author: 王文宇
* @Date: 2018-03-14 23:59:01
* @Last Modified by: 王文宇
* @Last Modified time: 2018-03-15 00:12:07
*/
#include <bits/stdc++.h>
using namespace std;
const int maxn = 10007;
#define _for(i, a, b) for (int i = a; i <= b; i++)
int n, m, fa[maxn];
struct node {
int x, y;
double length;
} a[maxn]... | /*
* @Author: 王文宇
* @Date: 2018-03-14 23:59:01
* @Last Modified by: 王文宇
* @Last Modified time: 2018-03-15 00:12:07
*/
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000007;
#define _for(i, a, b) for (int i = a; i <= b; i++)
int n, m, fa[maxn];
struct node {
int x, y;
double length;
} a[max... | replace | 8 | 9 | 8 | 9 | 0 | |
p01342 | C++ | Runtime Error | #include <cstdio>
#include <queue>
#include <set>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
inline int getInt() {
int s;
scanf("%d", &s);
return s;
}
#define IN(x, s, g) ((x) >= (s) && (x) < (g))
#define ISIN(x, y, w, h) (IN((x), 0, (w)) && IN((y), 0, (h)))
using namespace std;
int wall[50][50][4];... | #include <cstdio>
#include <queue>
#include <set>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
inline int getInt() {
int s;
scanf("%d", &s);
return s;
}
#define IN(x, s, g) ((x) >= (s) && (x) < (g))
#define ISIN(x, y, w, h) (IN((x), 0, (w)) && IN((y), 0, (h)))
using namespace std;
int wall[64][64][4];... | replace | 16 | 17 | 16 | 17 | 0 | |
p01342 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <map>
#include <queue>
#include <stack>
#include <utility>
#include <vector>
#define pb push_back
#define sz(x) (int)x.size()
#define scf scanf
#define ptf printf
#define forp(i, j, k) for (int i = j; i < k; i++)
#define form(i, j, k) f... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <map>
#include <queue>
#include <stack>
#include <utility>
#include <vector>
#define pb push_back
#define sz(x) (int)x.size()
#define scf scanf
#define ptf printf
#define forp(i, j, k) for (int i = j; i < k; i++)
#define form(i, j, k) f... | insert | 54 | 54 | 54 | 58 | 0 | |
p01342 | C++ | Runtime Error | #include <cstdio>
#include <queue>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
const int INF = 1 << 29;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
int bfs(int h, int w, const bool B[99][99], int sy, int sx, int ty, int tx) {
int d[99][99];
rep(i, h) rep(j, w) d[i][j] = INF;
... | #include <cstdio>
#include <queue>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
const int INF = 1 << 29;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
int bfs(int h, int w, const bool B[99][99], int sy, int sx, int ty, int tx) {
int d[99][99];
rep(i, h) rep(j, w) d[i][j] = INF;
... | replace | 57 | 58 | 57 | 58 | 0 | |
p01347 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>
#define all(x) (x).begin(), (x).end()
#define size(x) ((int)(x).size())
#define FIRST first
#define SECOND second
#define FRONT front
#define PUSH_BACK push_back
#define MAKE_PAIR make_pair
... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>
#define all(x) (x).begin(), (x).end()
#define size(x) ((int)(x).size())
#define FIRST first
#define SECOND second
#define FRONT front
#define PUSH_BACK push_back
#define MAKE_PAIR make_pair
... | replace | 99 | 101 | 99 | 101 | -11 | |
p01349 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#define N 32
using namespace std;
int Erase();
int Cnt(int, int, string);
int h, w, n;
string cp[N];
int main() {
int r, flag, i, j, k;
string in[N];
cin >> h >> w >> n;
for (i = 0; i <= w + 1; i++)
in[0] += 'x', in[h + 1] += 'x';
for (i = 1; i <= h; i++)
cin >... | #include <algorithm>
#include <iostream>
#define N 35
using namespace std;
int Erase();
int Cnt(int, int, string);
int h, w, n;
string cp[N];
int main() {
int r, flag, i, j, k;
string in[N];
cin >> h >> w >> n;
for (i = 0; i <= w + 1; i++)
in[0] += 'x', in[h + 1] += 'x';
for (i = 1; i <= h; i++)
cin >... | replace | 2 | 3 | 2 | 3 | 0 | |
p01349 | C++ | Time Limit Exceeded | #include <stdio.h>
#include <string.h>
void swap(char *a, char *b) {
char tmp;
tmp = *a;
*a = *b;
*b = tmp;
}
int h, w;
char t[30][31];
void fall(void) {
int i, j, k;
for (i = h - 2; i >= 0; i--) {
for (j = 0; j < w; j++) {
if (t[i + 1][j] == '.') {
for (k = i; k < h && t[k + 1][j] == '... | #include <stdio.h>
#include <string.h>
void swap(char *a, char *b) {
char tmp;
tmp = *a;
*a = *b;
*b = tmp;
}
int h, w;
char t[30][31];
void fall(void) {
int i, j, k;
for (i = h - 2; i >= 0; i--) {
for (j = 0; j < w; j++) {
if (t[i + 1][j] == '.') {
for (k = i; k < h && t[k + 1][j] == '... | delete | 71 | 73 | 71 | 71 | TLE | |
p01350 | C++ | Memory Limit Exceeded | #include <algorithm>
#include <cmath>
#include <complex>
#include <iostream>
#include <vector>
using namespace std;
const int MAX = 1e5 + 1;
const double EPS = 1e-6;
const double INF = 1e18;
const double PI = acos(-1);
typedef complex<double> P;
double angle(P a, P b) { return abs(arg(a / b)); }
int main() {
int n;... | #include <algorithm>
#include <cmath>
#include <complex>
#include <iostream>
#include <vector>
using namespace std;
const int MAX = 1e4 + 1;
const double EPS = 1e-6;
const double INF = 1e18;
const double PI = acos(-1);
typedef complex<double> P;
double angle(P a, P b) { return abs(arg(a / b)); }
int main() {
int n;... | replace | 6 | 7 | 6 | 7 | MLE | |
p01350 | C++ | Memory Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repl(i, 0, n)
#define each(itr, v) for (auto itr : v)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define dbg(x) cout ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repl(i, 0, n)
#define each(itr, v) for (auto itr : v)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define dbg(x) cout ... | replace | 64 | 65 | 64 | 65 | MLE | |
p01350 | C++ | Memory Limit Exceeded | #include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <set>
#include <vector>
using namespace std;
typedef long long ll;
typedef long double R;
typedef complex<R> P;
const R EPS = 1e-10;
const R INF = 1e9;
const ... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <set>
#include <vector>
using namespace std;
typedef long long ll;
typedef double R;
typedef complex<R> P;
const R EPS = 1e-10;
const R INF = 1e9;
const R PI ... | replace | 14 | 15 | 14 | 15 | MLE | |
p01350 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define INF 1e9
using namespace std;
struct P {
double cost;
int pos, pre, num;
P(double cost, int pos, int pre, int num)
: cost(cost), pos(pos), pre(pre), num(num) {}
bool operator<(const P &a) const { return cost < a.cost; }
};
typedef complex<double> point;
point z[21];
int n;
... | #include <bits/stdc++.h>
#define INF 1e9
using namespace std;
struct P {
double cost;
int pos, pre, num;
P(double cost, int pos, int pre, int num)
: cost(cost), pos(pos), pre(pre), num(num) {}
bool operator<(const P &a) const { return cost > a.cost; }
};
typedef complex<double> point;
point z[21];
int n;
... | replace | 8 | 9 | 8 | 9 | TLE | |
p01351 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <numeric>
#include <queue>
#include <set>
inline int getInt() {
int s;
scanf("%d", &s);
return s;
}
typedef long long ll;
using namespace std;
int check(int a, int m) {
vector<int> visit(m);
int now = 0;
while (!visit[now]) {
visit[now] = 1;
now =... | #include <algorithm>
#include <cstdio>
#include <numeric>
#include <queue>
#include <set>
inline int getInt() {
int s;
scanf("%d", &s);
return s;
}
typedef long long ll;
using namespace std;
int check(int a, int m) {
vector<int> visit(m);
int now = 0;
while (!visit[now]) {
visit[now] = 1;
now =... | insert | 68 | 68 | 68 | 75 | TLE | |
p01352 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
#define fi first
#define se second
#define repl(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
#define rep(i, n) repl(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define dbg(x) cerr << #x ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
#define fi first
#define se second
#define repl(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
#define rep(i, n) repl(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define dbg(x) cerr << #x ... | replace | 24 | 25 | 24 | 25 | TLE | |
p01352 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define for_(i, a, b) for (int i = (a); i < (b); ++i)
#define allof(a) (a).begin(), (a).end()
typedef pair<int, int> pii;
struct Edge : pii {
Edge(int u, int v) : pii(u, v) {}
int u() { return first; }
int v() { return second; }
};
class UnionFind {
private:
vect... | #include <bits/stdc++.h>
using namespace std;
#define for_(i, a, b) for (int i = (a); i < (b); ++i)
#define allof(a) (a).begin(), (a).end()
typedef pair<int, int> pii;
struct Edge : pii {
Edge(int u, int v) : pii(u, v) {}
int u() { return first; }
int v() { return second; }
};
class UnionFind {
private:
vect... | replace | 43 | 44 | 43 | 44 | TLE | |
p01352 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> pint;
typedef vector<int> vint;
typedef vector<pint> vpint;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#def... | #include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> pint;
typedef vector<int> vint;
typedef vector<pint> vpint;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#def... | replace | 26 | 27 | 26 | 27 | TLE | |
p01352 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define set unordered_set
#define map unordered_map
using namespace std;
class UnionFind {
private:
int size;
int parent[40000];
int rank[40000];
public:
UnionFind() {}
UnionFind(int sz) { init(sz); }
void init(int sz) {
size = sz;
fill(rank, rank + sz, 0);
for (int ... | #include <bits/stdc++.h>
#define set unordered_set
#define map unordered_map
using namespace std;
class UnionFind {
private:
int size;
int parent[40000];
int rank[40000];
public:
UnionFind() {}
UnionFind(int sz) { init(sz); }
void init(int sz) {
size = sz;
fill(rank, rank + sz, 0);
for (int ... | replace | 52 | 53 | 52 | 53 | TLE | |
p01352 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define set unordered_set
#define map unordered_map
using namespace std;
class UnionFind {
private:
int size;
int parent[40000];
int rank[40000];
public:
UnionFind() {}
UnionFind(int sz) { init(sz); }
void init(int sz) {
size = sz;
fill(rank, rank + sz, 0);
for (int ... | #include <bits/stdc++.h>
#define set unordered_set
#define map unordered_map
using namespace std;
class UnionFind {
private:
int size;
int parent[40000];
int rank[40000];
public:
UnionFind() {}
UnionFind(int sz) { init(sz); }
void init(int sz) {
size = sz;
fill(rank, rank + sz, 0);
for (int ... | replace | 52 | 53 | 52 | 53 | TLE | |
p01352 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < ... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < ... | replace | 25 | 27 | 25 | 26 | TLE | |
p01353 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repl(i, 0, n)
#define mp(a, b) make_pair((a), (b))
#define pb(a) push_back((a))
#define all(x) (x).begin(), (x).end()
#define uniq(x) sort(all(x)), (x).erase(unique(all(x)), end(x))
#define fi... | #include <bits/stdc++.h>
using namespace std;
#define repl(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repl(i, 0, n)
#define mp(a, b) make_pair((a), (b))
#define pb(a) push_back((a))
#define all(x) (x).begin(), (x).end()
#define uniq(x) sort(all(x)), (x).erase(unique(all(x)), end(x))
#define fi... | replace | 36 | 37 | 36 | 37 | 0 | |
p01353 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long i64;
typedef long double ld;
#define rep(i, s, e) for (int i = (s); i <= (e); i++)
int n;
i64 h[40404];
i64 a[40404];
i64 d[40404];
i64 s[... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long i64;
typedef long double ld;
#define rep(i, s, e) for (int i = (s); i <= (e); i++)
int n;
i64 h[40404];
i64 a[40404];
i64 d[40404];
i64 s[... | replace | 51 | 52 | 51 | 52 | 0 | |
p01353 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef long long int lli;
struct info {
int h, a;
double rate;
info(int h, int a, double r) : h(h), a(a), rate(r) {}
info() {}
};
bool comp(const info &a, const info &b) { return a.rate > b.rate; }
int main() {
int n;
cin >> ... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef long long int lli;
struct info {
int h, a;
double rate;
info(int h, int a, double r) : h(h), a(a), rate(r) {}
info() {}
};
bool comp(const info &a, const info &b) { return a.rate > b.rate; }
int main() {
int n;
cin >> ... | replace | 47 | 48 | 47 | 48 | 0 | |
p01354 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
typedef double real;
real dp[2][17][1 << 16];
int n, m;
real p[17][17];
int main() {
cin >> m >> n;
for (int i = 0; i < m; i++)
for (int j = 0; j < n; j++)
cin >> p[i][j];
for (int j = 0; j < 17; j++)
for (int k = 0; ... | #include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
typedef double real;
real dp[2][17][1 << 16];
int n, m;
real p[17][17];
int main() {
cin >> m >> n;
for (int i = 0; i < m; i++)
for (int j = 0; j < n; j++)
cin >> p[i][j];
for (int j = 0; j < 17; j++)
for (int k = 0; ... | replace | 22 | 23 | 22 | 23 | 0 | |
p01354 | C++ | Runtime Error | #include <cstdio>
#include <iostream>
using namespace std;
int m, n;
double prob[16][16];
double dp[16][1 << 16];
double search(int pos, int cat) {
if (dp[pos][cat] > -0.5)
return dp[pos][cat];
double &res = dp[pos][cat];
res = 0.0;
for (int i = 0; i < m; i++) {
if (cat & (1 << i))
continue;
... | #include <cstdio>
#include <iostream>
using namespace std;
int m, n;
double prob[16][16];
double dp[16][1 << 16];
double search(int pos, int cat) {
if (dp[pos][cat] > -0.5)
return dp[pos][cat];
double &res = dp[pos][cat];
res = 0.0;
for (int i = 0; i < m; i++) {
if (cat & (1 << i))
continue;
... | replace | 35 | 36 | 35 | 36 | 0 | |
p01354 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG_MODE
#define DBG(n) n;
#else
#define DBG(n) ;
#endif
#define REP(i, n) for (ll(i) = (0); (i) < (n); ++i)
#define rep(i, s, g) for (ll(i) = (s); (i) < (g); ++i)
#define rrep(i, s, g) for (ll(i) = (s); i >= (g); --(i))
#define PB push_back
#define MP make_pair
... | #include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG_MODE
#define DBG(n) n;
#else
#define DBG(n) ;
#endif
#define REP(i, n) for (ll(i) = (0); (i) < (n); ++i)
#define rep(i, s, g) for (ll(i) = (s); (i) < (g); ++i)
#define rrep(i, s, g) for (ll(i) = (s); i >= (g); --(i))
#define PB push_back
#define MP make_pair
... | replace | 61 | 62 | 61 | 62 | TLE | |
p01354 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
using namespace std;
long double x[20][20], m, n, neko[20][20][20], dp[20][100000];
long double solve(int pos, int ret) {
if (pos == n)
return 1.0l;
if (dp[pos][ret] >= -0.1l)
return dp[pos][ret];
long double maxn = 0.0l;
for (int i = 0; i < m; i++) {
if ((re... | #include <algorithm>
#include <iostream>
using namespace std;
long double x[20][20], m, n, neko[20][20][20], dp[20][100000];
inline long double solve(int pos, int ret) {
if (pos == n)
return 1.0l;
if (dp[pos][ret] >= -0.1l)
return dp[pos][ret];
long double maxn = 0.0l;
for (int i = 0; i < m; i++) {
... | replace | 4 | 5 | 4 | 5 | TLE | |
p01354 | C++ | Time Limit Exceeded | #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))
#define D10 fixed << setprecision(10)
typedef long long ll;
typedef long double ld;
typedef vector<int> v... | #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))
#define D10 fixed << setprecision(10)
typedef long long ll;
typedef double ld;
typedef vector<int> vi;
ty... | replace | 8 | 9 | 8 | 9 | TLE | |
p01354 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
// ld dp[17][1 << 16] = {0}; // dp[next enemy][used cat]
int N, M;
ld P[16][16];
bool m1[16][1 << 16] = {0};
ld m2[16][1 << 16];
ld dp(int n, int rest) {
if (n >= N)
return (ld)1;
if (m1[n][rest])
return m2[n]... | #include <bits/stdc++.h>
using namespace std;
typedef double ld;
// ld dp[17][1 << 16] = {0}; // dp[next enemy][used cat]
int N, M;
ld P[16][16];
bool m1[16][1 << 16] = {0};
ld m2[16][1 << 16];
ld dp(int n, int rest) {
if (n >= N)
return (ld)1;
if (m1[n][rest])
return m2[n][rest];
ld ret = 0;
fo... | replace | 4 | 6 | 4 | 5 | TLE | |
p01354 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define reps(i, f, n) for (int i = f; i < int(n); i++)
#define rep(i, n) reps(i, 0, n)
const int N = 4;
const int M = 16;
const int T = (1 << N);
const double INF = (1 << 30);
int n, m;
double cat[N][... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define reps(i, f, n) for (int i = f; i < int(n); i++)
#define rep(i, n) reps(i, 0, n)
const int N = 16;
const int M = 16;
const int T = (1 << N);
const double INF = (1 << 30);
int n, m;
double cat[N]... | replace | 11 | 12 | 11 | 12 | 0 | |
p01354 | 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<vector<ld>> pers;
ld memo[16][1 << 16];
bool ok[16][1 << 16];
int M, N;
ld check(const int now, bitset<16> &... | #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<vector<ld>> pers;
ld memo[16][1 << 16];
bool ok[16][1 << 16];
int M, N;
ld check(const int now, bitset<16> &... | replace | 14 | 15 | 14 | 15 | TLE | |
p01356 | C++ | Memory Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define fi first
#define se second
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<pint> vpint;
template <typename A, ty... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define fi first
#define se second
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<pint> vpint;
template <typename A, ty... | replace | 54 | 55 | 54 | 55 | MLE | |
p01358 | C++ | Runtime Error | #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 | 40 | 41 | 40 | 41 | 0 | |
p01358 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, u, v, m, in, ru, cu, rn, cn, countu = 0, countn = 0;
bool uw = false, nw = false;
cin >> n >> u >> v >> m;
vector<int> rowu(n, 0), colu(n, 0), crsu(2, 0), rown(n, 0), coln(n, 0),
crsn(2, 0);
vector<pair<int, int>> dicu(100000, make_pair(-... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, u, v, m, in, ru, cu, rn, cn, countu = 0, countn = 0;
bool uw = false, nw = false;
cin >> n >> u >> v >> m;
vector<int> rowu(n, 0), colu(n, 0), crsu(2, 0), rown(n, 0), coln(n, 0),
crsn(2, 0);
vector<pair<int, int>> dicu(1000000, make_pair(... | replace | 8 | 10 | 8 | 10 | 0 | |
p01358 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <fstream>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, a, b) for (int i = a; i... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <fstream>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, a, b) for (int i = a; i... | replace | 26 | 27 | 26 | 27 | 0 | |
p01359 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <vector>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main() {
while (1) {
int n, q;
cin >> n >> q;
if (!n)
break;
vector<tuple<int, int, string>> v;
REP(i, n) {
strin... | #include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <vector>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main() {
while (1) {
int n, q;
cin >> n >> q;
if (!n)
break;
vector<tuple<int, int, string>> v;
REP(i, n) {
strin... | replace | 29 | 31 | 29 | 35 | 0 | |
p01359 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#define REP(i, a, n) for (int i = (a); i < (n); i++)
#define INF 1000000000000LL
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef pair<long, long> pll;
typedef pair<pll, string> pls;
int N, Q, Y, W;
string Name;
pls E[1000];
int main(void) ... | #include <algorithm>
#include <iostream>
#define REP(i, a, n) for (int i = (a); i < (n); i++)
#define INF 1000000000000LL
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef pair<long, long> pll;
typedef pair<pll, string> pls;
int N, Q, Y, W;
string Name;
pls E[1001];
int main(void) ... | replace | 13 | 14 | 13 | 14 | 0 | |
p01360 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctype.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctype.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define... | replace | 22 | 23 | 22 | 23 | 0 | |
p01360 | C++ | Runtime Error | #include <iostream>
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); ++i)
int dp[2][2][9];
bool valid(int left, int right) {
if (left == right)
return false;
left %= 3;
right %= 3;
return left <= right;
}
int main() {
string str;
while (true) {
cin >> str;
if (str == "#")
... | #include <iostream>
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); ++i)
int dp[2][2][9];
bool valid(int left, int right) {
if (left == right)
return false;
left %= 3;
right %= 3;
return left <= right;
}
int main() {
string str;
while (true) {
cin >> str;
if (str == "#")
... | replace | 36 | 37 | 36 | 37 | 0 | |
p01361 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <... | replace | 52 | 54 | 52 | 54 | 0 | |
p01361 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const int vy[] = {-1, 1, 0, 0};
const int vx[] = {0, 0, -1, 1};
const string temp = "UDLR";
int main() {
vector<int> buff[13][1 << 12];
for (int k = 0; k < 13; k++) {
for (int i = 0; i < 1 << k; i++) {
for (int j = 0; j < 1 << k; j++) {
if (i & j)
... | #include <bits/stdc++.h>
using namespace std;
const int vy[] = {-1, 1, 0, 0};
const int vx[] = {0, 0, -1, 1};
const string temp = "UDLR";
int main() {
vector<int> buff[13][1 << 12];
for (int k = 0; k < 13; k++) {
for (int i = 0; i < 1 << k; i++) {
for (int j = 0; j < 1 << k; j++) {
if (i & j)
... | insert | 70 | 70 | 70 | 71 | TLE | |
p01362 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <v... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <v... | replace | 65 | 66 | 65 | 71 | 0 | |
p01366 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
constexpr int maxN = 10005;
constexpr int maxM = 40005;
int N, M;
int adj[maxN], gto[maxM], gnxt[maxM], length[maxM], cost[maxM], e;
void add_edge(int u, int v, int d, int c) {
gto[e] = v;
length[e] = d;
cost[e] = c;
gnxt[e] = ad... | #include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
constexpr int maxN = 10005;
constexpr int maxM = 400005;
int N, M;
int adj[maxN], gto[maxM], gnxt[maxM], length[maxM], cost[maxM], e;
void add_edge(int u, int v, int d, int c) {
gto[e] = v;
length[e] = d;
cost[e] = c;
gnxt[e] = a... | replace | 7 | 8 | 7 | 8 | 0 | |
p01366 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
#include <queue>
using namespace std;
#define MAXN 10005
#define MAXM 20005
struct Edge {
int id, len, cos;
int nxt;
Edge() {}
Edge(int i, int l, int c) {
id = i;
len = l;
cos = c;
}
} E[MAXM];
int V[MAXN], cur;
void add_edge(int u, int v, int length, int cost)... | #include <cstdio>
#include <cstring>
#include <queue>
using namespace std;
#define MAXN 10005
#define MAXM 20005
struct Edge {
int id, len, cos;
int nxt;
Edge() {}
Edge(int i, int l, int c) {
id = i;
len = l;
cos = c;
}
} E[MAXM * 2];
int V[MAXN], cur;
void add_edge(int u, int v, int length, int c... | replace | 15 | 16 | 15 | 16 | 0 | |
p01366 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
#include <queue>
using namespace std;
#define MAXN 10005
#define MAXM 20005
struct Edge {
int id, len, cos;
int nxt;
Edge() {}
Edge(int i, int l, int c) {
id = i;
len = l;
cos = c;
}
} E[MAXM];
int V[MAXN], cur;
void add_edge(int u, int v, int length, int cost)... | #include <cstdio>
#include <cstring>
#include <queue>
using namespace std;
#define MAXN 10005
#define MAXM 20005
struct Edge {
int id, len, cos;
int nxt;
Edge() {}
Edge(int i, int l, int c) {
id = i;
len = l;
cos = c;
}
} E[2 * MAXM];
int V[MAXN], cur;
void add_edge(int u, int v, int length, int c... | replace | 15 | 16 | 15 | 16 | 0 | |
p01366 | C++ | Runtime Error | #include <iostream>
#include <map>
#include <memory.h>
#include <set>
#include <stdio.h>
#include <vector>
using namespace std;
const bool SUBMIT = 0;
struct Edge {
int v, d, c;
bool operator<(const Edge &b) const {
// return d < b.d || d == b.d && c < b.c ;
return (d == b.d) ? ((c == b.c) ? v < b.v : c < b... | #include <iostream>
#include <map>
#include <memory.h>
#include <set>
#include <stdio.h>
#include <vector>
using namespace std;
const bool SUBMIT = 1;
struct Edge {
int v, d, c;
bool operator<(const Edge &b) const {
// return d < b.d || d == b.d && c < b.c ;
return (d == b.d) ? ((c == b.c) ? v < b.v : c < b... | replace | 7 | 8 | 7 | 8 | -11 | |
p01366 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef pair<int, int> P;
struct st {
int a, b, c;
};
list<st> E[10000];
int d[10000], c[10000];
int main() {
int n, m;
while (scanf("%d%d", &n, &m), n) {
rep(i, n) E[i].clear();
rep(i, m) {
int u, v, d, c... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef pair<int, int> P;
struct st {
int a, b, c;
};
vector<st> E[10000];
int d[10000], c[10000];
int main() {
int n, m;
while (scanf("%d%d", &n, &m), n) {
rep(i, n) E[i].clear();
rep(i, m) {
int u, v, d,... | replace | 8 | 9 | 8 | 9 | TLE | |
p01366 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
typedef long long ll;
const int maxn = 1e4 + 5, maxm = 4e4 + 5;
const ll inf = 1e18;
inline int fa(int u) { return u / 2; }
inline int ls(int u) { return u * 2; }
inline int rs(int u) { return u * 2 + 1; }
struct heap {
int hea[maxn], pos[m... | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 5, maxm = 4e5 + 5;
const ll inf = 1e18;
inline int fa(int u) { return u / 2; }
inline int ls(int u) { return u * 2; }
inline int rs(int u) { return u * 2 + 1; }
struct heap {
int hea[maxn], pos[m... | replace | 5 | 6 | 5 | 6 | 0 | |
p01366 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
typedef long long ll;
const int maxn = 2e4 + 5, maxm = 4e5 + 5;
const ll inf = 1e18;
inline int fa(int u) { return u / 2; }
inline int ls(int u) { return u * 2; }
inline int rs(int u) { return u * 2 + 1; }
struct heap {
int hea[maxn], pos[m... | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
typedef long long ll;
const int maxn = 5e4 + 5, maxm = 4e5 + 5;
const ll inf = 1e18;
inline int fa(int u) { return u / 2; }
inline int ls(int u) { return u * 2; }
inline int rs(int u) { return u * 2 + 1; }
struct heap {
int hea[maxn], pos[m... | replace | 5 | 6 | 5 | 6 | 0 | |
p01366 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
typedef long long ll;
const int maxn = 3.5e4 + 5, maxm = 4e5 + 5;
const ll inf = 1e18;
inline int fa(int u) { return u / 2; }
inline int ls(int u) { return u * 2; }
inline int rs(int u) { return u * 2 + 1; }
struct heap {
int hea[maxn], pos... | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
typedef long long ll;
const int maxn = 4e4 + 5, maxm = 1e5 + 5;
const ll inf = 1e18;
inline int fa(int u) { return u / 2; }
inline int ls(int u) { return u * 2; }
inline int rs(int u) { return u * 2 + 1; }
struct heap {
int hea[maxn], pos[m... | replace | 5 | 6 | 5 | 6 | 0 | |
p01366 | C++ | Runtime Error | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
typedef long long ll;
const int maxn = 1e4 + 5, maxm = 2e4 + 5;
const ll inf = 1e18;
inline int fa(int u) { return u / 2; }
inline int ls(int u) { return u * 2; }
inline int rs(int u) { return u * 2 + 1; }
struct heap {
int hea[maxn], pos[m... | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
typedef long long ll;
const int maxn = 1e4 + 5, maxm = 4e4 + 5;
const ll inf = 1e18;
inline int fa(int u) { return u / 2; }
inline int ls(int u) { return u * 2; }
inline int rs(int u) { return u * 2 + 1; }
struct heap {
int hea[maxn], pos[m... | replace | 5 | 6 | 5 | 6 | 0 | |
p01366 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <numeric>
#include <queue>
#include <vector>
using namespace std;
#define MAX_N 1005
#define MAX_M 100005
#define INF 1e9 + 1
int n, m, x;
struct edge {
int to, dis, cost;
edge();
edge(int to, int dis, int cost... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <numeric>
#include <queue>
#include <vector>
using namespace std;
#define MAX_N 10006
#define MAX_M 20000
#define INF 1e9 + 1
int n, m, x;
struct edge {
int to, dis, cost;
edge();
edge(int to, int dis, int cost... | replace | 9 | 11 | 9 | 11 | 0 | |
p01366 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
using namespace std;
#define GET_ARG(a, b, c, F, ...) F
#define REP3(i, s, e) for (i = s; i <= e; i++)
#define REP2(i, n) REP3(i, 0, (int)(n)-1)
#define REP(...) GET_ARG(__VA_... | #include <algorithm>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
using namespace std;
#define GET_ARG(a, b, c, F, ...) F
#define REP3(i, s, e) for (i = s; i <= e; i++)
#define REP2(i, n) REP3(i, 0, (int)(n)-1)
#define REP(...) GET_ARG(__VA_... | replace | 22 | 23 | 22 | 23 | 0 | |
p01366 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespac... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespac... | replace | 97 | 98 | 97 | 98 | 0 | |
p01368 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const int N = 100;
const int L = 1000;
const int INF = 1e+8 + 10;
const int MAX_V = L * 2 + 2;
struct data {
int p, t;
data(int p = 0, int t = 0) : p(p), t(t) {}
bool operator<(const data &d) const { return t < d.t; }
};
struct edge {
int to, cap, rev;
edge(int... | #include <bits/stdc++.h>
using namespace std;
const int N = 100;
const int L = 1000;
const int INF = 1e+8 + 10;
const int MAX_V = L * 2 + 2;
struct data {
int p, t;
data(int p = 0, int t = 0) : p(p), t(t) {}
bool operator<(const data &d) const { return t < d.t; }
};
struct edge {
int to, cap, rev;
edge(int... | replace | 25 | 27 | 25 | 26 | TLE | |
p01368 | C++ | Runtime Error | // include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#inc... | // include
//------------------------------------------
#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#inc... | replace | 59 | 60 | 59 | 60 | 0 | |
p01368 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
using namespace std;
const int vmax = 1010;
int X, Y;
vector<int> graph[vmax];
int match[vmax];
bool used[vmax];
bool dfs(int v) {
used[v] = true;
for (auto &u : graph[v]) {
int w = match[u];
if (w < 0 || (!used[w] && dfs(w))) ... | #include <bits/stdc++.h>
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
using namespace std;
const int vmax = 2010;
int X, Y;
vector<int> graph[vmax];
int match[vmax];
bool used[vmax];
bool dfs(int v) {
used[v] = true;
for (auto &u : graph[v]) {
int w = match[u];
if (w < 0 || (!used[w] && dfs(w))) ... | replace | 4 | 5 | 4 | 5 | 0 | |
p01368 | C++ | Runtime Error | #include <algorithm>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
#define LINF (1LL << 60)
#define INF (1 << 30)
#define MAX_N 2160
typedef long long Int;
struct E {
int to, rev;
Int lim;
E(int x, Int y, int z) {
to = x;
lim = y;
rev = z;
}
};
vecto... | #include <algorithm>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
#define LINF (1LL << 60)
#define INF (1 << 30)
#define MAX_N 2160
typedef long long Int;
struct E {
int to, rev;
Int lim;
E(int x, Int y, int z) {
to = x;
lim = y;
rev = z;
}
};
vecto... | replace | 86 | 87 | 86 | 87 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.