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;
typedef vector<ll> vl;
#define sz(x) (int)(x).size()
#define pb push_back
int k;
vl a;
ll x;
ll tpow[60];
bool possible(ll y){
vl A = a;
for(int i = 0; i <= 59; i++){
if((y>>i)&1){
A[i]-=x;
}
if(A[i] < 0) return 0;
if(i+1 < 60){
A[i+1]+=A[i]/2;
}
}
//cout << y << "\n";
return 1;
}
ll solveCase1(){
while(sz(a) < 60){
a.pb(0);
}
int ans = 0;
for(int y = 0; y <= 100000; y++){
if(possible(y)){
ans++;
}
}
return ans;
}
ll count_tastiness(ll _x, vl _a) {
x = _x;
a = _a;
k = sz(a);
tpow[0] = 1;
for(int i = 1; i <= 59; i++){
tpow[i] = tpow[i-1]*2;
}
bool CASE1 = 1;
if(CASE1){
return solveCase1();
}
return 0;
}
# | 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... |