Submission #303336

#TimeUsernameProblemLanguageResultExecution timeMemory
303336ElegiaPacking Biscuits (IOI20_biscuits)C++17
42 / 100
1085 ms41688 KiB
#include "biscuits.h" #include <functional> #include <unordered_map> using namespace std; using ll = long long; ll count_tastiness(ll x, vector<ll> a) { a.resize(61); vector<unordered_map<ll, ll>> dp(61); function<ll(int, ll)> dfs = [&](int k, ll v) { if (k == 60) return 1LL; if (dp[k].count(v)) return dp[k][v]; ll ret = dfs(k + 1, (v + a[k]) / 2); if (v + a[k] >= x) ret += dfs(k + 1, (v + a[k] - x) / 2); return dp[k][v] = ret; }; return dfs(0, 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...