# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
946666 | PagodePaiva | Highway Tolls (IOI18_highway) | C++17 | 10 ms | 600 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 "highway.h"
#include<bits/stdc++.h>
#define N 90010
#define ll long long
using namespace std;
void find_pair(int n, std::vector<int> u, std::vector<int> v, int an, int bn) {
ll a = an;
ll b = bn;
int l = 0, r = n-2;
vector <int> w(n-1);
for(int i = 0;i < n-1;i++) w[i] = 0;
ll custo = ask(w);
ll d = custo/a;
while(l < r){
int mid = (l+r)/2;
for(int i = l;i <= mid;i++){
w[i] = 1;
}
custo = ask(w);
if(d*a == custo){
l = mid+1;
}
else{
r = mid;
}
}
answer(l, l+d);
return;
// int M = U.size();
// for (int j = 0; j < 50; ++j) {
// std::vector<int> w(M);
// for (int i = 0; i < M; ++i) {
// w[i] = 0;
// }
// long long toll = ask(w);
// }
// answer(0, N - 1);
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |