//subtask 21 points
#include <algorithm>
#include <fstream>
#include <vector>
#include <queue>
#include <stack>
#include <iostream>
#include <cmath>
#include <queue>
#include <set>
#include <cstring>
#include <map>
#include <unordered_map>
//#include <bits/extc++.h>
#define F first
#define S second
#define PB push_back
using namespace std;
//using namespace __gnu_pbds;
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ost;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<pair<int, ii>> viii;
typedef vector<vii> vvii;
typedef vector<ll> vll;
typedef vector<vll> vvll;
void setHintLen (int l);
void setHint(int i, int j, bool b);
int getLength ();
bool getHint(int j);
bool goTo(int x);
vvi al;
int st, N;
void dfs(int node, int p){
for(int i=1;i<=N;i++){
if(i!=p && getHint(i-1)){
goTo(i);
dfs(i, node);
}
}
if(node!=st)
goTo(p);
}
void assignHints(int subtasks, int n, int a[], int b[]){
al.resize(n+1, vi());
for(int i=1;i<n;i++){
al[a[i]].PB(b[i]);
al[b[i]].PB(a[i]);
}
setHintLen(n);
for(int i=1;i<=n;i++){
for(auto ch:al[i])
setHint(i, ch-1, 1);
}
}
void speedrun(int subtask, int n, int start){
st=start;
n=N;
dfs(start, 0);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
352 KB |
Invalid bit index for setHint |
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 |
1 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 |
1 ms |
344 KB |
The length is too large |
2 |
Halted |
0 ms |
0 KB |
- |