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>
#define all(x) x.begin(),x.end()
#define ll long long
using namespace std ;
long long count_tastiness(long long x, vector<long long> a )
{
while( (int)(a.size()) < 60 ) { a.push_back(0LL) ; } ;
vector<ll> pos(1,0LL) ;
ll curSoma = 0LL ;
for(int i = 0 ; i < 30 && (LLONG_MAX/x) > (1LL<<i); i++ )
{
curSoma += a[i] * (1LL<<i) ;
int idx = upper_bound(all(pos), curSoma - x*(1LL<<i) ) - pos.begin() - 1 ;
for(int j = 0 ; j <= idx ; j++ )
pos.push_back( pos[j] + x*(1LL<<i) ) ;
}
return (int)(pos.size() ) ;
}
# | 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... |