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;
vector<long long> A;
long long f(long long n) {
if (n == 60) return 1;
A[n+1] += A[n]/2;
long long ans = f(n+1);
A[n+1] -= A[n]/2;
if (A[n] >= X) {
A[n] -= X, A[n+1] += A[n]/2;
ans += f(n+1);
A[n+1] -= A[n]/2, A[n] += X;
}
return ans;
}
long long count_tastiness(long long x, vector<long long> a) {
while (a.size() < 60) a.push_back(0);
X = x, A = a;
return f(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... |