Submission #746589

# Submission time Handle Problem Language Result Execution time Memory
746589 2023-05-22T21:20:07 Z finn__ Question (Grader is different from the original contest) (CEOI14_question_grader) C++17
100 / 100
3463 ms 24132 KB
struct precalc
{
    int p[924];
    constexpr precalc() : p{}
    {
        int l = 0;
        for (int i = 0; i < 1 << 12; ++i)
            if (__builtin_popcount(i) == 6)
                p[l++] = i;
    }
};

constexpr precalc z;

int encode(int n, int x, int y) { return __builtin_ctz(z.p[x] ^ (z.p[x] & z.p[y])) + 1; }
struct precalc
{
    int p[924];
    constexpr precalc() : p{}
    {
        int l = 0;
        for (int i = 0; i < 1 << 12; ++i)
            if (__builtin_popcount(i) == 6)
                p[l++] = i;
    }
};

constexpr precalc z;

int decode(int n, int q, int h) { return (bool)(z.p[q] & (1 << (h - 1))); }
# Verdict Execution time Memory Grader output
1 Correct 3186 ms 24064 KB Output is correct - maxh = 12
2 Correct 3463 ms 24132 KB Output is correct - maxh = 12