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;
long long n;
long long lg;
long long ans = 0;
map<long long, long long> dp[2];
long long count_tastiness(long long x, vector<long long> a) {
for(int i = 0; i < 66;i++){
a.push_back(0);
}
ans = 0;
n = a.size();
dp[0][0] = 1;
for(int i = 0; i < n; i++){
for(auto c : dp[0]){
if(c.first + a[i] - x >= 0){
dp[1][(c.first + a[i] - x) / 2]+= c.second;
}
dp[1][(c.first + a[i]) / 2] += c.second;
}
dp[0] = dp[1];
dp[1].clear();
}
ans = dp[0][0];
dp[0].clear();
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... |