# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1072610 | HD1 | Packing Biscuits (IOI20_biscuits) | C++14 | 1 ms | 348 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 "biscuits.h"
#include <iostream>
#include <map>
using namespace std;
long long a[200],x;
map<long long,long long> dp[200];
// dp[0][60] = 1
long long DP(int i,int n){
if(n == 0 && i >= 60) return 1;
if(dp[i][n] != 0) return dp[i][n];
long long ans = DP(i+1,(a[i]+n)/2);
if(a[i] + n >= x)
ans += DP(i+1,(a[i]+n-x)/2);
return dp[i][n] = ans;
}
long long count_tastiness(long long xx, std::vector<long long> aa) {
x = xx;
for(int i = 0; i < aa.size(); i++) a[i] = aa[i];
return DP(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... |