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>
#pragma GCC optimize("Ofast")
#define fs first
#define sc second
#define p_q priority_queue
using namespace std;
typedef long long ll;
ll count_tastiness(ll x, vector<ll> a) {
int n=a.size();
map<ll,ll> dp;
for(int i=0;i<60;i++){
a.push_back(0);
}
dp[0]=1;
for(int i=0;i<n+60;i++){
map<ll,ll> dp2;
for(auto h:dp){
dp2[h.fs/2+a[i]]+=h.sc;
if(h.fs>=x){
dp2[(h.fs-x)/2+a[i]]+=h.sc;
}
}
dp.swap(dp2);
}
ll ans=0;
for(auto h:dp){
ans+=h.sc;
}
return ans;
}
# | 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... |