# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
342585 | 2021-01-02T11:57:38 Z | ogibogi2004 | Easter Eggs (info1cup17_eastereggs) | C++14 | 400 ms | 131076 KB |
#include <bits/stdc++.h> #include "grader.h" using namespace std; const int MAXN=600; vector<int>g[MAXN]; vector<int>order; void dfs(int u,int p) { order.push_back(u); for(auto v:g[u]) { if(v==p)continue; dfs(v,u); } } int findEgg (int N, vector < pair < int, int > > bridges) { 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); } dfs(1,0); int low=0,high=N-1,mid,ans; while(low<=high) { mid=(low+high)/2; vector<int>q; for(int i=0;i<=mid;i++)q.push_back(order[i]); if(query(q)) { ans=mid; high=mid-1; } else low=mid+1; } return order[ans]; if (query ({1})) return 1; return N; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 408 ms | 131076 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 281 ms | 131076 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 283 ms | 131076 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |