Submission #836355

#TimeUsernameProblemLanguageResultExecution timeMemory
836355NeroZeinPacking Biscuits (IOI20_biscuits)C++17
0 / 100
1049 ms340 KiB
#include "biscuits.h" #include "bits/stdc++.h" using namespace std; long long count_tastiness(long long x, std::vector<long long> a) { long long ret = 1; int k = (int) a.size(); for (int i = 1; i <= 1e5; ++i) { vector<long long> b = a; bool ok = true; for (int rep = 0; rep < x; ++rep) { int rem = i; for (int j = k - 1; j >= 0; --j) { int take = rem / (1LL << j); int can_take = min((long long) take, b[j]); b[j] -= can_take; rem -= can_take * (1LL << j); } ok &= rem == 0; } ret += ok; } 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...