# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1021488 | j_vdd16 | Packing Biscuits (IOI20_biscuits) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
int count_tastiness(int x, vi a)
{
constexpr int N = 60;
while (a.size() < N)
a.push_back(0);
for (int i = 1; i < N; i++)
a[i] *= (1LL << i);
vi values = { 0 };
for (int bit = 0; bit < N; bit++)
{
int sz = values.size();
loop(i, sz) {
int& count = values[i];
count += a[bit];
if (count / (1LL << bit) >= x)
values.push_back(count - x * (1LL << bit));
}
}
return values.size();
}