#include <iostream>
#include <vector>
#include "biscuits.h"
using namespace std;
typedef long long ll;
#define int ll
int ways[63];
int ct[63];
int count_tastiness(int x, vector<int> a)
{
int tot = 0;
ways[0] = 1;
a.resize(64);
for(int i = 0; i < 62; i ++)
{
int way = 0;
tot += a[i] * (1ll << i);
ct[i] = tot;
int tot2 = tot;
for(int j = i; j >= 0; j --)
{
tot2 = min(tot2, ct[j]);
if((1ll << 62) / x >= (1ll << j) && tot2 >= x * (1ll << j))
tot2 -= x * (1ll << j),
way += ways[j];
}
ways[i + 1] = way + 1;
}
return ways[62];
}
# | 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... |