| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 1060955 | thieunguyenhuy | 질문 (CEOI14_question_grader) | C++17 | 0 ms | 0 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
vector<int> get_set(int x) {
	vector<vector<int>> all_sets;
	for (int mask = 0; mask < MASK(12); ++mask) {
		if (popcount(mask) != 6) continue;
		vector<int> cur_set;
		for (int i = 0; i < 12; ++i) if (BIT(mask, i)) {
			cur_set.emplace_back(i);
		}
		sort (cur_set.begin(), cur_set.end());
		all_sets.emplace_back(cur_set);
	}
	sort (all_sets.begin(), all_sets.end());
	return all_sets[x - 1];
}
int encoder(int n, int x, int y) {
	vector<int> X = get_set(x), Y = get_set(y);
	vector<bool> mark(12, false);
	for (auto it : Y) mark[it] = true;
	for (auto it : X) if (!mark[it]) return it + 1;
	assert(false); return -1;
}
vector<int> get_set(int x) {
	vector<vector<int>> all_sets;
	for (int mask = 0; mask < MASK(12); ++mask) {
		if (popcount(mask) != 6) continue;
		vector<int> cur_set;
		for (int i = 0; i < 12; ++i) if (BIT(mask, i)) {
			cur_set.emplace_back(i);
		}
		sort (cur_set.begin(), cur_set.end());
		all_sets.emplace_back(cur_set);
	}
	sort (all_sets.begin(), all_sets.end());
	return all_sets[x - 1];
}
int decode(int n, int q, int h) {
	vector<int> Q = get_set(q); --h;
	for (auto it : Q) if (it == h) return 1;
	return 0;
}
