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;
typedef long double ld;
typedef ll itn;
#define ff first
#define ss second
ll n;
ll lg;
ll ans=0;
map<ll, ll>dp[2];
ll count_tastiness(ll x, vector<ll> 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+66;i++){
for(auto c:dp[0]){
if(c.ff+a[i]-x>=0){
dp[1][(c.ff+a[i]-x)/2]+=c.ss;
}
dp[1][(c.ff+a[i])/2]+=c.ss;
}
dp[0]=dp[1];
dp[1].clear();
}
ans=dp[0][0];
dp[0].clear();
return ans;
}
/*
3
3 2
2 1 2
3 2
2 1 2
3 1
2 1 1
*/
# | 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... |