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 "highway.h"
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define pp pop_back
#define mp make_pair
#define bb back
#define ff first
#define ss second
using namespace std;
int n, m, cost;
void find_pair(int N, vector<int> U, vector<int> V, int A, int B) {
n = n, m = U.size();
vector<int> q(m, 0);
int dist = ask(q);
int l = 0, r = m;
while (l < r) {
int mid = (l + r) / 2;
for (int i = 0; i <= mid; i++)
q[i] = 1;
if (ask(q) != dist)
r = mid;
else
l = mid+1;
for (int i = 0; i <= mid; i++)
q[i] = 0;
}
answer(l, l+dist/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... |