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>
using namespace std;
typedef long long ll;
vector<ll>a,b;
ll x,n=61,lg[100009],p[65];
long long count_tastiness(ll X, vector<ll> A)
{
x=X,a=A,a.resize(n);
if(lg[2]==0)
{
for(ll i=2; i<=1e5; i++)
lg[i]=lg[i/2]+1;
}
ll ans=0;
for(ll i=0; i<=1e5; i++)
{
b=a;
for(ll j=0; j<=lg[i]; j++)
{
if((1<<j)&i)
{
if(b[j]<x)
break;
b[j]-=x;
}
b[j+1]+=b[j]/2;
if(j==lg[i])
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... |