# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
399998 | faresbasbs | Packing Biscuits (IOI20_biscuits) | C++14 | 2 ms | 332 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<int,long long>,long long> dp;
vector<long long> a;
int x;
long long ans(int 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){
a = A , x = X;
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... |