Submission #42308

# Submission time Handle Problem Language Result Execution time Memory
42308 2018-02-25T22:36:55 Z hsb154 Question (Grader is different from the original contest) (CEOI14_question_grader) C++14
Compilation error
0 ms 0 KB
int decode (int n, int q, int h) {
	int i;
	h -= 1;
	int cnt = 0;
	for (i = 0;; i++) {
		if (cnt == h % 9)
			break;
		if ((q & (1 << i)))
			cnt++;
	}
	if (h>=9&&(q & (1 << i)))
		return 1;
	if (h < 9 && (q & (1 << i)) == 0)
		return 1;
	return 0;
		
}
int decode (int n, int q, int h) {
	int i;
	h -= 1;
	int cnt = 0;
	for (i = 0;; i++) {
		if (cnt == h % 8)
			break;
		if ((q & (1 << i)))
			cnt++;
	}
	if (h>=8&&(q & (1 << i)))
		return 1;
	if (h < 8 && (q & (1 << i)) == 0)
		return 1;
	return 0;
		
}

Compilation message

/tmp/ccDltaxu.o: In function `main':
grader_encode.c:(.text.startup+0x10a): undefined reference to `encode(int, int, int)'
collect2: error: ld returned 1 exit status