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;
const int k = 60;
long long sum[k], dp[k];
long long count_tastiness( long long x, vector <long long> a ) {
a.resize( k );
dp[0] = 1;
for ( int i = 1; i < k; i++ ) {
a[i] = a[i - 1] + (a[i] << i);
dp[i] = 1;
long long r = 1e18;
for ( int j = i - 1; j >= 0; j-- ) {
r = min( r, a[j] );
if ( x <= (r >> j) ) {
dp[i] += dp[j];
r -= (x << j);
}
}
}
return dp[k - 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... |