Submission #42310

# Submission time Handle Problem Language Result Execution time Memory
42310 2018-02-25T22:38:22 Z hsb154 Question (Grader is different from the original contest) (CEOI14_question_grader) C++14
0 / 100
1109 ms 81200 KB
int encode (int n, int x, int y) {
	int i;
	int cnt = 0;
	for (i = 0;; i++) {
		if ((x&(1 << i)) != (y & (1 << i))) {
			if (x&(1 << i))
				return cnt +10+1;
			else
				return cnt+1;
		}
		if ((x&(1 << i))&& (y & (1 << i)))
			cnt++;
	}
}
int decode (int n, int q, int h) {
	int i;
	h -= 1;
	int cnt = 0;
	for (i = 0;; i++) {
		if (cnt == h % 10)
			break;
		if ((q & (1 << i)))
			cnt++;
	}
	if (h>=10&&(q & (1 << i)))
		return 1;
	if (h < 10 && (q & (1 << i)) == 0)
		return 1;
	return 0;
		
}
# Verdict Execution time Memory Grader output
1 Incorrect 1083 ms 80496 KB wrong answer
2 Incorrect 1109 ms 81200 KB wrong answer