Submission #1014896

#TimeUsernameProblemLanguageResultExecution timeMemory
1014896UnforgettableplPacking Biscuits (IOI20_biscuits)C++17
0 / 100
1065 ms213588 KiB
#include <bits/stdc++.h> using namespace std; const int LIMIT = 30; long long count_tastiness(long long x, std::vector<long long> a) { map<pair<int,int>,long long> memo; function<long long(long long,long long)> calc = [&](long long i,long long j){ j=max(j,0ll); j=min(j,(long long)1e18); if(memo.count({i,j}))return memo[{i,j}]; if(i==-1)return j==0 ? 1ll : 0ll; long long ac = calc(i-1,2ll*(j-a[i])); if(ac>0)return memo[{i,j}] = calc(i-1,2ll*(j-a[i]+x))+ac; else return memo[{i,j}]=0ll; }; a.resize(LIMIT+1); return calc(LIMIT,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...