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;
using ll = long long;
const ll N = 60 + 2;
const ll INF = 1e18;
ll dp[N];
long long count_tastiness(long long x, std::vector<long long> A) {
fill(dp, dp+N, 1);
A.resize(N);
for(int i = 1;i<N;i++)A[i] = (A[i] << i) + A[i-1];
for(int i = 0;i<N;i++){
ll k = INF;
for(int j = i-1;j>=0;j--){
k = min(k, A[j]);
if(x <= (k >> j)){
dp[i] += dp[j];
k -= (x << j);
}
}
}
return dp[N-1];
}
# | 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... |