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 "biscuits.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll x, k;
vector<ll> a;
ll count_tastiness(ll _x, vector<ll> _a){
x = _x, a = _a;
k = a.size();
map<ll, ll> curr, prev;
prev[0] = 1;
for(int i = 0; i < k; ++i, swap(prev, curr)){
curr.clear();
for(auto [key, value]: prev){
ll t = key + a[i];
curr[t / 2] += value;
if(t >= x) curr[(t - x) / 2] += value;
}
}
ll ans = 0;
for(auto [key, value]: prev)
ans += (key / x + 1) * value;
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... |