(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #338357

#TimeUsernameProblemLanguageResultExecution timeMemory
338357mayflyyhPacking Biscuits (IOI20_biscuits)C++14
100 / 100
433 ms1004 KiB
#include<bits/stdc++.h> #define ll long long ll dp[70]; ll b[170]; ll count_tastiness(ll x, std::vector<ll> b){ int end=b.size(); for (int i = 0; i < 62 - end; i++) b.push_back(0); end = 62; for(int i=end;i+1;--i){ if(i==end){ dp[i]=1; } else{ dp[i]=0; for(int j=end;j>=i+1;--j){ ll min=0,max=(1ll<<(j-i))-1,ai=0; for(int k=j-1;k>=i;--k){ ai=ai*2+b[k]; ll y_=0; if(k>i){ y_=(ai/x+1)<<(k-i); if(y_>min) min=y_; } else{ y_=ai/x; if(y_<max) max=y_; } } if(min<=max) dp[i]+=dp[j]*(max-min+1); } } } return dp[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...