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 <numeric>
#include <cstdio>
long long count_tastiness(long long x, std::vector<long long> a) {
int res = 0;
for (int i = 0; i <= 100000; ++i) {
int c = 0, b = 1, p = i;
for (int j = 0; j < (int) a.size(); ++j) {
c += a[j];
if ((p >> j) & 1) {
p ^= 1 << j;
c -= x;
if (c < 0) b = 0;
}
c /= 2;
}
if (p) b = 0;
res += b;
}
return res;
}
# | 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... |