#include <speedrun.h>
#include <bits/stdc++.h>
using namespace std;
void assignHints (int subtask , int N, int A[], int B[]){
vector <vector <int>> v[N + 1];
setHintLen( N );
for(int i = 1; i < N; i++){
setHint( A[i], B[i], 1);
setHint( B[i], A[i], 1);
}
}
int vis[1001];
void dfs(int nd, int n){
vis[nd] = 1;
//cout << "Suntem la " << nd << endl;
for(int i = 1; i <= n; i++){
if( vis[i] || getHint(i) == 0 ) continue;
//cout << " -- > i = " << i << " getHint = " << getHint(i) << endl;
goTo(i);
vis[i] = 1;
dfs(i, n);
goTo(nd);
}
}
void speedrun(int subtask , int N, int start ){
for(int i = 0; i <= N; i++) vis[i] = 0;
vis[start] = 1;
stack<int> s;
s.push(start);
dfs(start, N);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
25 ms |
1520 KB |
Output is correct |
2 |
Correct |
25 ms |
1452 KB |
Output is correct |
3 |
Correct |
21 ms |
1480 KB |
Output is correct |
4 |
Correct |
24 ms |
1804 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |