| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1294190 | m_bezrutchka | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++20 | 697 ms | 39756 KiB |
#include <bits/stdc++.h>
using namespace std;
int biject[1000];
bool initialized = false;
void build_bijection() {
initialized = true;
int q = 1;
for (int bm = 0; bm < (1 << 12); bm++) {
if ((int) __builtin_popcount(bm) != 6) continue;
biject[q] = bm;
q++;
if (q >= 1000) break;
}
}
int encode(int n, int x, int y) {
if (!initialized) build_bijection();
x = biject[x]; y = biject[y];
for (int i = 0; i < 12; i++) {
if ((x & (1 << i)) && !(y & (1 << i))) {
return i + 1;
}
}
return -1;
}
#include <bits/stdc++.h>
using namespace std;
int biject[1000];
bool initialized = false;
void build_bijection() {
initialized = true;
int q = 1;
for (int bm = 0; bm < (1 << 12); bm++) {
if ((int) __builtin_popcount(bm) != 6) continue;
biject[q] = bm;
q++;
if (q >= 1000) break;
}
}
int decode(int n, int q, int h) {
if (!initialized) build_bijection();
q = biject[q];
h--;
if (q & (1 << h)) return 1;
else return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
