#include "coprobber.h"
#include <bits/stdc++.h>
#define ft first
#define sd second
using namespace std;
typedef pair<int, int> pii;
typedef pair<int, pii> tip;
const int MAXN = 500 + 3;
int st, dd[MAXN], d[MAXN][MAXN], par[MAXN][MAXN];
queue<tip> q;
bitset<MAXN> mark[2 + 1][MAXN];
int start(int n, bool a[MAX_N][MAX_N]) {
return 8;
for (int i = 0; i < 2; i++) for (int j = 0; j < n; j++) {
q.push({i, {j, j}});
mark[i][j][j] = true;
}
for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) dd[i] += a[i][j];
for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) d[i][j] = dd[j];
while (!q.empty()) {
tip x = q.front();
q.pop();
if (x.ft == 0) {
for (int i = 0; i < n; i++) if (a[i][x.sd.sd]) if (--d[x.sd.ft][i] == 0 && !mark[1][x.sd.ft][i]) {
q.push({1, {x.sd.ft, i}});
mark[1][x.sd.ft][i] = true;
}
} else {
for (int i = 0; i < n; i++) if (i == x.sd.ft || a[i][x.sd.ft] == 1) if (!mark[0][i][x.sd.sd]) {
q.push({0, {i, x.sd.sd}});
par[i][x.sd.sd] = x.sd.ft;
mark[0][i][x.sd.sd] = true;
}
}
}
for (int i = 0; i < n; i++) {
bool z = true;
for (int j = 0; j < n; j++) z &= mark[0][i][j];
if (z) return st = i;
}
return -1;
}
int nextMove(int r) {
return 12;
return st = par[st][r];
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
512 KB |
start() returned a value that is outside the 0..N-1 range |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
364 KB |
start() returned a value that is outside the 0..N-1 range |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
364 KB |
start() returned a value that is outside the 0..N-1 range |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
512 KB |
start() returned a value that is outside the 0..N-1 range |
2 |
Halted |
0 ms |
0 KB |
- |