제출 #1262238

#제출 시각아이디문제언어결과실행 시간메모리
1262238miniob질문 (CEOI14_question_grader)C++20
컴파일 에러
0 ms0 KiB
vector<int> maska; int encode(int n, int x, int y) { if(maska.size() == 0) { for(int i = 0; i < 1 << 12; i++) { bitset<12> temp = i; if(temp.count() == 6) { maska.push_back(i); } } } for(int i = 0; i < 12; i++) { if((maska[x] & (1 << i)) > 0 && (maska[y] & (1 << i)) == 0) { //cout << i + 1 << endl; return i + 1; } } //cout << (maska[L] & (1 << 4)) << endl; //cout << maska[L] << " " << maska[P] << endl; //cout << "kon" << endl; }
int decode(int n, int q, int h) { return (maska[q] & (1 << (h - 1))); }

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

# 1번째 컴파일 단계

encoder.cpp:1:1: error: 'vector' does not name a type
    1 | vector<int> maska;
      | ^~~~~~
encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:5:7: error: 'maska' was not declared in this scope
    5 |    if(maska.size() == 0)
      |       ^~~~~
encoder.cpp:9:13: error: 'bitset' was not declared in this scope
    9 |             bitset<12> temp = i;
      |             ^~~~~~
encoder.cpp:9:24: error: 'temp' was not declared in this scope
    9 |             bitset<12> temp = i;
      |                        ^~~~
encoder.cpp:18:13: error: 'maska' was not declared in this scope
   18 |         if((maska[x] & (1 << i)) > 0 && (maska[y] & (1 << i)) == 0)
      |             ^~~~~
encoder.cpp:27:1: warning: control reaches end of non-void function [-Wreturn-type]
   27 | }
      | ^