Submission #306416

#TimeUsernameProblemLanguageResultExecution timeMemory
306416eriksuenderhaufPacking Biscuits (IOI20_biscuits)C++17
0 / 100
16 ms896 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; #define sz(x) (int)(x).size() ll count_tastiness(ll x, vector<ll> a) { while (sz(a) < 60) a.push_back(0); vector<ll> dp(61,1), pref(61,0); dp[0] = 1; for (int i = 0; i < 60; i++) { pref[i] = (!i ? 0 : pref[i-1] / 2) + a[i]; ll sm = 0; for (int j = i; j >= 0; j--) { if (pref[j] - sm >= x) { dp[i+1] += dp[j]; sm += x; } sm = 2 * (sm - a[j]); } } return dp[60]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...