제출 #263145

#제출 시각아이디문제언어결과실행 시간메모리
263145UserIsUndefined통행료 (IOI18_highway)C++14
0 / 100
11 ms544 KiB
#include "highway.h"
#include <bits/stdc++.h>

using namespace std;



void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B) {
    int m = V.size();

    vector<int> ans;

    vector<int> test(m , 0);

    cout << "YES" << endl;

    int li = ask(test);

    bool good = true;
cout << "YES" << endl;


    for (int i = 0 ; i < N && good ; i++){
        vector<int> W(m);

        for (int j = 0 ; j < m && good ; j++){
            if (U[j] == i || V[j] == i){
                W[j] = 1;
            }
            else W[j] = 0;
        }




        int an = ask(W);



        if (an - B + A == li){
            ans.push_back(i);
            if (ans.size() == 2)good = false;
        }

    }


    answer(ans[0] , ans[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...