# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
385693 | Iwanttobreakfree | Easter Eggs (info1cup17_eastereggs) | C++17 | 2 ms | 492 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |