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>
#include "biscuits.h"
using namespace std;
long long count_tastiness(long long x , vector<long long> a){
while(a.size() < 60){
a.push_back(0ll);
}
long long sum = 0 , val = 1;
vector<long long> all = {0ll};
for(int i = 0 ; i < (int)a.size() ; i += 1){
sum += val*a[i];
long long y = min(sum/x,2*val-1);
if(y >= val){
int f = all.size();
for(int j = 0 ; j < f ; j += 1){
if(all[j]+val > y){
break;
}
all.push_back(all[j]+val);
}
}
val *= 2;
}
return all.size();
}
# | 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... |