Submission #547311

#TimeUsernameProblemLanguageResultExecution timeMemory
547311MonarchuwuEaster Eggs (info1cup17_eastereggs)C++17
Compilation error
0 ms0 KiB
/** * Problem: info1cup17_eastereggs - Easter Eggs * Link: https://oj.uz/problem/view/info1cup17_eastereggs * Tags: Interactive **/ #include<iostream> #include<algorithm> #include<vector> #include<queue> //#include "grader.h" using namespace std; typedef pair<int, int> pii; #define ff first #define ss second const int N = 600; vector<int> g[N], ord; void dfs(int u, int p) { ord.push_back(u); for (int v : g[u]) if (v != p) dfs(v, u); } int findEgg(int n, vector<pii> bridges) { for (int i = 1; i <= n; ++i) g[i].clear(); for (pii e : bridges) { g[e.ff].push_back(e.ss); g[e.ss].push_back(e.ff); } ord.clear(); dfs(1, 0); int lo(0), hi(n - 2), m; while (lo <= hi) { m = (lo + hi) >> 1; if (query(vector<int>(ord.begin(), ord.begin() + m + 1))) hi = m - 1; else lo = m + 1; } return ord[hi + 1]; }

Compilation message (stderr)

eastereggs.cpp: In function 'int findEgg(int, std::vector<std::pair<int, int> >)':
eastereggs.cpp:36:13: error: 'query' was not declared in this scope
   36 |         if (query(vector<int>(ord.begin(), ord.begin() + m + 1)))
      |             ^~~~~