# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
498730 | 2021-12-26T09:13:48 Z | ahmedfouadnew | Easter Eggs (info1cup17_eastereggs) | C++17 | 8 ms | 516 KB |
#include <bits/stdc++.h> #include "grader.h" //#include "grader.cpp" #define pb push_back #define f first #define s second using namespace std; vector<int>adj[606]; int n; vector<int>vv; void dfs(int u,int p) { vv.pb(u); for(int v:adj[u]) { if(v==p) continue; // vv.pb(u); dfs(v,u); } vv.pb(u); } int findEgg (int N, vector < pair < int, int > > bridges) { for(int i=0;i<=N;i++) { adj[i].clear(); } vv.clear(); n=N; for(int i=0;i<bridges.size();i++) { adj[bridges[i].f].pb(bridges[i].s); adj[bridges[i].s].pb(bridges[i].f); } dfs(1,0); //cout<<N<<" "<<vv.size()<<endl; int s=0,e=vv.size()-1; while(s<e) { int mid=s+(e-s)/2; set<int>st; for(int ii=s;ii<=mid;ii++) st.insert(vv[ii]); vector<int>qr(st.begin(),st.end()); if(query(qr)) { e=mid; } else { s=mid+1; } } return vv[s]; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Partially correct | 2 ms | 200 KB | Number of queries: 5 |
2 | Runtime error | 1 ms | 456 KB | Execution killed with signal 6 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 456 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 8 ms | 516 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |