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;
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;
}
p[0]=a[0];
for(ll i=1; i<n; i++)
p[i]=p[i-1]+((1LL<<i)*a[i]);
ll ans=0;
for(ll i=1; i<=1e5; i++)
if(p[lg[i]]>=i*x)
ans++;
return ans+1;
}
# | 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... |