Submission #400005

#TimeUsernameProblemLanguageResultExecution timeMemory
400005faresbasbsPacking Biscuits (IOI20_biscuits)C++14
42 / 100
1088 ms15728 KiB
#include <bits/stdc++.h> #include "biscuits.h" using namespace std; map<long long,long long> dp,dp2; vector<long long> a; long long x; long long count_tastiness(long long X , vector<long long> A){ a = A , x = X; while(a.size() < 60){ a.push_back(0ll); } dp.clear(); dp[0ll] = 1; for(int i = 0 ; i < 60 ; i += 1){ dp2.clear(); for(auto j : dp){ long long p = j.first; p += a[i]; dp2[p/2] += j.second; if(p >= x){ dp2[(p-x)/2] += j.second; } } swap(dp,dp2); } long long ret = 0; for(auto i : dp){ ret += i.second; } return ret; }
#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...