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

#TimeUsernameProblemLanguageResultExecution timeMemory
616123Bench0310Packing Biscuits (IOI20_biscuits)C++17
100 / 100
60 ms1332 KiB
#include <bits/stdc++.h> #include "biscuits.h" using namespace std; typedef long long ll; ll count_tastiness(ll x,vector<ll> a) { const int L=60; while(a.size()<L) a.push_back(0); vector<ll> s(L,0); for(int i=0;i<L;i++) s[i]=(i>0?s[i-1]:0)+a[i]*(ll(1)<<i); map<ll,ll> dp; dp[0]=1; function<ll(ll)> g=[&](ll n)->ll { if(n<0) return 0; if(dp.find(n)!=dp.end()) return dp[n]; int i=63-__builtin_clzll(n); return (dp[n]=g((ll(1)<<i)-1)+g(min(n-(ll(1)<<i),(s[i]/x-(ll(1)<<i))))); }; return g(s[L-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...