제출 #451541

#제출 시각아이디문제언어결과실행 시간메모리
451541kingfran1907Question (Grader is different from the original contest) (CEOI14_question_grader)C++14
0 / 100
4621 ms24104 KiB
int encode (int n, int x, int y) {
	for (int i = 0; i < 20; i++) {
		if ((x & (1 << i)) != (y & (1 << i))) {
			if (x & (1 << i)) return 2 * i + 3;
			else return 2 * i + 2;
		}
	}
}
int decode (int n, int q, int h) {
	h -= 2;
	int dig = h / 2;
	int ac = h % 2;
	
	if ((q & (1 << dig)) == (ac << dig)) return 1;
	else return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:8:1: warning: control reaches end of non-void function [-Wreturn-type]
    8 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...