Submission #942867

#TimeUsernameProblemLanguageResultExecution timeMemory
942867beepbeepsheepA Difficult(y) Choice (BOI21_books)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "books.h" using namespace std; // // --- Sample implementation for the task books --- // // To compile this program with the sample grader, place: // books.h books_sample.cpp sample_grader.cpp // in a single folder and run: // g++ books_sample.cpp sample_grader.cpp // in this folder. // #define ll long long void solve(int N, int K, long long A, int S) { // TODO implement this function s=1,e=N; for (int i=s;i<=e;i++){ arr[i]=skim(i); } if (e-s+1<K){ impossible(); return; } vector<int> v; for (int i=s;i<=e-K+1;i++){ ll tot=0; for (int j=i;j<=i+K-1;j++){ v.emplace_back(j); tot+=arr[j]; } //cerr<<endl<<i<<' '<<i+K-1<<' '<<tot<<endl; if (tot>=A && tot<=2*A){ answer(v); return; } v.clear(); } impossible(); }

Compilation message (stderr)

books.cpp: In function 'void solve(int, int, long long int, int)':
books.cpp:18:5: error: 's' was not declared in this scope
   18 |     s=1,e=N;
      |     ^
books.cpp:18:9: error: 'e' was not declared in this scope
   18 |     s=1,e=N;
      |         ^
books.cpp:20:9: error: 'arr' was not declared in this scope
   20 |         arr[i]=skim(i);
      |         ^~~
books.cpp:31:18: error: 'arr' was not declared in this scope
   31 |             tot+=arr[j];
      |                  ^~~