(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #306418

#TimeUsernameProblemLanguageResultExecution timeMemory
306418eriksuenderhaufPacking Biscuits (IOI20_biscuits)C++17
100 / 100
18 ms1024 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]); sm = max(sm, 0ll); } } 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...