# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
483636 | 2021-10-31T12:07:12 Z | alexdumitru | Easter Eggs (info1cup17_eastereggs) | C++14 | 245 ms | 131076 KB |
#include <bits/stdc++.h> #include <grader.h> using namespace std; vector<int> v[550]; vector<int> parcurgere; void dfs(int nod=1, int p=-1) { parcurgere.push_back(nod); for(auto i:v[nod])if(i!=p)dfs(i,nod); } int findEgg(int N, vector<pair<int,int> > bridges) { int st,r=N-1,mi,dr; for(auto i:bridges) { v[i.first].push_back(i.second); v[i.second].push_back(i.first); } dfs(); st=0; dr=N-1; while(st<dr) { mi=st+(dr-st)/2; if(query(vector<int>(parcurgere.begin(),parcurgere.begin()+mi+1))) dr=mi; else st=mi+1; } return parcurgere[dr]; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 245 ms | 131076 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 188 ms | 131076 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 184 ms | 131076 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |