Submission #834067

#TimeUsernameProblemLanguageResultExecution timeMemory
834067finn__Packing Biscuits (IOI20_biscuits)C++17
9 / 100
1043 ms340 KiB
#include <bits/stdc++.h> #include "biscuits.h" using namespace std; constexpr size_t N = 60; using L = long long; L count_tastiness(L x, std::vector<L> a) { a.resize(19); size_t ans = 0; for (size_t i = 0; i <= 100000; ++i) { size_t leftover = 0; bool possible = 1; for (size_t j = 0; j < 19; ++j) { leftover >>= 1; if (i & (1 << j)) { possible &= leftover + a[j] >= x; if (!possible) break; leftover = leftover + a[j] - x; } else { leftover += a[j]; } } ans += possible; } return ans; }

Compilation message (stderr)

biscuits.cpp: In function 'L count_tastiness(L, std::vector<long long int>)':
biscuits.cpp:24:45: warning: comparison of integer expressions of different signedness: 'long long unsigned int' and 'L' {aka 'long long int'} [-Wsign-compare]
   24 |                 possible &= leftover + a[j] >= x;
      |                             ~~~~~~~~~~~~~~~~^~~~
#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...