Submission #921355

#TimeUsernameProblemLanguageResultExecution timeMemory
921355ksujay2Packing Biscuits (IOI20_biscuits)C++17
0 / 100
1092 ms198244 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; ll count_tastiness(ll x, vector<ll> a) { int k = a.size(); map<pair<int, ll>, ll> memo; function<ll(int, ll)> f = [&] (int i, ll y) { if(i < 0) return (ll)(y == 0); if(memo.count({i, y})) return memo[{i, y}]; y = y - a[i] * (1LL << i); memo[{i, y}] = f(i - 1, max(0ll, y)) + f(i - 1, max(0ll, y + x * (1LL << i))); return memo[{i, y}]; }; return f(k - 1, 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...