답안 #582739

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
582739 2022-06-24T11:10:26 Z elkernos Super Dango Maker (JOI22_dango3) C++17
컴파일 오류
0 ms 0 KB
#include "dango3.h"

using namespace std;

namespace {
int S;
int q(vector<bool> b)
{
    vector<int> x;
    for(int i = 0; i < S; i++) {
        if(b[i]) x.push_back(i + 1);
    }
    return Pytaj(x);
}
void a(vector<int> v)
{
    for(auto &t : v) {
        t++;
    }
    Odpowiedz(v);
}
} // namespace

void Inicjuj(int N, int M)
{
    S = N * M;
    vector<vector<int>> box(M);
    for(int i = 0; i < S; i++) {
        int lo = 0, hi = M - 1, ans = -1;
        while(lo <= hi) {
            int m = (lo + hi) / 2;
            vector<bool> query(S, 1);
            for(int x : box[m]) {
                query[x] = 0;
            }
            query[i] = 0;
            if(M - q(query) == 2) {
                lo = m + 1;
            }
            else {
                ans = m;
                hi = m - 1;
            }
        }
        box[ans].push_back(i);
    }
    for(vector<int> give : box) {
        a(give);
    }
}

Compilation message

dango3.cpp: In function 'int {anonymous}::q(std::vector<bool>)':
dango3.cpp:13:12: error: 'Pytaj' was not declared in this scope
   13 |     return Pytaj(x);
      |            ^~~~~
dango3.cpp: In function 'void {anonymous}::a(std::vector<int>)':
dango3.cpp:20:5: error: 'Odpowiedz' was not declared in this scope
   20 |     Odpowiedz(v);
      |     ^~~~~~~~~