# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
480095 | couplefire | Packing Biscuits (IOI20_biscuits) | C++17 | 1109 ms | 192924 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>
using namespace std;
#define int long long
const int K = 60;
map<int, int> dp[K];
int bound[K];
int dfs(int pos, int bd){
if(bd<0) return 0; if(pos<0) return 1;
if(dp[pos].count(bd)) return dp[pos][bd];
return dp[pos][bd] = dfs(pos-1, min(bd, bound[pos-1]))+dfs(pos-1, min(bd-(1ll<<pos), bound[pos-1]));
}
int count_tastiness(int x, vector<int> cnt){
cnt.resize(K); int cur = 0;
for(int i = 0; i<K; ++i)
cur += cnt[i]*(1ll<<i), bound[i] = cur/x, dp[i].clear();
return dfs(K-1, bound[K-1]);
}
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... |