제출 #784886

#제출 시각아이디문제언어결과실행 시간메모리
784886aZvezda저울 (IOI15_scales)C++14
컴파일 에러
0 ms0 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; #ifndef LOCAL #define cerr if(false)cerr #endif const ll MAX_N = 20; vector<ll> all; int dp[1 << MAX_N]; pair<ll, pair<pair<ll, ll>, pair<ll, ll> > > hist[1 << MAX_N]; bool valid(ll curr, ll a, ll b) { while(curr % 8 != b) { if(curr % 8 == a) { return false; } curr /= 8; } return true; } vector<ll> eliminate(const vector<ll> &curr, ll a, ll b) { vector<ll> ret = {}; for(const auto it : curr) { if(valid(it, a, b)) { ret.push_back(it); } } return ret; } ll eliminate_mask(ll mask, ll a, ll b) { ll ret = 0; for(ll i = 0; i < MAX_N; i ++) { if(((1 << i) & mask) && valid(all[i], a, b)) { ret += (1 << i); } } return ret; } ll encode(const vector<ll> &arr) { ll ret = 0; for(ll i = 0; i < arr.size(); i ++) { ret = ret * 8 + arr[i]; } return ret; } ll calc_lightest(ll mask, ll a, ll b, ll c) { ll mx = 0; ll new_mask = mask; { new_mask = mask; new_mask = eliminate_mask(new_mask, a, b); new_mask = eliminate_mask(new_mask, a, c); mx = max(mx, dp[new_mask]); } { new_mask = mask; new_mask = eliminate_mask(new_mask, b, a); new_mask = eliminate_mask(new_mask, b, c); mx = max(mx, dp[new_mask]); } { new_mask = mask; new_mask = eliminate_mask(new_mask, c, a); new_mask = eliminate_mask(new_mask, c, b); mx = max(mx, dp[new_mask]); } if(mx < dp[mask]) { dp[mask] = mx; hist[mask] = {0, {{a, b}, {c, -1}}}; } return mx; } ll calc_heaviest(ll mask, ll a, ll b, ll c) { ll mx = 0; ll new_mask = mask; { new_mask = mask; new_mask = eliminate_mask(new_mask, b, a); new_mask = eliminate_mask(new_mask, c, a); mx = max(mx, dp[new_mask]); } { new_mask = mask; new_mask = eliminate_mask(new_mask, a, b); new_mask = eliminate_mask(new_mask, c, b); mx = max(mx, dp[new_mask]); } { new_mask = mask; new_mask = eliminate_mask(new_mask, a, c); new_mask = eliminate_mask(new_mask, b, c); mx = max(mx, dp[new_mask]); } if(mx < dp[mask]) { dp[mask] = mx; hist[mask] = {1, {{a, b}, {c, -1}}}; } return mx; } ll calc_median(ll mask, ll a, ll b, ll c) { ll mx = 0; ll new_mask1, new_mask2; { new_mask1 = eliminate_mask(mask, b, a); new_mask1 = eliminate_mask(mask, b, a); new_mask2 = eliminate_mask(mask, b, a); new_mask2 = eliminate_mask(mask, b, a); mx = max(mx, dp[new_mask1 | new_mask2]); } { new_mask1 = eliminate_mask(mask, a, b); new_mask1 = eliminate_mask(mask, b, c); new_mask2 = eliminate_mask(mask, c, b); new_mask2 = eliminate_mask(mask, b, a); mx = max(mx, dp[new_mask1 | new_mask2]); } { new_mask1 = eliminate_mask(mask, a, c); new_mask1 = eliminate_mask(mask, c, b); new_mask2 = eliminate_mask(mask, b, c); new_mask2 = eliminate_mask(mask, c, a); mx = max(mx, dp[new_mask1 | new_mask2]); } if(mx < dp[mask]) { dp[mask] = mx; hist[mask] = {2, {{a, b}, {c, -1}}}; } return mx; } void init(int T) { vector<ll> perm = {1, 2, 3, 4, 5, 6}; do { all.push_back(encode(perm)); } while(next_permutation(perm.begin(), perm.end())); all = eliminate(all, 1, 2); all = eliminate(all, 2, 3); all = eliminate(all, 4, 5); all = eliminate(all, 5, 6); ll total = (1ll << all.size()); for(ll i = 0; i < total; i ++) { dp[i] = 1e9; if((i & (i - 1)) == 0) { dp[i] = 0; continue; } while(dp[i] > 100) { const auto rnd = []() { return rand() % 6 + 1; }; ll a = rnd(); ll b = rnd(); ll c = rnd(); while(a == b || a == c) { a = rnd(); b = rnd(); c = rnd(); } calc_lightest(i, a, b, c); } dp[i] ++; } } int W[10], trans[10], old[10]; void orderCoins() { { ll small = getLightest(1, 2, 3); ll median = getMedian(1, 2, 3); ll big = (1 + 2 + 3) - (small + median); W[1] = small; W[2] = median; W[3] = big; } { ll small = getLightest(4, 5, 6); ll median = getMedian(4, 5, 6); ll big = (4 + 5 + 6) - (small + median); W[4] = small; W[5] = median; W[6] = big; } for(ll i = 1; i <= 8; i ++) { trans[W[i]] = i; } ll now_active = (1ll << all.size()) - 1; while((now_active & (now_active - 1)) > 0) { auto curr = hist[now_active]; if(curr.first == 0) { ll small = getLightest( W[curr.second.first.first], W[curr.second.first.second], W[curr.second.second.first] ); now_active = eliminate_mask( now_active, trans[small], curr.second.first.first ); now_active = eliminate_mask( now_active, trans[small], curr.second.first.second ); now_active = eliminate_mask( now_active, trans[small], curr.second.second.first ); } else if(curr.first == 1) { ll small = getHeaviest( W[curr.second.first.first], W[curr.second.first.second], W[curr.second.second.first] ); now_active = eliminate_mask( now_active, curr.second.first.first, trans[small] ); now_active = eliminate_mask( now_active, curr.second.first.second, trans[small] ); now_active = eliminate_mask( now_active, curr.second.second.first, trans[small] ); } } for(ll i = 0; i < MAX_N; i ++) { if(now_active & (1 << i)) { ll cpy = all[i]; for(ll j = 5; j >= 0; j --) { old[j] = W[cpy % 8]; cpy /= 8; } break; } } answer(old); }

