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 ll long long
using namespace std;
ll res,br,K,kol[130],stepen[130],del;
void reset(){
res=1;
}
ll count_tastiness(ll x,vector<ll> A){
reset();
stepen[0]=1;
for(int i=1;i<=60;i++)
stepen[i]=stepen[i-1]*2;
for(int i=61;i<=129;i++)
stepen[i]=1;
br=x;
K=A.size();
for(int i=0;i<K;i++)
kol[i]=A[i];
ll br=0,maks=0;
del=1;
for(int i=0;i<2*K;i++){
if(br<1){
res*=(maks+1);
// cout<<i<<" "<<maks+1<<endl;
br=0;
maks=0;
del=stepen[i];
}
br+=kol[i];
maks+=kol[i]*stepen[i]/del;
br/=2;
}
return res;
}
# | 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... |