# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
918504 | vjudge1 | Easter Eggs (info1cup17_eastereggs) | C++17 | 12 ms | 1776 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"
#define ll long long
#define pll pair<ll, ll>
using namespace std;
vector<ll>g[550], eggs;
ll used[550];
void dfs(ll v)
{
eggs.push_back(v);
used[v] = 1;
for (auto u : g[v]){
if (used[u] == 0){
dfs(u);
}
}
}
int findEgg (int N, vector < pair < int, int > > bridges)
{
for (ll i = 0; i<bridges.size(); i++){
g[bridges[i].first].push_back(bridges[i].second);
g[bridges[i].second].push_back(bridges[i].first);
}
dfs(1);
ll l = 0, r = N - 1;
while (l < r){
ll m = (l + r)/2;
vector<int>f;
for (ll i = 0; i<m+1; i++){
f.push_back(eggs[i]);
}
if (query(f)){
r = m;
}
else {
l = m + 1;
}
}
return eggs[l];
}
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... |