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;
typedef long long ll;
#define sz(x) (int)(x).size()
void dfs(ll d, ll p, ll& ret, ll x, vector<ll>& a) {
if (d > 60)
return;
p = p / 2 + (d < sz(a) ? a[d] : 0);
dfs(d + 1, p, ret, x, a);
if (p >= x) {
ret++;
dfs(d + 1, p - x, ret, x, a);
}
}
ll count_tastiness(ll x, vector<ll> a) {
ll ret = 1;
dfs(0, 0, ret, x, a);
return ret;
}
# | 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... |