#include "biscuits.h"
#include<bits/stdc++.h>
using namespace std;
long long count_tastiness(long long x, std::vector<long long> a) {
int ans = 1;
int k = a.size();
for(int i = 1;i <= 100000/x;i++){
vector <long long> aux = a;
bool eba = true;
for(int xx = 0;xx < x;xx++){
int bit = (1<<(k-1));
int y = i;
for(int j = k-1;j >= 0;j--){
while(y >= bit){
if(aux[j] > 0) {
y -= bit;
aux[j]--;
}
else break;
}
bit /= 2;
}
if(y > 0) eba = false;
}
if(eba) ans++;
}
return ans;
}
# | 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... |