Submission #306853

#TimeUsernameProblemLanguageResultExecution timeMemory
306853baluteshihPacking Biscuits (IOI20_biscuits)C++14
0 / 100
2 ms416 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; #define X first #define Y second #define ALL(v) v.begin(),v.end() #define pb push_back #define SZ(a) ((int)a.size()) vector<ll> arr; ll ans,X; void dfs(int u,ll hv) { if(u==SZ(arr)) return ++ans,void(); hv+=arr[u],dfs(u+1,hv/2); if(hv>=X) dfs(u+1,(hv-X)/2); } ll count_tastiness(ll x, vector<ll> a) { if(x==1) { ans=1; for(int i=0;i+1<SZ(a);++i) a[i+1]+=a[i]/2,a[i]%=2; for(int i=0;i<SZ(a);++i) ans*=a[i]+1; return ans; } ans=0,X=x; arr.swap(a); dfs(0,0); return ans; }
#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...