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

#TimeUsernameProblemLanguageResultExecution timeMemory
342097chenwzPacking Biscuits (IOI20_biscuits)C++14
100 / 100
17 ms1516 KiB
#include <bits/stdc++.h> #include "biscuits.h" using namespace std; typedef long long LL; const int NN = 63; LL count_tastiness(LL x, vector<LL> a) { vector <LL> S(NN, 0), D(NN, 0); LL s = 0; for (size_t i = 0; i < NN; i++) { if (i < a.size()) s += a[i] << i; S[i] = s; } D[0] = 1; for (int i = 1; i < NN; i++) { LL cur = s; D[i] = 1; int j = i; while (j--) { cur = min(cur, S[j]); if (x <= cur >> j) cur -= x << j, D[i] += D[j]; } } return D.back(); }
#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...