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 "highway.h"
/// #pragma GCC optimize ("Ofast")
/// #pragma GCC target ("avx2")
/// #pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
using ld = long double;
using ii = pair<ll, ll>;
using vi = vector<int>;
#define ff first
#define ss second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define lb lower_bound
const int MOD = 1e9 + 7;
void find_pair(int N, vector<int> U, vector<int> V, int A, int B) {
int M = U.size(); vector<int> W(M, 0);
ll K = ask(W); int S = 0;
int lo = 0, hi = M - 1;
while(lo <= hi) {
int md = (lo + hi) / 2;
for(int l = 0; l <= md; l++) W[l] = 1;
ll E = ask(W);
for(int l = 0; l <= md; l++) W[l] = 0;
if(E <= K) lo = md + 1;
else S = md, hi = md - 1;
}
answer(S, S + K / A);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |