# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
37041 | aome | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++14 | 1922 ms | 27480 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
namespace Encoder {
int mask[925], id;
bool flag;
void label() {
if (flag) return; flag = 1;
for (int i = 0; i < (1 << 12); ++i) {
if (__builtin_popcount(i) != 6) continue;
mask[++id] = i;
}
}
}
int encode(int N, int x, int y) {
Encoder::label();
for (int i = 0; i < 12; ++i) {
bool X = Encoder::mask[x] >> i & 1;
bool Y = Encoder::mask[y] >> i & 1;
if (X == 1 && Y == 0) return i + 1;
}
}
#include <bits/stdc++.h>
using namespace std;
namespace Decoder {
int mask[925], id;
bool flag;
void label() {
if (flag) return; flag = 1;
for (int i = 0; i < (1 << 12); ++i) {
if (__builtin_popcount(i) != 6) continue;
mask[++id] = i;
}
}
}
int decode(int N, int q, int h) {
Decoder::label();
return Decoder::mask[q] >> (h - 1) & 1;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |