제출 #574987

#제출 시각아이디문제언어결과실행 시간메모리
574987m_fenaisA Difficult(y) Choice (BOI21_books)C++17
컴파일 에러
0 ms0 KiB
void solve(int N, int K, long long A, int S) { vector<long long> v; for(int i=1; i<=N; i++){ v.push_back(skim(i)); } for(int i=0; i<v.size()-2; i++) { long long cnt = v[i] + v[i+1] + v[i+2]; if(cnt <= A*2 && cnt >= A) { vector<int> ans; ans.push_back(i+1); ans.push_back(i+2); ans.push_back(i+3); answer(ans); } } impossible(); }

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

books.cpp: In function 'void solve(int, int, long long int, int)':
books.cpp:2:3: error: 'vector' was not declared in this scope
    2 |   vector<long long> v;
      |   ^~~~~~
books.cpp:2:10: error: expected primary-expression before 'long'
    2 |   vector<long long> v;
      |          ^~~~
books.cpp:4:5: error: 'v' was not declared in this scope
    4 |     v.push_back(skim(i));
      |     ^
books.cpp:4:17: error: 'skim' was not declared in this scope
    4 |     v.push_back(skim(i));
      |                 ^~~~
books.cpp:6:18: error: 'v' was not declared in this scope
    6 |   for(int i=0; i<v.size()-2; i++)
      |                  ^
books.cpp:11:14: error: expected primary-expression before 'int'
   11 |       vector<int> ans;
      |              ^~~
books.cpp:12:7: error: 'ans' was not declared in this scope
   12 |       ans.push_back(i+1);
      |       ^~~
books.cpp:15:7: error: 'answer' was not declared in this scope
   15 |       answer(ans);
      |       ^~~~~~
books.cpp:18:3: error: 'impossible' was not declared in this scope
   18 |   impossible();
      |   ^~~~~~~~~~