Submission #1136718

#TimeUsernameProblemLanguageResultExecution timeMemory
1136718vjudge2Packing Biscuits (IOI20_biscuits)C++20
0 / 100
2 ms324 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; #define int long long int count_tastiness(int x, vector<int> a) { map<int, int> dp; dp[0] = 1; for (int i = 0; i < 5; i++) a.push_back(0); int k = a.size(); for (int i = 0; i < k; i++) { map<int, int> new_dp; for (auto& [xi, y] : dp) { new_dp[(xi / 2) + a[i]] += y; if (xi >= x) new_dp[(xi - x) / 2 + a[i]] += y; } dp.swap(new_dp); // cout << i << '\n'; // for (auto& [x, y] : dp) cout << "dp[" << x << "] = " << y << '\n'; new_dp.clear(); } return (dp.count(0) ? dp[0] : 0); } /* 2 3 3 5 2 1 3 2 2 1 2 */
#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...