#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--){
int qtd = y/bit;
if(aux[j] < qtd) qtd = aux[j];
y -= qtd*bit;
bit/= 2;
aux[j] -= qtd;
}
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... |