This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "biscuits.h"
#define ll long long
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
using namespace std;
long long count_tastiness(long long x, std::vector<long long> a) {
map<ll, ll> dp;
dp[0] = 1;
for (int i = 0; i < sz(a) + 100; i++) {
map<ll, ll> dp2;
ll cur = i < sz(a) ? a[i] : 0;
for (auto [j, val] : dp) {
if (j + cur >= x) dp2[(j + cur - x) >> 1] += val;
dp2[(j + cur) >> 1] += val;
}
swap(dp, dp2);
}
ll ans = 0;
for (auto [z, y] : dp) ans += y;
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |