# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
565423 | 2fat2code | Packing Biscuits (IOI20_biscuits) | C++17 | 1089 ms | 340 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>
#define fr first
#define sc second
#define all(s) s.begin(), s.end()
#define int long long
using namespace std;
int ans;
int count_tastiness(int x, vector<int> a) {
ans = 1;
int sum = 0;
int nrbiti = (int)a.size();
for(int i=0;i<nrbiti;i++){
sum += a[i] * (1LL << i);
}
for(int curr=1;curr<=(sum/x);curr++){
vector<int>b = a;
b.push_back(0);
for(int i=0;(1LL<<i)<=curr;i++){
if(i == b.size() - 1) b.push_back(0);
if(curr & (1LL<<i) && b[i] < x){
goto next;
}
else{
if(curr & (1LL << i)) b[i] -= x;
b[i+1] += (b[i] / 2);
}
}
++ans;
next:;
}
return ans;
}
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... |