(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 #590296

#TimeUsernameProblemLanguageResultExecution timeMemory
590296LucppPacking Biscuits (IOI20_biscuits)C++17
100 / 100
34 ms1328 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; const int k = 60; ll count_tastiness(ll x, vector<ll> a) { a.resize(k); vector<ll> dp(k+1, 1); ll sum = 0; for(int i = 1; i <= k; i++){ sum += a[i-1]*(1ll<<(i-1)); ll s = sum; ll sub = 0; for(int j = i-1; j >= 0; j--){ if((s-sub)/x >= (1ll<<j)){ dp[i] += dp[j]; sub += x*(1ll<<j); } ll v = a[j]*(1ll<<j); sub = max(0ll, sub-v); s -= v; } } return dp[k]; }
#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...