#pragma GCC optimize("O4,Ofast")
#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;
typedef __int128 i128;
namespace{
ll k;
const ll mxN=2e5+5;
const ll inf=2e18;
const ll LOG=63;
ll a[LOG];
vll v[LOG+1];
}
long long count_tastiness(long long x, vector<long long> A) {
k=A.size();
for(ll i=0;i<LOG;i++){
v[i].clear();
}
memset(a, 0, sizeof(a));
for(ll i=0;i<k;i++){
a[i]=A[i];
}
ll ans=0;
for(ll i=0;i<=mxN;i++){
ll sum=0;
bool good=1;
for(ll j=0;j<LOG;j++){
sum+=a[j]*(1LL<<j);
ll tep=i&((1LL<<(j+1))-1);
if(sum/x<tep){
good=0;
break;
}
}
if(good) ans++;
}
// cout<<"_______\n";
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... |