# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
946814 | PenguinsAreCute | Easter Eggs (info1cup17_eastereggs) | C++17 | 13 ms | 1252 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 pre[569], c;
vector<int> adj[569];
void dfs(int x, int p) {
pre[x] = c++;
for(auto i: adj[x]) if(i!=p) dfs(i, x);
}
int findEgg (int N, vector < pair < int, int > > bridges) {
for(int i=0;++i<=N;) adj[i].clear();
for(auto [u, v]: bridges) {
adj[u].push_back(v);
adj[v].push_back(u);
}
c=0; dfs(1,-1);
int l=-1, r=N-1;
while(r-l>1) {
int m=l+r>>1;
vector<int> v;
for(int i=0;++i<=N;) if(pre[i]<=m) v.push_back(i);
if(query(v)) r=m;
else l=m;
}
for(int i=0;++i<=N;) if(pre[i]==r) return i;
cout << "Beware the Ides of March\n";
return 69;
}
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... |