제출 #1260828

#제출 시각아이디문제언어결과실행 시간메모리
1260828niepamietamhasla질문 (CEOI14_question_grader)C++20
컴파일 에러
0 ms0 KiB
vector<int> v1; 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; }
vector<int> v2; 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; }

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

# 1번째 컴파일 단계

encoder.cpp:1:1: error: 'vector' does not name a type
    1 | vector<int> v1;
      | ^~~~~~
encoder.cpp: In function 'void obliczv1()':
encoder.cpp:5:15: error: 'v1' was not declared in this scope
    5 |         while(v1.size() < 921){
      |               ^~
encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:14:18: error: 'v1' was not declared in this scope; did you mean 'i1'?
   14 |         int i1 = v1[x];
      |                  ^~
      |                  i1