#include "grader.h"
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);
}
#include "grader.h"
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;
}
Compilation message
encoder.cpp:1:20: fatal error: grader.h: No such file or directory
#include "grader.h"
^
compilation terminated.decoder.cpp:1:20: fatal error: grader.h: No such file or directory
#include "grader.h"
^
compilation terminated.