# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
443715 | 2021-07-11T15:36:17 Z | chicken337 | Easter Eggs (info1cup17_eastereggs) | C++14 | 1 ms | 456 KB |
#include <bits/stdc++.h> #include "grader.h" using namespace std; const int MAXN = 513; vector<int> adjlist[MAXN], v, vis(MAXN); void dfs(int x){ vis[x] = 1; v.push_back(x); for(int nxt : adjlist[x]) if(!vis[nxt]) dfs(nxt); } int findEgg(int N, vector<pair<int, int>> bridges){ for(int i = 0; i < N; i ++) adjlist[i].clear(); fill(vis.begin(), vis.end(), 0); v.clear(); for(pair<int, int> it : bridges){ adjlist[it.first].push_back(it.second); adjlist[it.second].push_back(it.first); } dfs(0); int l = 0, r = N-1, ans = -1; while(l <= r){ int m = (l + r) >> 1; if(query(vector<int>(v.begin(), v.begin()+m))){ r = m-1; ans = m; } else l = m; } return v[l]; }
Compilation message
# | 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 | 1 ms | 456 KB | Execution killed with signal 6 |
2 | 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 | - |