Submission #804927

#TimeUsernameProblemLanguageResultExecution timeMemory
804927alvingogoPacking Biscuits (IOI20_biscuits)C++14
42 / 100
1069 ms23944 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; for(int i=0;i<100;i++){ a.push_back(0); } dp[0]=1; for(int i=0;i<n+100;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...