이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |