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 <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];
dp[0][0] = 1;
for(int i = 0; i < len(a) + 7; i++){
for(auto v : dp[i]){
dp[i + 1][((v.fr + (i >= len(a) ? 0 : a[i])) / 2)] += v.sc;
if((i >= len(a) ? 0 : a[i]) + v.fr >= x) dp[i + 1][(v.fr + (i >= len(a) ? 0 : a[i]) - x) / 2] += v.sc;
}
}
ll ret = 0;
for(auto v : dp[len(a) + 7]){
ret += v.sc;
}
return ret;
}
# | 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... |