Submission #306797

#TimeUsernameProblemLanguageResultExecution timeMemory
306797VEGAnnPacking Biscuits (IOI20_biscuits)C++17
0 / 100
2 ms768 KiB
#include "biscuits.h" #include <bits/stdc++.h> #define sz(x) ((int)x.size()) using namespace std; typedef long long ll; vector<ll> b; unordered_set<ll> vls; void rec(int ps, ll vl){ if (ps == sz(b)){ vls.insert(vl); return; } rec(ps + 1, vl); if (b[ps] > 0) rec(ps + 1, vl + (1ll << ps)); if (b[ps] > 1) rec(ps + 1, vl + (1ll << (ps + 1))); } long long count_tastiness(long long x, std::vector<long long> a) { ll ans = 1; assert(x == 1); int k = sz(a); b = a; vls.clear(); for (int cur = 0; cur < k; cur++){ if (b[cur] == 0) continue; if (cur + 1 < k) b[cur + 1] += max(0ll, b[cur] - 2) / 2; } rec(0, 0); ans += sz(vls); 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...