# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1216426 | boris_mihov | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++20 | 718 ms | 39776 KiB |
/*
nice
*/
static const int MAXN = 920 + 5;
static bool isBuilt;
static int respectiveNumber[MAXN];
int encode (int n, int x, int y)
{
if (!isBuilt)
{
isBuilt = true;
int ptr = 1;
for (int mask = 0 ; mask < (1 << 12) ; ++mask)
{
if (__builtin_popcount(mask) != 6)
{
continue;
}
respectiveNumber[ptr++] = mask;
}
}
for (int bit = 0 ; bit < 12 ; ++bit)
{
if ((respectiveNumber[x] & (1 << bit)) && !(respectiveNumber[y] & (1 << bit)))
{
return bit + 1;
}
}
}
static const int MAXN = 920 + 5;
static bool isBuilt;
static int respectiveNumber[MAXN];
int decode (int n, int x, int y)
{
if (!isBuilt)
{
isBuilt = true;
int ptr = 1;
for (int mask = 0 ; mask < (1 << 12) ; ++mask)
{
if (__builtin_popcount(mask) != 6)
{
continue;
}
respectiveNumber[ptr++] = mask;
}
}
if (respectiveNumber[x] & (1 << y - 1)) return 1;
else return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |