제출 #912969

#제출 시각아이디문제언어결과실행 시간메모리
912969vjudge1Mouse (info1cup19_mouse)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>

#include "grader.h"
using namespace std;

int ask(const vector<int> &q) {
        int x = query(q);
        if (x == n) {
                // cout << queries << '\n';
                exit(0);
        }
        return x;
}

void solve(int n) {
        vector<int> a(n);
        iota(a.begin(), a.end(), 1);
        do {
                ask(a);
        } while (next_permutation(a.begin(), a.end()));
}

컴파일 시 표준 에러 (stderr) 메시지

mouse.cpp: In function 'int ask(const std::vector<int>&)':
mouse.cpp:8:18: error: 'n' was not declared in this scope
    8 |         if (x == n) {
      |                  ^