# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
400001 | faresbasbs | Packing Biscuits (IOI20_biscuits) | C++14 | 1095 ms | 51836 KiB |
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 <bits/stdc++.h>
#include "biscuits.h"
using namespace std;
map<pair<long long,long long>,long long> dp;
vector<long long> a;
long long x;
long long ans(long long curr , long long val){
if(curr == a.size()){
return 1;
}
val += a[curr];
if(dp.find({curr,val}) != dp.end()){
return dp[{curr,val}];
}
long long ret = ans(curr+1,val/2);
if(val >= x){
ret += ans(curr+1,(val-x)/2);
}
return dp[{curr,val}] = ret;
}
long long count_tastiness(long long X , vector<long long> A){
dp.clear();
a = A , x = X;
while(a.size() < 60){
a.push_back(0ll);
}
return ans(0,0);
}
Compilation message (stderr)
# | 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... |