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 rep(i,n)for(int i=0;i<int(n);i++)
using namespace std;
typedef long long ll;
long long count_tastiness(long long x, std::vector<long long> a) {
ll sum=0;
rep(i,a.size()){
sum+=(1LL<<i)*a[i];
}
ll ans=0;
for(ll i=0;i<=sum;i++){
auto b=a;
b.resize(61);
bool ok=true;
for(int j=0;j<60;j++){
if(i>>j&1){
if(b[j]<x){ok=false;break;}
b[j]-=x;
}
b[j+1]+=b[j]/2;
}
if(ok)ans++;
}
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... |