# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
560513 | AlperenT | Packing Biscuits (IOI20_biscuits) | C++17 | 1149 ms | 1133172 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 "biscuits.h"
#include <bits/stdc++.h>
using namespace std;
long long count_tastiness(long long x, vector<long long> arr){
vector<long long> prv, cur;
while(!arr.empty() && arr.back() == 0) arr.pop_back();
cur.push_back(0);
int k = 0;
while(true){
bool flag = false;
long long cnt = k < arr.size() ? arr[k] : 0;
for(auto i : cur) if(i / 2 + cnt - x >= 0) flag = true;
if(flag || k < arr.size()){
prv = cur; cur.clear();
for(auto i : prv){
cur.push_back(i / 2 + cnt);
if(i / 2 + cnt - x >= 0) cur.push_back(i / 2 + cnt - x);
}
}
else break;
k++;
}
return cur.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... |