# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1150525 | marvinthang | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++20 | 732 ms | 39856 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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |