# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
503658 |
2022-01-08T14:35:14 Z |
blue |
Speedrun (RMI21_speedrun) |
C++17 |
|
47 ms |
788 KB |
#include "speedrun.h"
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
const int maxN = 1'000;
void assignHints(int subtask, int N, int A[], int B[])
{
setHintLen(N);
for(int e = 1; e <= N-1; e++)
{
setHint(A[e], B[e], 1);
setHint(B[e], A[e], 1);
}
}
int N;
void dfs(int u, int p)
{
// cerr << "dfs: " << u << '\n';
vi adj;
for(int v = 1; v <= N; v++)
{
if(v == p) continue;
if(getHint(v)) adj.push_back(v);
}
for(int v: adj)
{
goTo(v);
dfs(v, u);
goTo(u);
}
// for(int v = 1; v <= N; v++)
// {
// if(v == p) continue;
// if(getHint(v))
// {
// goTo(v);
// dfs(v, u);
// goTo(u);
// }
// }
}
void speedrun(int subtask, int N_, int start)
{
int l = getLength();
N = N_;
dfs(start, 0);
}
Compilation message
speedrun.cpp: In function 'void speedrun(int, int, int)':
speedrun.cpp:56:9: warning: unused variable 'l' [-Wunused-variable]
56 | int l = getLength();
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
47 ms |
780 KB |
Output is correct |
2 |
Correct |
40 ms |
752 KB |
Output is correct |
3 |
Correct |
45 ms |
788 KB |
Output is correct |
4 |
Correct |
41 ms |
784 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
328 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
328 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
328 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
328 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |