| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 25926 | imsifile | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++98 | 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.
int N = 920, cnt, ba[930];
bool fl=1;
int dfs(int ix, int c0, int c1, int su){
	if(ix==12){ ba[cnt++]=su; return; }
	if(c0) dfs(ix+1, c0-1, c1, su);
	if(c1) dfs(ix+1, c0, c1-1, su|(1<<ix));
}
void init(){
	dfs(0, 6, 6, 0);
}
int encode (int n, int x, int y) {
	if(fl)init(), fl=0;
	for(int i=0; i<12; i++){
		if((ba[x-1] & (1<<i)) && (ba[y-1] & (1<<i))==0) return i+1;
	}
	return 0;
}
int N = 920, cnt, ba[930];
bool fl=1;
int dfs(int ix, int c0, int c1, int su){
	if(ix==12){ ba[cnt++]=su; return; }
	if(c0) dfs(ix+1, c0-1, c1, su);
	if(c1) dfs(ix+1, c0, c1-1, su|(1<<ix));
}
void init(){
	dfs(0, 6, 6, 0);
}
int decode (int n, int q, int h) {
	if(fl)init(), fl=0;
	return (ba[q-1] & (1<<(h-1))) ? 1 : 0;
}
