# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
23600 | 0xrgb | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++14 | 1711 ms | 25720 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.
static int M[924][6];
static int Mr = 0;
static void M_init();
int encode (int n, int x, int y) {
if (!Mr) M_init();
for (int i = 0; i < 6; ++i) {
int j;
for (j = 0; j < 6; ++j) {
if (M[x][i] == M[y][j]) break;
}
if (j == 6) return M[x][i];
}
return -1;
}
void M_init() {
int arr[6] = {1, 2, 3, 4, 5, 6};
for (int i = 1; i <= 920; ++i) {
for (int j = 5; j >= 0; --j) {
if (arr[j] < 7 + j) {
int p = arr[j];
for (int k = j; k < 6; ++k)
arr[k] = ++p;
break;
}
}
for (int j = 0; j < 6; ++j)
M[i][j] = arr[j];
}
Mr = 1;
}
static int M[924][6];
static int Mr = 0;
static void M_init();
int decode (int n, int q, int h) {
if (!Mr) M_init();
for (int i = 0; i < 6; ++i) {
if (M[q][i] == h)
return 1;
}
return 0;
}
void M_init() {
int arr[6] = {1, 2, 3, 4, 5, 6};
for (int i = 1; i <= 920; ++i) {
for (int j = 5; j >= 0; --j) {
if (arr[j] < 7 + j) {
int p = arr[j];
for (int k = j; k < 6; ++k)
arr[k] = ++p;
break;
}
}
for (int j = 0; j < 6; ++j)
M[i][j] = arr[j];
}
Mr = 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |