Submission #1122229

#TimeUsernameProblemLanguageResultExecution timeMemory
1122229I_love_BanuEaster Eggs (info1cup17_eastereggs)C++17
0 / 100
253 ms131072 KiB
#include"bits/stdc++.h" #include"grader.h" using namespace std; using vi = vector<int>; const int mxN = 513; vi aj[mxN]; vi line; void dfs(int u, int p = 0) { line.push_back(u); for (int v : aj[u]) { if (p ^ v) { dfs(v, u); } } } int findEgg (int N, vector < pair < int, int > > bridges) { for (auto [u, v] : bridges) { aj[u].push_back(v); aj[v].push_back(u); } dfs(1); int l = 0, r = N - 1; while (l < r) { int mi = (l + r) / 2; vi qry; for (int i = 0; i <= mi; i ++) { qry.push_back(line[i]); } if (query(qry)) { r = mi; } else { l = mi + 1; } } return line[l]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...