# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
385693 | 2021-04-04T18:31:35 Z | Iwanttobreakfree | Easter Eggs (info1cup17_eastereggs) | C++17 | 2 ms | 492 KB |
#include <bits/stdc++.h> #include "grader.h" using namespace std; int findEgg (int N, vector < pair < int, int > > bridges){ vector<int> lista(N); set<int> s; int cont=0; for(int i=0;i<N-1;i++){ if(s.find(bridges[i].first)==s.end()){ lista[s.size()]==bridges[i].first; s.insert(bridges[i].first); } if(s.find(bridges[i].second)==s.end()){ lista[s.size()]==bridges[i].second; s.insert(bridges[i].second); } } int l=0,r=N-1,sol; vector<int> v; while(l<=r){ v.clear(); int mid=(r-l)/2+l; for(int i=l;i<=mid;i++)v.push_back(lista[i]); if(query(v)){ sol=mid; r=mid-1; } else l=mid+1; } return sol; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 492 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 492 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 492 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |