Submission #1065752

#TimeUsernameProblemLanguageResultExecution timeMemory
1065752vjudge1Packing Biscuits (IOI20_biscuits)C++17
Compilation error
0 ms0 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector<ll>; using i128 = __int128; ll count_tastiness(ll x, vll a) { int n = int(a.size()); vector<i128> S(n, 0); for(int i = 0; i < n; ++i) { S[i] = i128(1ll << i) * a[i]; if(i) S[i] += S[i - 1]; } vll C(n, 0); for(int i = 0; i < n; ++i) { S[i] /= x; if(S[i] >= i128(1ll << (i + 1)) - 1) C[i] = (1ll << (i + 1)) - 1; else C[i] = ll(S[i]); } int re = 0; const int MV = 100003; for(int i = 0; i < min(MV, 1ll << n); ++i) { ll v = 0; int ok = 1; for(int j = 0; j < n; ++j) { if(i & (1ll << j)) v |= (1ll << j); if(v > S[j]) { ok = 0; break; } } re += ok; } return re; }

Compilation message (stderr)

biscuits.cpp: In function 'll count_tastiness(ll, vll)':
biscuits.cpp:25:40: error: no matching function for call to 'min(const int&, long long int)'
   25 |     for(int i = 0; i < min(MV, 1ll << n); ++i) {
      |                                        ^
In file included from /usr/include/c++/10/vector:60,
                 from biscuits.h:1,
                 from biscuits.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:230:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  230 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:230:5: note:   template argument deduction/substitution failed:
biscuits.cpp:25:40: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   25 |     for(int i = 0; i < min(MV, 1ll << n); ++i) {
      |                                        ^
In file included from /usr/include/c++/10/vector:60,
                 from biscuits.h:1,
                 from biscuits.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:278:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  278 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:278:5: note:   template argument deduction/substitution failed:
biscuits.cpp:25:40: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   25 |     for(int i = 0; i < min(MV, 1ll << n); ++i) {
      |                                        ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from biscuits.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3468:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(std::initializer_list<_Tp>)'
 3468 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3468:5: note:   template argument deduction/substitution failed:
biscuits.cpp:25:40: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   25 |     for(int i = 0; i < min(MV, 1ll << n); ++i) {
      |                                        ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from biscuits.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(std::initializer_list<_Tp>, _Compare)'
 3474 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3474:5: note:   template argument deduction/substitution failed:
biscuits.cpp:25:40: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   25 |     for(int i = 0; i < min(MV, 1ll << n); ++i) {
      |                                        ^