제출 #406765

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

bool ok[300];

void solve(int N) {
	memset(ok, false, sizeof(ok));
	vector<int> q;
	for(int i = 1; i <= N; i++) {
		q.push_back(i);
	}
	for(int i = 0; i < N - 1; i++) {
		if(ok[i]) {
			continue;
		}
		int val = -1;
		int idx = -1;
		for(int j = i + 1; j < N; j++) {
			if(ok[j]) {
				continue;
			}
			swap(q[i], q[j]);
			int ret = query(q);
			if(ret == N) {
				return;
			}
			if(ret > val) {
				val = res;
				idx = j;
			}
			swap(q[i], q[j]);
		}
		swap(q[i], q[idx]);
		ok[i] = true;
		ok[idx] = true;
	}
	query(q);
}

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

mouse.cpp: In function 'void solve(int)':
mouse.cpp:29:11: error: 'res' was not declared in this scope; did you mean 'ret'?
   29 |     val = res;
      |           ^~~
      |           ret