# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
483634 | 2021-10-31T12:00:26 Z | alexdumitru | Easter Eggs (info1cup17_eastereggs) | C++14 | 229 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,poz=N,mi,dr,i; 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-1; r=mi; } else st=mi+1; } return parcurgere[r]; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 229 ms | 131076 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 189 ms | 131076 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 189 ms | 131076 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |