Submission #1070968

#TimeUsernameProblemLanguageResultExecution timeMemory
1070968raduvEaster Eggs (info1cup17_eastereggs)C++14
0 / 100
1 ms600 KiB
#include <bits/stdc++.h> #include "grader.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 islands[st]; }

Compilation message (stderr)

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