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) {
a.resize(20);
long long res = 0;
for (long long i = 0; i <= 100000; ++i) {
long long c = 0, b = 1, p = i;
for (long long j = 0; j < (long long) a.size(); ++j) {
c += a[j];
if ((p >> j) & 1) {
p ^= 1 << j;
c -= x;
if (c < 0) b = 0;
}
// if (i == 8) fprintf(stderr, "%lld: %lld\n", j, c);
c /= 2;
}
if (p) b = 0;
res += b;
// if (b) fprintf(stderr, "%df\n", i);
}
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... |