컴파일 시 표준 에러 (stderr) 메시지

scales.cpp: In function 'll encode(const std::vector<long long int>&)':
scales.cpp:46:18: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   46 |  for(ll i = 0; i < arr.size(); i ++) {
      |                ~~^~~~~~~~~~~~
scales.cpp: In function 'll calc_lightest(ll, ll, ll, ll)':
scales.cpp:60:28: error: no matching function for call to 'max(ll&, int&)'
   60 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
scales.cpp:60:28: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   60 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
scales.cpp:60:28: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   60 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
 3480 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note:   template argument deduction/substitution failed:
scales.cpp:60:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   60 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note:   template argument deduction/substitution failed:
scales.cpp:60:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   60 |   mx = max(mx, dp[new_mask]);
      |                            ^
scales.cpp:67:28: error: no matching function for call to 'max(ll&, int&)'
   67 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
scales.cpp:67:28: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   67 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
scales.cpp:67:28: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   67 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
 3480 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note:   template argument deduction/substitution failed:
scales.cpp:67:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   67 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note:   template argument deduction/substitution failed:
scales.cpp:67:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   67 |   mx = max(mx, dp[new_mask]);
      |                            ^
scales.cpp:74:28: error: no matching function for call to 'max(ll&, int&)'
   74 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
scales.cpp:74:28: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   74 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
scales.cpp:74:28: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   74 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
 3480 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note:   template argument deduction/substitution failed:
scales.cpp:74:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   74 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note:   template argument deduction/substitution failed:
scales.cpp:74:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   74 |   mx = max(mx, dp[new_mask]);
      |                            ^
scales.cpp:78:14: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   78 |   dp[mask] = mx;
      |              ^~
scales.cpp: In function 'll calc_heaviest(ll, ll, ll, ll)':
scales.cpp:93:28: error: no matching function for call to 'max(ll&, int&)'
   93 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
scales.cpp:93:28: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   93 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
scales.cpp:93:28: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   93 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
 3480 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note:   template argument deduction/substitution failed:
scales.cpp:93:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   93 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note:   template argument deduction/substitution failed:
scales.cpp:93:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   93 |   mx = max(mx, dp[new_mask]);
      |                            ^
scales.cpp:100:28: error: no matching function for call to 'max(ll&, int&)'
  100 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
scales.cpp:100:28: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
  100 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
scales.cpp:100:28: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
  100 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
 3480 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note:   template argument deduction/substitution failed:
scales.cpp:100:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
  100 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note:   template argument deduction/substitution failed:
scales.cpp:100:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
  100 |   mx = max(mx, dp[new_mask]);
      |                            ^
scales.cpp:107:28: error: no matching function for call to 'max(ll&, int&)'
  107 |   mx = max(mx, dp[new_mask]);
      |                            ^
In file included from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from scales.cpp:2:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
scales.cpp:107:28: note:   deduced conflicti