# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
875721 | 2023-11-20T11:48:40 Z | Aiperiii | Easter Eggs (info1cup17_eastereggs) | C++14 | 1 ms | 460 KB |
#include <bits/stdc++.h> #include "grader.h" using namespace std; int findEgg (int N, vector < pair < int, int > > bridges) { vector <int> g[N+1]; for(int i=0;i<bridges.size();i++){ g[bridges[i].first].push_back(bridges[i].second); g[bridges[i].second].push_back(bridges[i].first); } vector <int> vec,vis(N+1); queue <int> q; queue <vector <int> > d; for(int i=1;i<=N;i++){ if(vis[i]==0){ q.push(i); while(!q.empty()){ int v=q.front(); q.pop(); vec.push_back(v); vis[v]=1; for(auto to : g[v]){ if(vis[to]==0){ q.push(to); break; } } } d.push(vec); vec.clear(); } } while(!d.empty()){ vector <int> v=d.front(); d.pop(); if(query(v)==1){ if(v.size()==1){ cout<<v[0]<<endl;exit(0); } else{ int x=(v.size()+1)/2; vector <int> s; while(s.size()<x){ s.push_back(v.back()); v.pop_back(); } d.push(v); d.push(s); } } } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Unexpected end of file - int32 expected |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 460 KB | Unexpected end of file - int32 expected |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Unexpected end of file - int32 expected |
2 | Halted | 0 ms | 0 KB | - |