Submission #605437

#TimeUsernameProblemLanguageResultExecution timeMemory
605437HamletPetrosyanPacking Biscuits (IOI20_biscuits)C++17
42 / 100
1089 ms72592 KiB
#include "biscuits.h" #include <iostream> #include <map> using namespace std; #define ll long long #define add push_back #define len(a) ((int)(a).size()) #define fr first #define sc second long long count_tastiness(long long x, vector<long long> a) { map<ll, ll> dp[70]; for(int i = len(a); i < 66; i++){ a.add(0); } dp[0][0] = 1; for(int i = 0; i < len(a); i++){ for(auto v : dp[i]){ dp[i + 1][((v.fr + a[i]) / 2)] += v.sc; if(a[i] + v.fr >= x) dp[i + 1][(v.fr + a[i] - x) / 2] += v.sc; } } return dp[len(a)][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...