#include "biscuits.h"
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define vll vector<ll>
#define pll pair<ll, ll>
#define pb push_back
typedef long long ll;
long long count_tastiness(long long x, vector<long long> a) {
ll k=a.size();
ll re=1;
ll pw=1;
ll sum=0;
ll mn=-1;
for(ll i=0;i<k;i++){
if(a[i]==0){
pw*=2;
continue;
}
if(sum>0 && sum+mn<pw){
re*=sum/mn+1;
sum=0;
mn=pw;
}
else if(mn==-1){
mn=pw;
}
sum+=pw*a[i];
pw*=2;
}
if(sum>0) re*=sum/mn+1;
return re;
}
# | 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... |