Submission #413507

#TimeUsernameProblemLanguageResultExecution timeMemory
413507mosiashvililukaPacking Biscuits (IOI20_biscuits)C++17
0 / 100
1105 ms525804 KiB
#include "biscuits.h" #include<bits/stdc++.h> using namespace std; long long a,b,c,d,e,i,j,ii,jj,zx,xc,f[209],x,S[209],JM,xr[209],E,jm; long long tes,te; vector <long long> v; long long count_tastiness(long long Xx, std::vector<long long> A) { x=Xx; a=A.size();a--; for(i=0; i<=a; i++){ f[i]=A[i]; } xr[0]=1; for(i=1; i<=62; i++){ xr[i]=xr[i-1]*2; } for(i=0; i<=a; i++){ jm+=f[i]*xr[i]; } v.clear(); v.push_back(0); JM=0; for(i=0; i<=a+134; i++){ JM+=f[i]*xr[i]; if(xr[i]>jm) break; S[i]=JM; E=v.size(); for(j=0; j<E; j++){ //if(x*(xr[i]+v[j])>S[i]) continue; if((xr[i]+v[j])>S[i]/x) continue; v.push_back(xr[i]+v[j]); } } return v.size(); } /*int main(){ ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0); cin>>tes; for(te=1; te<=tes; te++){ cin>>a>>x; vector <long long> A; for(i=0; i<a; i++){ cin>>c; A.push_back(c); } cout<<count_tastiness(x,A)<<endl; } return 0; }*/
#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...