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 x, k;
vector<long long> a, pre;
int cnt(int ind, int s)
{
if (ind == 60) return 1;
if (ind < k) s += (a[ind] << ind);
int res = 0;
if (x <= (s >> ind) && (x << ind) <= s) res += cnt(ind + 1, s - (x << ind));
res += cnt(ind + 1, s);
return res;
}
long long count_tastiness(long long X, vector<long long> A)
{
x = X, a = A, k = A.size();
return cnt(0, 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... |