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>
using namespace std;
using ll = long long;
ll count_tastiness(ll x, vector<ll> a) {
a.resize(20);
function<ll(int, ll)> f = [&] (int i, ll y) {
if(i < 0) return (ll)(y == 0);
y = y - a[i] * (1LL << i);
return f(i - 1, max(0ll, y)) + f(i - 1, max(0ll, y + x * (1LL << i)));
};
return f(19, 0);
}
# | 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... |