Submission #645639

# Submission time Handle Problem Language Result Execution time Memory
645639 2022-09-27T14:52:39 Z rainboy Super Dango Maker (JOI22_dango3) C++17
100 / 100
1227 ms 812 KB
#include "dango3.h"
#include <vector>

using namespace std;

const int N = 400, M = 25;

typedef vector<int> vi;

bool used[N * M];

void solve(vi ii, int n, int k) {
	if (n == 1) {
		Answer(ii);
		return;
	}
	int m = n / 2;
	for (int i : ii)
		used[i] = true;
	for (int i : ii) {
		used[i] = false;
		vi ii_;
		for (int j : ii)
			if (used[j])
				ii_.push_back(j);
		if (Query(ii_) < m)
			used[i] = 1;
	}
	vi iil, iir;
	for (int i : ii)
		if (used[i])
			iil.push_back(i);
		else
			iir.push_back(i);
	for (int i : ii)
		used[i] = false;
	solve(iil, m, k), solve(iir, n - m, k);
}

void Solve(int k, int n) {
	vi ii;
	for (int i = 0; i < n * k; i++)
		ii.push_back(i + 1);
	solve(ii, n, k);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 1 ms 292 KB Output is correct
5 Correct 1 ms 296 KB Output is correct
6 Correct 1 ms 296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 13 ms 340 KB Output is correct
2 Correct 13 ms 368 KB Output is correct
3 Correct 14 ms 340 KB Output is correct
4 Correct 13 ms 340 KB Output is correct
5 Correct 12 ms 340 KB Output is correct
6 Correct 12 ms 296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 277 ms 496 KB Output is correct
2 Correct 282 ms 508 KB Output is correct
3 Correct 322 ms 620 KB Output is correct
4 Correct 317 ms 476 KB Output is correct
5 Correct 270 ms 652 KB Output is correct
6 Correct 265 ms 476 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1133 ms 612 KB Output is correct
2 Correct 1119 ms 696 KB Output is correct
3 Correct 1202 ms 788 KB Output is correct
4 Correct 1227 ms 688 KB Output is correct
5 Correct 1079 ms 688 KB Output is correct
6 Correct 1075 ms 812 KB Output is correct