# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
834067 | finn__ | Packing Biscuits (IOI20_biscuits) | C++17 | 1043 ms | 340 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 <bits/stdc++.h>
#include "biscuits.h"
using namespace std;
constexpr size_t N = 60;
using L = long long;
L count_tastiness(L x, std::vector<L> a)
{
a.resize(19);
size_t ans = 0;
for (size_t i = 0; i <= 100000; ++i)
{
size_t leftover = 0;
bool possible = 1;
for (size_t j = 0; j < 19; ++j)
{
leftover >>= 1;
if (i & (1 << j))
{
possible &= leftover + a[j] >= x;
if (!possible)
break;
leftover = leftover + a[j] - x;
}
else
{
leftover += a[j];
}
}
ans += possible;
}
return ans;
}
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... |