Submission #83858

# Submission time Handle Problem Language Result Execution time Memory
83858 2018-11-11T12:40:12 Z faceless Question (Grader is different from the original contest) (CEOI14_question_grader) C++14
0 / 100
7000 ms 9728 KB
int numbit (int mask) {
	int ret = 0;
	while (mask) {
		mask -= mask & -mask;
		ret ++;
	}
	return ret;
}
 
int to[2000];
 
int encode (int n, int x, int y){
	int tmp = 1;
	for (int mask = 0; mask < (1 << 12); mask ++) {
		if (numbit (mask) == 6) {
			to[tmp ++] = mask;
		}
	}
	for (int i = 0; i < 12; i++) {
		if (to[x] & (1 << i) and (to[y] & (1 << i)) == 0)
			return i + 1;
	}
}
int numbit (int mask) {
	int ret = 0;
	while (mask) {
		mask -= mask & -mask;
		ret ++;
	}
	return ret;
}
 
int to[2000];
 
int decode (int n, int q, int h){
	int tmp = 1;
	for (int mask = 0; mask < (1 << 12); mask ++) {
		if (numbit (mask) == 6) {
			to[tmp ++] = mask;
		}
	}
 
	int mask = to[q];
	if (mask & (1 << (h - 1)))
		return 1;
	return 0;
}

Compilation message

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:23:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
# Verdict Execution time Memory Grader output
1 Execution timed out 7088 ms 6500 KB Time limit exceeded
2 Execution timed out 7100 ms 9728 KB Time limit exceeded