#include "biscuits.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
long long count_tastiness(long long x, vector<long long> a) {
ll su=0;
reverse(a.begin(),a.end());
while (a.size() && !a.back())
a.pop_back();
reverse(a.begin(),a.end());
while (a.size() && !a.back())
a.pop_back();
ll mul=1;
for (int i=0;i<a.size();i++)
{
su+=a[i]*(1ll<<i);
if (su<(1ll<<i)) mul*=2;
}
return (su+1)/mul;
}
# | 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... |