제출 #574986

#제출 시각아이디문제언어결과실행 시간메모리
574986m_fenaisA Difficult(y) Choice (BOI21_books)C++17
컴파일 에러
0 ms0 KiB
void solve(int N, int K, long long A, int S) { vector<ll> v; for(int i=1; i<=N; i++){ v.push_back(skim(i)); } for(int i=0; i<v.size()-2; i++) { ll 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<ll> v;
      |   ^~~~~~
books.cpp:2:10: error: 'll' was not declared in this scope
    2 |   vector<ll> v;
      |          ^~
books.cpp:2:14: error: 'v' was not declared in this scope
    2 |   vector<ll> v;
      |              ^
books.cpp:4:17: error: 'skim' was not declared in this scope
    4 |     v.push_back(skim(i));
      |                 ^~~~
books.cpp:8:7: error: expected ';' before 'cnt'
    8 |     ll cnt = v[i] + v[i+1] + v[i+2];
      |       ^~~~
      |       ;
books.cpp:9:8: error: 'cnt' was not declared in this scope; did you mean 'int'?
    9 |     if(cnt <= A*2 && cnt >= A)
      |        ^~~
      |        int
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();
      |   ^~~~~~~~~~