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

#TimeUsernameProblemLanguageResultExecution timeMemory
425620muhammad_hokimiyonPacking Biscuits (IOI20_biscuits)C++14
100 / 100
109 ms1316 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; #define ll long long map<ll, ll> d,s; ll g(ll n, ll x) { if(n <= 0)return 0ll; if(n == 1)return 1ll; if(d.find(n) != d.end())return d[n]; ll i = 0; while(i < 100){ if((1ll << i) < n && n <= (1ll << (i + 1)))break; i++; } return d[n] = g((1ll << i), x) + g(min(n, 1 + s[i] / x) - (1ll << i), x); } long long count_tastiness(long long x, std::vector<long long> a) { ll ans = 0; while((int)a.size() < 100)a.push_back(0ll); for(int i = 0; i < 100; i++){ s[i] = s[i - 1] + (1ll << i) * a[i]; } ans += g((1ll << 60), x); d.clear(); s.clear(); return ans; }
#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...