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;
#define sz(x) (int)(x).size()
ll count_tastiness(ll x, vector<ll> a) {
while (sz(a) < 60)
a.push_back(0);
ll ret = 1;
vector<vector<ll>> dp(61, vector<ll>(2*x+1, 0));
dp[0][0] = 1;
ll pref = 0;
for (int i = 0; i < 60; i++) {
pref = pref / 2 + a[i];
for (int j = 0; j <= min(pref,x); j++) if (dp[i][j] != 0) {
dp[i+1][pref / 2 - (pref-j) / 2] += dp[i][j];
if (pref - j >= x) {
ret += dp[i][j];
dp[i+1][pref/2-(pref-j-x)/2] += dp[i][j];
}
}
}
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... |