# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
996307 | Muaath_5 | Packing Biscuits (IOI20_biscuits) | C++17 | 1065 ms | 348 KiB |
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 (int i = 0; i < 60; i++) {
if (x>>i&1) {
if (a.size() < i || a[i] < N) return false;
a[i] -= N;
if (i+1 < a.size())
a[i+1] += a[i]/2;
}
}
return true;
}
long long count_tastiness(long long x, std::vector<long long> a) {
a.push_back(0);
N = x;
ll sol = 1;
for (int i = 1; i <= 200000; i++) {
if (can(i, a))
sol++;
}
return sol;
}
Compilation message (stderr)
# | 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... |