Submission #100940

# Submission time Handle Problem Language Result Execution time Memory
100940 2019-03-15T10:50:34 Z square1001 Question (Grader is different from the original contest) (CEOI14_question_grader) C++14
27 / 100
1591 ms 126208 KB
int encode(int n, int x, int y) {
	for (int i = 0; i < 10; ++i) {
		int b1 = ((x >> i) & 1);
		int b2 = ((y >> i) & 1);
		if (b1 != b2) return (b1 == 0 ? i : 10 + i) + 1;
	}
	return -1;
}
int decode(int n, int q, int h) {
	--h;
	if (h < 10) return ((q >> h) & 1 ? 0 : 1);
	return ((q >> (h - 10)) & 1 ? 1 : 0);
}
# Verdict Execution time Memory Grader output
1 Partially correct 1591 ms 126048 KB Output is partially correct - maxh = 20
2 Partially correct 1453 ms 126208 KB Output is partially correct - maxh = 20