Submission #568911

# Submission time Handle Problem Language Result Execution time Memory
568911 2022-05-26T10:45:53 Z nonsensenonsense1 Super Dango Maker (JOI22_dango3) C++17
100 / 100
775 ms 596 KB
#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

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 time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 296 KB Output is correct
4 Correct 1 ms 296 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 292 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 292 KB Output is correct
2 Correct 8 ms 340 KB Output is correct
3 Correct 9 ms 292 KB Output is correct
4 Correct 9 ms 340 KB Output is correct
5 Correct 8 ms 352 KB Output is correct
6 Correct 8 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 122 ms 528 KB Output is correct
2 Correct 114 ms 460 KB Output is correct
3 Correct 141 ms 528 KB Output is correct
4 Correct 209 ms 412 KB Output is correct
5 Correct 160 ms 416 KB Output is correct
6 Correct 165 ms 416 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 504 ms 596 KB Output is correct
2 Correct 633 ms 464 KB Output is correct
3 Correct 775 ms 488 KB Output is correct
4 Correct 672 ms 488 KB Output is correct
5 Correct 559 ms 484 KB Output is correct
6 Correct 564 ms 492 KB Output is correct