#include <bits/stdc++.h>
using namespace std;
//subtask 1
vector<int> adj[500];
int p[500];
int cop = 0;
void dfs(int actual, int anterior){
p[actual] = anterior;
for (auto it: adj[actual]){
if (it != anterior){
dfs(it, actual);
}
}
}
int start(int n, bool a[500][500]){
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++){
if (a[i][j] == 1){
adj[i].push_back(j);
}
}
}
dfs(0, -1);
return 0;
}
int nextMove(int r){
if (r == cop) return r;
else{
while (cop != p[r]){
r = p[r];
}
}
cop = r;
return r;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
1 ms |
208 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
33 ms |
1712 KB |
Output is correct |
5 |
Correct |
12 ms |
952 KB |
Output is correct |
6 |
Correct |
38 ms |
1544 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
195 ms |
262144 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
0 ms |
208 KB |
Output is correct |
3 |
Correct |
0 ms |
336 KB |
Output is correct |
4 |
Runtime error |
181 ms |
262144 KB |
Execution killed with signal 9 |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
1 ms |
208 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
33 ms |
1712 KB |
Output is correct |
5 |
Correct |
12 ms |
952 KB |
Output is correct |
6 |
Correct |
38 ms |
1544 KB |
Output is correct |
7 |
Runtime error |
195 ms |
262144 KB |
Execution killed with signal 9 |
8 |
Halted |
0 ms |
0 KB |
- |