# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
270462 | usuyus | Easter Eggs (info1cup17_eastereggs) | C++14 | 24 ms | 384 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>
#define N 1001
using namespace std;
vector<int> tree[N], ord, temp;
int query(vector<int> islands);
void dfs(int node, int parent) {
ord.push_back(node);
for (int child : tree[node]) {
if (child != parent) dfs(child, node);
}
}
int findEgg(int n, vector<pair<int,int>> edges) {
ord.clear();
for (int i=1; i<=n; i++) tree[i].clear();
for (int i=0; i<n-1; i++) {
int a=edges[i].first, b=edges[i].second;
tree[a].push_back(b);
tree[b].push_back(a);
}
dfs(1, 0);
int l=1, r=n;
while (l<r) {
int m=(l+r)/2;
temp.clear();
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |