Submission #575029

#TimeUsernameProblemLanguageResultExecution timeMemory
575029MajidA Difficult(y) Choice (BOI21_books)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> // #include<books.h> using namespace std; using ll = long long; using db = double; #define pb push_back #define sz(vec) ((ll)vec.size()) #define all(vec) vec.begin(), vec.end() #define f first #define s second const int MOD = 1e9 + 7; const ll BIGINF = ((ll)1e18) + 7; #define Speeed ios::sync_with_stdio(0);cin.tie(NULL); cout.tie(NULL); ll nn, kk, aa; ll arr[100007]; // ll answer(vector<int> x){ // // cout<<"ok"; // } // // ll skim(ll x){ // // return x+2; // } // // void impossible(){ // // cout<<"not ok"; // } vector<pair<ll, ll> > d; void c(ll siz, ll idx, ll sum){ if(siz==kk){ vector<int> temp; for(ll i = 0; i < kk; i++){ // cout<<d[i].f<<" "; sum+=d[i].f; temp.pb(d[i].s); } // cout<<sum<<"\n"; if(sum>=aa and sum<=2*aa)answer(temp); return; } if (idx > nn)return; d[siz].f = arr[idx]; d[siz].s = idx; c(siz+1, idx+1, sum); c(siz, idx+1, sum); } void solve(int n, int k, ll a, int s){ for(ll i = 1; i <= n; i++){ arr[i] = skim(i); } nn = n, kk = k, aa = a; d.resize(k+1); c(0, 1, 0); impossible(); } // // int main(){ // // solve(5, 3, 10, 0); // } //

Compilation message (stderr)

books.cpp: In function 'void c(ll, ll, ll)':
books.cpp:48:34: error: 'answer' was not declared in this scope
   48 |         if(sum>=aa and sum<=2*aa)answer(temp);
      |                                  ^~~~~~
books.cpp: In function 'void solve(int, int, ll, int)':
books.cpp:65:18: error: 'skim' was not declared in this scope
   65 |         arr[i] = skim(i);
      |                  ^~~~
books.cpp:72:5: error: 'impossible' was not declared in this scope
   72 |     impossible();
      |     ^~~~~~~~~~