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

#TimeUsernameProblemLanguageResultExecution timeMemory
615609alirezasamimi100Packing Biscuits (IOI20_biscuits)C++17
100 / 100
46 ms1316 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; using ll = long long int; const int k=60; ll x; vector<ll> ps(k); map<ll,ll> mp; ll calc(ll t){ if(t<=0) return 0; if(mp.count(t)) return mp[t]; int i=0; ll y=1; for(; y<t; i++,y<<=1); i--; return calc(1ll<<i)+calc(min(t,ps[i]/x+1)-(1ll<<i)); } ll count_tastiness(ll x, vector<ll> a) { ::x=x; a.resize(k); ps[0]=a[0]; mp.clear(); for(int i=1; i<k; i++) ps[i]=(a[i]<<i)+ps[i-1]; mp[1]=1; for(int i=1; i<=k; i++) mp[1ll<<i]=calc(1ll<<i); return mp[1ll<<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...