답안 #769638

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
769638 2023-06-30T00:04:25 Z pedroslrey Super Dango Maker (JOI22_dango3) C++17
22 / 100
223 ms 596 KB
#include <bits/stdc++.h>
#include "dango3.h"

using namespace std;

void Solve(int a, int b) {
	int n = a*b;
	vector<int> free;
	for (int i = 1; i <= n; ++i)
		free.push_back(i);

	for (int i = 0; i < b; ++i) {
		vector<int> know;
		int r = free.size() - 1;
		for (int j = 0; j < a; ++j) {
			int l = 0;
			while (l < r) {
				int m = (l + r)/2;

				vector<int> qs;
				for (int k = 0; k <= m; ++k)
					qs.push_back(free[k]);
				for (int x: know)
					qs.push_back(free[x]);

				if (Query(qs) >= 1) r = m;
				else l = m + 1;
			}

			know.push_back(r);
			--r;
		}

		vector<int> ans;
		for (int x: know)
			ans.push_back(free[x]);
		Answer(ans);

		vector<int> nxt; int ptr = a - 1;
		for (int j = 0; j < free.size(); ++j) {
			if (know[ptr] == j) --ptr;
			else nxt.push_back(free[j]);
		}

		free = nxt;
	}
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:40:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   40 |   for (int j = 0; j < free.size(); ++j) {
      |                   ~~^~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 304 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 300 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 340 KB Output is correct
2 Correct 4 ms 340 KB Output is correct
3 Correct 9 ms 368 KB Output is correct
4 Correct 9 ms 372 KB Output is correct
5 Correct 3 ms 340 KB Output is correct
6 Correct 4 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 52 ms 468 KB Output is correct
2 Correct 52 ms 468 KB Output is correct
3 Correct 223 ms 468 KB Output is correct
4 Correct 214 ms 468 KB Output is correct
5 Correct 28 ms 468 KB Output is correct
6 Correct 28 ms 468 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 146 ms 596 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -