Submission #425615

#TimeUsernameProblemLanguageResultExecution timeMemory
425615muhammad_hokimiyonPacking Biscuits (IOI20_biscuits)C++14
0 / 100
4 ms372 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); 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...