# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
11167 | gs13068 | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++98 | 1588 ms | 25680 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 flag;
static int a[1000];
void init()
{
if(!flag)
{
int i,j,k,n=0;
for(i=0;i<4096;i++)
{
k=0;
for(j=0;j<12;j++)k+=(i>>j)&1;
if(k==6)a[n++]=i;
}
flag=1;
}
}
int encode(int N,int x,int y)
{
int i;
init();
for(i=0;i<12;i++)if(((a[x]>>i)&1)&&!((a[y]>>i)&1))return i+1;
while(1);
}
static int flag;
static int a[1000];
void init()
{
if(!flag)
{
int i,j,k,n=0;
for(i=0;i<4096;i++)
{
k=0;
for(j=0;j<12;j++)k+=(i>>j)&1;
if(k==6)a[n++]=i;
}
flag=1;
}
}
int decode(int N,int x,int y)
{
init();
return (a[x]>>(y-1))&1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |