#include "coprobber.h"
#include "bits/stdc++.h"
using namespace std;
#ifndef EVAL
#include "grader.cpp"
#endif
const int M = 505;
vector<int> edges[M];
int par[M][M], v;
int used[M][M], a[M][M];
int start(int n, bool A[MAX_N][MAX_N]){
memset(par, -1, sizeof par);
int m = 0;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
a[i][j] = A[i][j];
if(a[i][j]) edges[i].push_back(j), m++;
}
}
assert(m == 2 * (n - 1));
for(int i=0;i<n;i++){
queue<int> q; q.push(i);
par[i][i] = i;
while(!q.empty()){
int u = q.front(); q.pop();
for(auto x : edges[u]){
if(par[i][x] == -1){
par[i][x] = u, q.push(x);
}
}
}
}
v = 1;
return 1;
}
int nextMove(int R){
if(used[v][R]){
assert(false);
} else {
used[v][R] = 1;
}
return par[R][v];
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1232 KB |
Output is correct |
2 |
Correct |
1 ms |
1232 KB |
Output is correct |
3 |
Runtime error |
2 ms |
2512 KB |
Execution killed with signal 6 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2 ms |
2512 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1232 KB |
Output is correct |
2 |
Correct |
1 ms |
1232 KB |
Output is correct |
3 |
Runtime error |
2 ms |
2512 KB |
Execution killed with signal 6 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1232 KB |
Output is correct |
2 |
Correct |
1 ms |
1232 KB |
Output is correct |
3 |
Runtime error |
2 ms |
2512 KB |
Execution killed with signal 6 |
4 |
Halted |
0 ms |
0 KB |
- |