#include #include #include using namespace std; void intrappola(int X); bool ispeziona(vector V); void acchiappa(int N, vector U, vector V) { intrappola(1); return; } // GRADER DI ESEMPIO // NON MODIFICARE AL DI SOTTO DI QUESTA LINEA #ifndef EVAL namespace { vector> adj; int N, R, S; bool win; mt19937 rng; void build(vector &U, vector &V) { adj.resize(N); for(int i=0; i U, vector V); void intrappola(int X) { R++; win = (X == S); if(win) end(); move(); } bool ispeziona(vector V) { R++; bool res = false; for(auto x:V) res |= (x == S); move(); return res; } int main() { ios::sync_with_stdio(0); cin.tie(0), cout.tie(0); cin >> N >> S; vector U(N-1), V(N-1); for(int i=0; i> U[i] >> V[i]; build(U, V); R = 0; win = false; acchiappa(N, U, V); end(); } #endif