Submission #1014812

#TimeUsernameProblemLanguageResultExecution timeMemory
1014812UnforgettableplPacking Biscuits (IOI20_biscuits)C++17
0 / 100
1100 ms240020 KiB
#include <bits/stdc++.h> using namespace std; long long count_tastiness(long long x, std::vector<long long> a) { map<pair<int,int>,long long> memo; function<long long(int,int)> calc = [&](int i,int j){ j=max(j,0); if(memo.count({i,j}))return memo[{i,j}]; if(i==-1)return j==0 ? 1ll : 0ll; long long ac = calc(i-1,2*(j-a[i])); if(ac)return memo[{i,j}] = calc(i-1,2*(j-a[i]+x))+ac; }; return calc(a.size()-1,0); }

Compilation message (stderr)

biscuits.cpp: In lambda function:
biscuits.cpp:12:2: warning: control reaches end of non-void function [-Wreturn-type]
   12 |  };
      |  ^
#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...