#include <bits/stdc++.h>
#include "highway.h"
#ifdef ONPC
#include "t_debug.cpp"
#else
#define debug(...) 42
#endif
using namespace std;
//namespace pbds = __gnu_pbds;
using ll = long long;
const int inf = 1e9;
const ll infl = 1e18;
const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
mt19937 rng(RANDOM);
template<typename T, typename U> istream& operator>>(istream& is, pair<T, U>& p) { return is >> p.first >> p.second; }
template<typename Cont> int sz(const Cont& cont) { return int(cont.size()); }
// template<typename Func> struct ycom { Func f; template<typename... T> auto operator()(T&&... args) { return f(*this, args...); } }; template<typename Func> ycom(Func) -> ycom<Func>;
template<typename T> typename vector<T>::iterator operator+(const vector<T>& x, int i) { return x.begin() + i ;};
const string fileio = "";
constexpr int tests = 1, nmax = 2e5, nlog = __lg(nmax), mod = 1e9+7;
void find_pair(int32_t n, std::vector<int32_t> u, std::vector<int32_t> v, int32_t a, int32_t b) {
int m = u.size();
vector<vector<pair<int,int>>> adj(n);
for (int i = 0; i < m; i++) {
adj[u[i]].emplace_back(v[i], i);
adj[v[i]].emplace_back(u[i], i);
}
int base = ask(vector(m, 0));
int l = 0, r = n;
while (l < r-1) {
int mid = (l + r) / 2;
vector<int> w(n-1);
fill(w.begin(), w.begin() + mid, 1);
if (ask(w) == base) {
l = mid;
} else r = mid;
}
int s = l;
l = 0, r = n;
while (l < r-1) {
int mid = (l + r) / 2;
vector<int> w(n-1);
fill(w.begin(), w.begin() + mid, 1);
reverse(w.begin(), w.end());
if (ask(w) == base) l = mid;
else r = mid;
}
answer(s, n - 1 - l);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Output is incorrect: {s, t} is wrong. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output is incorrect: {s, t} is wrong. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
976 KB |
Output is correct |
2 |
Correct |
21 ms |
1784 KB |
Output is correct |
3 |
Correct |
20 ms |
2528 KB |
Output is correct |
4 |
Correct |
86 ms |
6996 KB |
Output is correct |
5 |
Correct |
60 ms |
7076 KB |
Output is correct |
6 |
Correct |
78 ms |
6996 KB |
Output is correct |
7 |
Correct |
56 ms |
7008 KB |
Output is correct |
8 |
Correct |
59 ms |
7116 KB |
Output is correct |
9 |
Incorrect |
54 ms |
6964 KB |
Output is incorrect: {s, t} is wrong. |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output is incorrect: {s, t} is wrong. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
8 ms |
1104 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
10 ms |
1104 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |