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 <bits/stdc++.h>
#include "biscuits.h"
using namespace std;
typedef long long LL;
const int NN = 63;
LL count_tastiness(LL x, vector<LL> a) {
vector <LL> S(NN, 0), D(NN, 0);
LL s = 0;
for (size_t i = 0; i < NN; i++) {
if (i < a.size()) s += a[i] << i;
S[i] = s;
}
D[0] = 1;
for (int i = 1; i < NN; i++) {
LL cur = s; D[i] = 1;
int j = i;
while (j--) {
cur = min(cur, S[j]);
if (x <= cur >> j) cur -= x << j, D[i] += D[j];
}
}
return D.back();
}
# | 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... |