Submission #804911

#TimeUsernameProblemLanguageResultExecution timeMemory
804911alvingogoPacking Biscuits (IOI20_biscuits)C++14
0 / 100
1 ms312 KiB
#include "biscuits.h" #include <bits/stdc++.h> #pragma GCC optimize("Ofast") #define fs first #define sc second #define p_q priority_queue using namespace std; typedef long long ll; ll count_tastiness(ll x, vector<ll> a) { int n=a.size(); map<ll,ll> dp; a.push_back(0); dp[0]=1; for(int i=0;i<n+1;i++){ map<ll,ll> dp2; for(auto h:dp){ dp2[h.fs/2+a[i]]+=h.sc; if(h.fs>=x){ dp2[(h.fs-x)/2+a[i]]+=h.sc; } } dp.swap(dp2); } ll ans=0; for(auto h:dp){ ans+=h.sc; } 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...