Submission #1015460

#TimeUsernameProblemLanguageResultExecution timeMemory
1015460UnforgettableplPacking Biscuits (IOI20_biscuits)C++17
44 / 100
142 ms15368 KiB
#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 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...