This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// #pragma GCC optimize("Ofast","unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int LIMIT = 59;
long long count_tastiness(long long x, std::vector<long long> a) {
a.resize(LIMIT+1);
set<int> pos = {0};
int sum = 0;
for(int i=0;i<=LIMIT;i++){
sum+=(1ll<<i)*a[i];
auto iter = pos.upper_bound(sum/x - (1ll<<i));
while(iter!=pos.begin()){
iter--;
pos.insert(*iter + (1ll<<i));
}
}
return pos.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... |