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

#TimeUsernameProblemLanguageResultExecution timeMemory
308377tincanPacking Biscuits (IOI20_biscuits)C++17
100 / 100
104 ms1016 KiB
#include<iostream> #include<algorithm> #include<cstring> #include<queue> #include<vector> #include<cmath> #include<map> #include<stack> #include<set> #include<deque> #include<string> #include<unordered_map> #include<bitset> #include<random> #include<chrono> #include<cstdarg> //Eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee using namespace std; const int MAXN = 61; typedef long long ul; map<ul, ul> dp; ul X; vector<ul> psa; ul f(ul i) { if (i == 0) return 1; if (i < 0) return 0; if (dp.find(i) == dp.end()) { ul mx = 0; for (mx = MAXN; mx >= 0; mx--) if (i >> mx & 1) break; dp[i] = f((1LL << mx) - 1) + f(min(i, psa[mx] / X) - (1LL << mx)); } return dp[i]; } ul count_tastiness(ul x, vector<ul> a) { X = x; a.resize(MAXN); dp.clear(); psa = vector<ul>(MAXN); psa[0] = a[0]; for (int i = 1; i < MAXN; i++) psa[i] = psa[i - 1] + (a[i] << i); return f((1LL << 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...