# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
672788 | tbzard | Packing Biscuits (IOI20_biscuits) | C++14 | 198 ms | 3564 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 ans[200002];
long long count_tastiness(long long x, vector<long long> a){
long long b = 1, sum = 0;
for(int j=0;j<=200000;j++) ans[j] = 1e18+1;
int l = 0;
ans[l++] = 0;
for(int i=0;i<60;i++){
if(i<a.size()) sum += b*a[i];
int m = upper_bound(ans, ans+l, sum/x-b)-ans-1;
for(int j=0;j<=m;j++) ans[l++] = ans[j]+b;
b*=2;
}
return l;
}
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... |