Submission #1122228

#TimeUsernameProblemLanguageResultExecution timeMemory
1122228I_love_BanuEaster Eggs (info1cup17_eastereggs)C++14
0 / 100
283 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]; }

Compilation message (stderr)

eastereggs.cpp: In function 'int findEgg(int, std::vector<std::pair<int, int> >)':
eastereggs.cpp:23:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   23 |     for (auto [u, v] : bridges) {
      |               ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...