# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
418732 | 2qbingxuan | Packing Biscuits (IOI20_biscuits) | C++14 | 1093 ms | 1100 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"
#include <bits/stdc++.h>
using namespace std;
long long dfs(vector<long long> &a, long long x, int i, long long carry) {
if (i == a.size()) {
return carry / x + 1;
}
carry += a[i];
long long res = 0;
res += dfs(a, x, i+1, carry / 2); // y >> i & 1 == 0
if (carry >= x) {
res += dfs(a, x, i+1, (carry - x) / 2);
}
return res;
}
long long count_tastiness(long long x, std::vector<long long> a) {
return dfs(a, x, 0, 0);
}
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... |