답안 #781078

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
781078 2023-07-12T17:20:03 Z aZvezda Super Dango Maker (JOI22_dango3) C++17
22 / 100
95 ms 476 KB
#include "dango3.h"

#include <bits/stdc++.h>
using namespace std;

namespace {

int variable_example = 1;

}  // namespace


void Solve(int n, int m) {
	vector<int> lft = {};
	for(int i = 1; i <= n * m; i ++) { lft.push_back(i); }
	for(int i = 0; i < m; i ++) {
		vector<int> group = {};
		random_shuffle(lft.begin(), lft.end());
		int last = lft.size();
		for(int j = 0; j < n; j ++) {
			int l = 0, r = last;
			while(l < r - 1) {
				int m = (l + r) / 2ll;
				auto now = group;
				for(int k = 0; k < m; k ++) {
					now.push_back(lft[k]);
				}
				if(Query(now) >= 1) {
					r = m;
				} else {
					l = m;
				}
			}
			group.push_back(lft[l]);
			swap(lft[lft.size() - 1], lft[l]);
			lft.pop_back();
			last = r;
		}
		Answer(group);
	}
}

Compilation message

dango3.cpp:8:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    8 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 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 0 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 340 KB Output is correct
2 Correct 3 ms 340 KB Output is correct
3 Correct 3 ms 340 KB Output is correct
4 Correct 3 ms 340 KB Output is correct
5 Correct 4 ms 340 KB Output is correct
6 Correct 4 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 33 ms 440 KB Output is correct
2 Correct 33 ms 468 KB Output is correct
3 Correct 34 ms 468 KB Output is correct
4 Correct 33 ms 468 KB Output is correct
5 Correct 35 ms 468 KB Output is correct
6 Correct 33 ms 476 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 95 ms 468 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -