Submission #725975

#TimeUsernameProblemLanguageResultExecution timeMemory
725975NemanjaSo2005Packing Biscuits (IOI20_biscuits)C++14
0 / 100
1 ms340 KiB
#include "biscuits.h" #include <bits/stdc++.h> #define ll long long using namespace std; const int MaxK=60; ll res,K,br,kol[MaxK*4],stepen[MaxK*4],del; ll count_tastiness(ll x,vector<ll> A){ stepen[0]=1; for(int i=1;i<=MaxK;i++) stepen[i]=stepen[i-1]*2; for(int i=MaxK+1;i<MaxK*4;i++) stepen[i]=1; br=x; K=A.size(); for(int i=0;i<K;i++) kol[i]=A[i]; res=1; ll br=0,maks=0; del=1; for(int i=0;i<4*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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...