Submission #422305

#TimeUsernameProblemLanguageResultExecution timeMemory
422305MonchitoPacking Biscuits (IOI20_biscuits)C++14
0 / 100
30 ms368 KiB
#include "biscuits.h" #include <map> using namespace std; using ll = long long; using mp = map<pair<int, ll>, ll>; vector<ll> A(200, 0); ll calc(int current_bit, ll val, mp& dp){ if(current_bit == 200) 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...