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 <iostream>
#include <map>
using namespace std;
#define ll long long
#define add push_back
#define len(a) ((int)(a).size())
#define fr first
#define sc second
long long count_tastiness(long long x, vector<long long> a) {
vector<long long> v;
v.resize(70);
for(int i = 0; i < 70; i++){
if(i < len(a)){
v[i] += a[i];
}
v[i + 1] += (v[i] % x) / 2;
v[i] /= x;
}
map<ll, ll> dp[80];
dp[0][0] = 1;
for(int i = 0; i < len(v); i++){
for(auto h : dp[i]){
dp[i + 1][((h.fr + v[i]) / 2)] += h.sc;
if(v[i] + h.fr >= 1) dp[i + 1][(h.fr + v[i] - 1) / 2] += h.sc;
}
}
return dp[len(v)][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... |