Submission #834124

#TimeUsernameProblemLanguageResultExecution timeMemory
834124finn__Packing Biscuits (IOI20_biscuits)C++17
0 / 100
1 ms340 KiB
#pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,sse4") #include "biscuits.h" using L = long long; constexpr int N = 128; size_t l; L b[N][2], x; int dfs(size_t i = 0, L z = 0) { if (i == l - 1) return 1 + (b[i][1] + z >= x); int ans = dfs(i + 1, (b[i][1] + z) >> (b[i + 1][0] - b[i][0])); if (b[i][1] + z >= x) ans += dfs(i + 1, (b[i][1] + z - x) >> (b[i + 1][0] - b[i][0])); return ans; } L count_tastiness(L x_, std::vector<L> a) { x = x_; l = 0; for (size_t i = 0; i < a.size(); ++i) if (a[i]) b[l][0] = i, b[l][1] = a[i], ++l; return l ? dfs() : 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...