Submission #406770

# Submission time Handle Problem Language Result Execution time Memory
406770 2021-05-18T04:46:55 Z KleindianaLexington Mouse (info1cup19_mouse) C++17
0 / 100
1 ms 200 KB
#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; i++) {
		if(ok[i]) {
			continue;
		}
		int val = -1;
		int idx = -1;
		for(int j = i; j < N; j++) {
			if(ok[j]) {
				continue;
			}
			swap(q[i], q[j]);
			int ret = query(q);
			if(ret == N) {
				return;
			}
			if(ret > val) {
				val = ret;
				idx = j;
			}
			swap(q[i], q[j]);
		}
		swap(q[i], q[idx]);
		ok[i] = true;
		ok[idx] = true;
		int ret = query(q);
		if(ret == N) {
			return;
		}
	}
	query(q);
	int ret = query(q);
	if(ret == N) {
		return;
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -