Submission #912969

# Submission time Handle Problem Language Result Execution time Memory
912969 2024-01-20T04:53:34 Z vjudge1 Mouse (info1cup19_mouse) C++17
Compilation error
0 ms 0 KB
#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()));
}

Compilation message

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) {
      |                  ^