Submission #1051790

#TimeUsernameProblemLanguageResultExecution timeMemory
1051790aykhnPacking Biscuits (IOI20_biscuits)C++17
0 / 100
1096 ms63284 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; long long x, k; vector<long long> a; map<long long, long long> mp[60]; long long cnt(long long ind, long long s) { if (ind == 60) return 1; if (mp[ind].count(s)) return mp[ind][s]; if (ind < k) s += a[ind]; long long res = 0; if (x <= s) res += cnt(ind + 1, (s - x) >> 1); res += cnt(ind + 1, s >> 1); return mp[ind][s] = res; } long long count_tastiness(long long X, vector<long long> A) { for (int i = 0; i < 60; i++) mp[i].clear(); x = X, a = A, k = A.size(); return cnt(0, 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...