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

#TimeUsernameProblemLanguageResultExecution timeMemory
620072sofapudenPacking Biscuits (IOI20_biscuits)C++14
100 / 100
61 ms1364 KiB
#include "biscuits.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; map<ll,ll> dp; ll A[61]; ll x; ll f(ll n){ if(n <= 0)return 0; if(n == 1)return 1; if(dp.find(n) != dp.end())return dp[n]; ll a = __lg(n-1); return dp[n] = f(1ll<<a) + f(min(n,1+A[a]/x)-(1ll<<a)); } ll count_tastiness(ll k, vector<ll> a) { x = k; dp.clear(); while(a.size() <= 60)a.push_back(0); A[0] = a[0]; for(int i = 1; i <= 60; ++i)A[i] = A[i-1] + (a[i]<<i); return f(A[60]+1); }
#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...