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;
const int k = 4;
long long x;
long long biscuits[k];
__int128 sum[k];
vector<long long> sol, newSol;
long long count_tastiness( long long X, vector <long long> a ) {
long long s;
x = X;
a.resize( k );
s = 0;
for ( int b = 0; b < k; b++ ) {
a[b] += s;
if ( a[b] > x ) {
s = a[b] - x;
a[b] = x + s % 2;
s /= 2;
} else
s = 0;
biscuits[b] = a[b];
}
sum[0] = biscuits[0];
for ( int b = 1; b < k; b++ )
sum[b] = sum[b - 1] + ((__int128)biscuits[b] << b);
sol.clear();
sol.push_back( 0 );
for ( int b = 0; b < k; b++ ) {
vector<long long> newSol;
for ( int y: sol ) {
if ( y + (1LL << b) <= sum[b] / x )
newSol.push_back( y + (1LL << b) );
else
break;
}
printf( "\n" );
for ( int y: newSol )
sol.push_back( y );
}
return sol.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... |