답안 #247361

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
247361 2020-07-11T08:58:10 Z dwsc Mouse (info1cup19_mouse) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
void solve(int N){
    vector<int> v;
    for (int i = 1; i <= N; i++) v.push_back(i);
    do{
        random_shuffle(v.begin(),v.end());
        int val = query(v);
        if (val == N) return;
        else if (val == N-2){
            for (int i = 0; i < N; i++){
                for (int j = i+1; j < N; j++){
                    swap(v[i],v[j]);
                    if (query(v) == N) return;
                    swap(v[i],v[j]);
                }
            }
        }
    }while(true);
}

Compilation message

mouse.cpp: In function 'void solve(int)':
mouse.cpp:8:19: error: 'query' was not declared in this scope
         int val = query(v);
                   ^~~~~