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>
namespace{
using namespace std;
using ll = long long;
}
long long count_tastiness(long long x, std::vector<long long> a) {
ll k = a.size();
ll tot = 0;
for(ll i= 0 ;i<k;i++) tot += a[i]<<i;
if (x>tot) return 1;
/*if (tot<=100000){
ll mx = tot/x;
vector<ll> b;
for(ll i= 0 ;i<k;i++){
for(ll j = 0;j<a[i];j++){
b.push_back(1<<i);
}
}
reverse(b.begin(),b.end());
ll ans = 0;
for(ll i = 0;i<=mx;i++){
vector<ll> o(x,i);
for(ll j : b){
for(ll p = 0;p<x;p++){
}
}
}
}*/
if (x==1){
ll lf = 0;
vector<ll> v;
ll cur = 0;
for(ll i = 0;i<k;i++){
if (a[i]){
ll z = 1<<(i-lf);
if (z<=cur+1){
cur += z*a[i];
}else{
v.push_back(cur);
cur = a[i];
lf = i;
}
}
//cerr << cur << endl;
}
v.push_back(cur);
ll ans = 1;
for(ll i : v) ans *= i+1;
return ans;
}
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... |