# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1122228 | I_love_Banu | Easter Eggs (info1cup17_eastereggs) | C++14 | 283 ms | 131072 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;
using vi = vector<int>;
const int mxN = 513;
vi aj[mxN];
vi line;
void dfs(int u, int p = 0) {
line.push_back(u);
for (int v : aj[u]) {
if (p ^ v) {
dfs(v, u);
}
}
}
int findEgg (int N, vector < pair < int, int > > bridges)
{
for (auto [u, v] : bridges) {
aj[u].push_back(v);
aj[v].push_back(u);
}
dfs(1);
int l = 0, r = N - 1;
while (l < r) {
int mi = (l + r) / 2;
vi qry;
for (int i = 0; i <= mi; i ++) {
qry.push_back(line[i]);
}
if (query(qry)) {
r = mi;
} else {
l = mi + 1;
}
}
return line[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... |