Submission #568911

#TimeUsernameProblemLanguageResultExecution timeMemory
568911nonsensenonsense1Super Dango Maker (JOI22_dango3)C++17
100 / 100
775 ms596 KiB
#include "dango3.h"

int n;

void calc(std::vector<int> &a) {
	if (a.size() == n) Answer(a);
	else {
		int m = a.size() / n / 2;
		std::vector<int> b;
		for (int i = a.size() - 1; i >= 0; --i) {
			int x = a[i];
			a.erase(a.begin() + i);
			if (Query(a) < m) a.push_back(x);
			else b.push_back(x);
		}
		calc(a);
		calc(b);
	}
}

void Solve(int n_, int m) {
	n = n_;
	std::vector<int> a(n * m);
	for (int i = 0; i < n * m; ++i) a[i] = i + 1;
	calc(a);
}

Compilation message (stderr)

dango3.cpp: In function 'void calc(std::vector<int>&)':
dango3.cpp:6:15: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    6 |  if (a.size() == n) Answer(a);
      |      ~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...