# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1023220 | codefox | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++14 | 0 ms | 0 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.
#pragma GCC target("popcnt")
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
int encode(int n, int a, int b)
{
int k = 0;
int aa=0, bb=0;
for (int j = 30; j < (1<<12); j++)
{
if (__builtin_popcount(j)==6)
{
k++;
if (k==a) aa = j;
if (k==b) bb = j;
}
}
for (int h = 0; h< 12; h++)
{
if ((aa&(1<<h)) && (bb&(1<<h)==0)) return h+1;
}
}
#pragma GCC optimize("popcnt")
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
int decode(int n, int q, int h)
{
h--;
int k = 0;
int qq=0
for (int j = 30; j < (1<<12); j++)
{
if (__builtin_popcount(j)==6)
{
k++;
if (k==q) qq = j;
}
}
if (qq&(1<<h)) return true;
return false;
}