/**
* بسم الله الرحمن الرحيم *
﴾ رَبِّ اشْرَحْ لِي صَدْرِي * وَيَسِّرْ لِي أَمْرِي * وَاحْلُلْ عُقْدَةً مِّن لِّسَانِي * يَفْقَهُوا قَوْلِي ﴿
*/
/// author : "ASGA"
#include <bits/stdc++.h>
using namespace std;
#include "speedrun.h"
void assignHints(int sub, int n, int* A, int* B){
setHintLen(n);
for(int i = 1;i < n;i++){
int u = A[i];
int v = B[i];
setHint(u,v,1);
setHint(v,u,1);
}
return;
}
namespace solve{
int n;
void calc(int i,int p){
for(int j = 1;j <= n;j++){
if(j != p && getHint(j)){
goTo(j);
calc(j,i);
goTo(i);
}
}
}
}
void speedrun(int sub,int N,int u){
solve::n = N;
solve::calc(u,-1);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
23 ms |
936 KB |
Output is correct |
2 |
Correct |
24 ms |
972 KB |
Output is correct |
3 |
Correct |
21 ms |
944 KB |
Output is correct |
4 |
Correct |
24 ms |
944 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |