Submission #1260827

#TimeUsernameProblemLanguageResultExecution timeMemory
1260827niepamietamhaslaQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++20
Compilation error
0 ms0 KiB
void obliczv1(){
	int c = 1;
	while(v1.size() < 921){
		if(__builtin_popcount(c) == 6) v1.push_back(c);
		c++;
	}
	return;
}

int encode(int n, int x, int y){
    obliczv1();
	int i1 = v1[x];
	int i2 = v1[y];
	for(int i = 0; i < 12; ++i){
		if((i1 & (1 << i)) and !(i2 & (1 << i))){
			return i + 1;
		}
	}
    return 0;
}
void obliczv2(){
	int c = 1;
	while(v2.size() < 921){
		if(__builtin_popcount(c) == 6) v2.push_back(c);
		c++;
	}
	return;
}

int decode(int n, int q, int h){
    obliczv2();
	int licz = v2[q];
	h--;
	if(licz & (1 << h)){
		return 1;
	}
	else{
		return 0;
	}
	return -1;
}

Compilation message (stderr)

# 1번째 컴파일 단계

encoder.cpp: In function 'void obliczv1()':
encoder.cpp:3:15: error: 'v1' was not declared in this scope
    3 |         while(v1.size() < 921){
      |               ^~
encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:12:18: error: 'v1' was not declared in this scope; did you mean 'i1'?
   12 |         int i1 = v1[x];
      |                  ^~
      |                  i1