Submission #422301

#TimeUsernameProblemLanguageResultExecution timeMemory
422301MonchitoPacking Biscuits (IOI20_biscuits)C++14
0 / 100
15 ms384 KiB
#include "biscuits.h" #include <map> using namespace std; using ll = long long; using mp = map<pair<int, ll>, ll>; vector<ll> A(64, 0); ll calc(int current_bit, ll val, mp& dp){ if(current_bit == 63) return 1; if(dp.find({current_bit, val}) != dp.end()) return dp[{current_bit, val}]; if(val == 0) return dp[{current_bit, val}] = calc(current_bit+1, A[current_bit+1], dp); return dp[{current_bit, val}] = calc(current_bit+1, A[current_bit+1] + val/2, dp) + calc(current_bit+1, A[current_bit+1] + (val-1)/2, dp); } ll count_tastiness(ll x, vector<ll> a) { mp dp; for(int i=0; i<(int)a.size(); i++) A[i] = a[i]; return calc(0, A[0], dp); }
#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...