# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
672781 | tbzard | Packing Biscuits (IOI20_biscuits) | C++14 | 1096 ms | 104084 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, vector<long long> a){
int n = a.size();
long double b = 1, sum = 0;
set<long double> ans;
ans.insert(0);
for(int i=0;i<a.size();i++){
sum += b*a[i];
while(1){
vector<long double> add;
set<long double>::reverse_iterator it;
for(it = ans.rbegin(); it != ans.rend(); it++){
long long val = *it+(1ll<<i);
if(sum/x >= val){
if(ans.find(val) != ans.end()){
break;
}
add.push_back(val);
}
}
for(int j=0;j<add.size();j++){
ans.insert(add[j]);
}
if(add.empty()) break;
}
b *= 2;
}
return (long long)ans.size();
}
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... |