# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1072630 | HD1 | Packing Biscuits (IOI20_biscuits) | C++14 | 1049 ms | 25376 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 <unordered_map>
using namespace std;
long long a[200],x;
unordered_map<long long,long long> dp[200];
// dp[0][60] = 1
long long DP(int i,long long 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);
cout << i << " " << a[i] << " " << n <<endl;
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];
long long ans = DP(0,0);
for(int i = 0; i< 200; i++) dp[i].clear(), a[i] = 0;
return ans;
}
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... |