Submission #575024

#TimeUsernameProblemLanguageResultExecution timeMemory
575024MajidA Difficult(y) Choice (BOI21_books)C++17
0 / 100
3 ms208 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 n, k, a; 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==k){ vector<int> temp; for(ll i = 0; i < k; i++){ // cout<<d[i].f<<" "; sum+=d[i].f; temp.pb(d[i].s); } // cout<<sum<<"\n"; if(sum>=a and sum<=2*a)answer(temp); return; } if (idx > n)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); } d.resize(k+1); c(0, 1, 0); impossible(); } // // int main(){ // // solve(5, 3, 10, 0); // } // //
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...