#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
int findEgg (int N, vector < pair < int, int > > bridges){
vector<int> par(1 + N);
vector<vector<int>> g(1 + N);
for (auto it : bridges) {
int a, b;
tie(a, b) = it;
g[a].push_back(b);
g[b].push_back(a);
}
random_shuffle(bridges.begin(), bridges.end());
for (auto it : bridges) {
int a, b;
tie(a, b) = it;
if (query(vector<int>{a, b}) == 1) {
if (query(vector<int>{a}))
return a;
return b;
}
}
return -1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
1 ms |
200 KB |
Number of queries: 14 |
2 |
Partially correct |
2 ms |
200 KB |
Number of queries: 14 |
3 |
Partially correct |
2 ms |
200 KB |
Number of queries: 15 |
4 |
Partially correct |
2 ms |
200 KB |
Number of queries: 16 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
440 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
456 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |