Submission #44552

#TimeUsernameProblemLanguageResultExecution timeMemory
44552wzyQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++11
Compilation error
0 ms0 KiB
int encode (int n, int x, int y) {
 	for(int j = 0 ; j <= 10 ; i++){
			if((x & 1<<j) && !(y & 1<<j)){
				return j + 1;
			}
		}
}
int decode (int n, int q, int h) {
	h--;
	if(q & 1<<h){
		return 1;
	}
	return 0;
}

Compilation message (stderr)

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:2:29: error: 'i' was not declared in this scope
   for(int j = 0 ; j <= 10 ; i++){
                             ^
encoder.cpp:7:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^