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);
vector<int> pos = {0};
pos.reserve(300000);
int sum = 0;
for(int i=0;i<=LIMIT;i++){
sum+=(1ll<<i)*a[i];
auto iter = upper_bound(pos.begin(),pos.end(),sum/x - (1ll<<i));
for(auto it = pos.begin();it!=iter;it++)pos.emplace_back(*it + (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... |