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;
using namespace std;
long long count_tastiness(long long x, vector<long long> a)
{
long long dp[222][11111];
for(int i=0;i<222;i++)
for(int j=0;j<11111;j++)
dp[i][j]=0;
a.resize(126);
for(int i=0;i<125;i++)
{
long long t=max(0LL,a[i]-x);
t-=t&1;
a[i]-=t;
a[i+1]+=t/2;
}
dp[0][0]=1;
for(int i=0;i<126;i++)
for(int r=0;r<10001;r++)
{
dp[i+1][(a[i]+r)/2]+=dp[i][r];
if(a[i]+r>=x)
dp[i+1][(a[i]+r-x)/2]+=dp[i][r];
}
return dp[126][0];
}
# | 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... |