제출 #756123

#제출 시각아이디문제언어결과실행 시간메모리
756123drdilyor통행료 (IOI18_highway)C++17
0 / 100
15 ms476 KiB
#include "highway.h"
#include<iostream>
using namespace std;
using ll = long long;

void find_pair(int n, std::vector<int> u, std::vector<int> v, int a, int b) {
    int m = u.size();
    int l = 0, r = n-2;
    ll toll = ask(vector<int>(m, 0));
    while (l < r) {
        int mid = (l+r) / 2;
        vector<int> weather(m, 0);
        fill(weather.begin(), weather.begin() + mid+1, 1);
        if (ask(weather) == toll) {
            l = mid+1;
        } else r = mid;
    }
    int s = l;

    l = 1, r = n;
    while (l < r) {
        int mid = (l+r) / 2;
        vector<int> weather(m, 0);
        fill(weather.begin()+mid, weather.end(), 1);
        if (ask(weather) > toll) {
            l = mid;
        } else r = mid-1;
    }
    answer(s, l+1);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...