# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
110578 | MAMBA | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++17 | 1080 ms | 78800 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;
#define rep(i , j , k) for (int i = j; i < k; i++)
bool init = false;
constexpr int N = 1000;
int arr[N][6], ptr, ptr2, local[6];
void generate(int me = 0) {
if (me == 12) {
if (ptr != 6) return;
memcpy(arr[ptr2++] , local, sizeof(local));
return;
}
if (ptr < 6) {
local[ptr++] = me;
generate(me + 1);
ptr--;
}
generate(me + 1);
}
int decode(int junk , int q, int h) {
if (!init) {
generate();
init = true;
}
h--;
rep(i , 0 , 6)
if (arr[q][i] == h)
return true;
return false;
}
int encode(int junk, int x, int y) {
if (!init) {
generate();
init = true;
}
rep(i , 0 , 6)
if (arr[x][i] != arr[y][i])
return i + 1;
}
#include <bits/stdc++.h>
using namespace std;
#define rep(i , j , k) for (int i = j; i < k; i++)
bool init = false;
constexpr int N = 1000;
int arr[N][6], ptr, ptr2, local[6];
void generate(int me = 0) {
if (me == 12) {
if (ptr != 6) return;
memcpy(arr[ptr2++] , local, sizeof(local));
return;
}
if (ptr < 6) {
local[ptr++] = me;
generate(me + 1);
ptr--;
}
generate(me + 1);
}
int decode(int junk , int q, int h) {
if (!init) {
generate();
init = true;
}
h--;
rep(i , 0 , 6)
if (arr[q][i] == h)
return true;
return false;
}
int encode(int junk, int x, int y) {
if (!init) {
generate();
init = true;
}
rep(i , 0 , 6)
if (arr[x][i] != arr[y][i])
return i + 1;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |