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 <cassert>
long long count_tastiness(long long x, std::vector<long long> a) {
std::vector<long long> val = {0};
while(a.size() < 60) a.push_back(0);
for(int i = 1; i < (int)a.size(); i++)
a[i] = (1ll << i) * a[i] + a[i-1];
for(int i = 0; i < 60; i++) {
int sz = (int)val.size();
long long lim = a[i] / x, pot = 1ll << i;
for(int j = 0; j < sz && val[j] + pot <= lim; j++)
val.push_back(val[j] + pot);
assert(val.size() <= 200000);
}
return val.size();
}
# | 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... |