Submission #1150525

#TimeUsernameProblemLanguageResultExecution timeMemory
1150525marvinthangQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++20
100 / 100
732 ms39856 KiB
#include <bits/stdc++.h>

using namespace std;

const int K = 12;
vector <vector <bool>> a;

int encode(int n, int x, int y) {
	if (a.empty()) {
		a.emplace_back();
		vector <bool> b(K);
		fill(b.begin() + K / 2, b.end(), true);
		do a.push_back(b); while (next_permutation(b.begin(), b.end()));
	}
    for (int i = 0; i < K; ++i) if (a[x][i] && !a[y][i]) return i + 1;
}
#include <bits/stdc++.h>

using namespace std;

const int K = 12;
vector <vector <bool>> a;

int decode(int n, int q, int h) {
	if (a.empty()) {
		a.emplace_back();
		vector <bool> b(K);
		fill(b.begin() + K / 2, b.end(), true);
		do a.push_back(b); while (next_permutation(b.begin(), b.end()));
	}
	return a[q][h - 1];
}

Compilation message (stderr)

# 1번째 컴파일 단계

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:16:1: warning: control reaches end of non-void function [-Wreturn-type]
   16 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...