# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1033423 | Maite_Morale | Packing Biscuits (IOI20_biscuits) | C++14 | 1067 ms | 348 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
long long count_tastiness(long long x, std::vector<long long> a) {
long long c=0;
std::vector<long long> t={1},v={0};
for(long long i=0;i<64;i++){
if(i<a.size())c+=(a[i]<<i);
t.push_back(t.back());
v.push_back(c);
long long h=c/x-(1LL<<i);
long long r=0;
while(h>=0){
long long lg=0;
if(h>0)lg=log2(h)+1LL;
lg=min(lg,i);
if(h>=v[lg]){
r+=t[lg];
break;
}
r+=t[lg-1];
h-=(1LL<<(lg-1));
}
t[i+1]+=r;
}
return t[64];
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |