Submission #1052167

#TimeUsernameProblemLanguageResultExecution timeMemory
1052167aykhnPacking Biscuits (IOI20_biscuits)C++17
Compilation error
0 ms0 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; long long x, k; vector<long long> a; int mp[60][100001]; long long dp(long long ind, long long s) { if (ind == 60) return 1LL; s += a[ind]; s = min(s, 100000); if (mp[ind][s] != -1) return mp[ind][s]; long long A = dp(ind + 1, (s >> 1)); long long B = 0; if (x <= s) B = dp(ind + 1, (s - x) >> 1); return mp[ind][s] = A + B; } long long count_tastiness(long long X, vector<long long> A) { for (int i = 0; i < 60; i++) for (int j = 0; j < 100001; j++) mp[i][j] = -1; x = X, a = A, k = A.size(); while (a.size() < 60) a.push_back(0); return dp(0LL, 0LL); }

Compilation message (stderr)

biscuits.cpp: In function 'long long int dp(long long int, long long int)':
biscuits.cpp:14:19: error: no matching function for call to 'min(long long int&, int)'
   14 |  s = min(s, 100000);
      |                   ^
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:14:19: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   14 |  s = min(s, 100000);
      |                   ^
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:14:19: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   14 |  s = min(s, 100000);
      |                   ^
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:14:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   14 |  s = min(s, 100000);
      |                   ^
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:14:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   14 |  s = min(s, 100000);
      |                   ^