Submission #1070964

#TimeUsernameProblemLanguageResultExecution timeMemory
1070964raduvEaster Eggs (info1cup17_eastereggs)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> const int MAXN = 512; using namespace std; vector<int> adj[MAXN + 1]; vector<int> islands; bitset <MAXN + 1> frecv; void dfs(int node){ frecv[node] = 1; islands.push_back(node); for(auto n : adj[node] ){ if(!frecv[n]) dfs(n); } } int findEgg(int n, vector<pair<int, int>> bridges){ int i, st, dr, mij; frecv.reset(); for( i = 0; i <= MAXN; i++ ) adj[i].clear(); islands.clear(); for( auto [u, v] : bridges ){ adj[u].push_back(v); adj[v].push_back(u); } st = 0; dr = n; while(dr - st > 1){ mij = (dr + st) / 2; vector <int> qry; for( i = 0; i < mij; i++ ){ qry.push_back(islands[i]); } if(query(qry)) dr = mij; else st = mij; } return st; }

Compilation message (stderr)

eastereggs.cpp: In function 'int findEgg(int, std::vector<std::pair<int, int> >)':
eastereggs.cpp:33:8: error: 'query' was not declared in this scope; did you mean 'qry'?
   33 |     if(query(qry))
      |        ^~~~~
      |        qry