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"
#define ll long long
ll N;
bool can(long long x, std::vector<long long> a) {
for (long long i = 0; i < 60; i++) {
if ((x>>i)&1) {
if (a[i] < N) return false;
a[i] -= N;
}
a[i+1] += a[i]/2;
}
return true;
}
long long count_tastiness(long long x, std::vector<long long> a) {
a.resize(61);
N = x;
ll sol = 1;
for (int i = 1; i <= 200000; i++)
if (can(i, a))
sol++;
return sol;
}
# | 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... |