Submission #00009
ソースコード
ステータス
コンパイルメッセージ
./Main.cpp: In function ‘int main()’:
./Main.cpp:33:80: error: no matching function for call to ‘max(char&, int)’
dp[bit&~(1 << j)&~(1 << k)] = max(dp[bit&~(1 << j)&~(1 << k)], dp[bit] + 2);
^
In file included from /usr/local/gcc-5.1.0/include/c++/5.1.0/bits/char_traits.h:39:0,
from /usr/local/gcc-5.1.0/include/c++/5.1.0/ios:40,
from /usr/local/gcc-5.1.0/include/c++/5.1.0/istream:38,
from /usr/local/gcc-5.1.0/include/c++/5.1.0/sstream:38,
from /usr/local/gcc-5.1.0/include/c++/5.1.0/complex:45,
from /usr/local/gcc-5.1.0/include/c++/5.1.0/ccomplex:38,
from /usr/local/gcc-5.1.0/include/c++/5.1.0/x86_64-unknown-linux-gnu/bits/stdc++.h:52,
from ./Main.cpp:1:
/usr/local/gcc-5.1.0/include/c++/5.1.0/bits/stl_algobase.h:219:5: note: candidate: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
max(const _Tp& __a, const _Tp& __b)
^
/usr/local/gcc-5.1.0/include/c++/5.1.0/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed:
./Main.cpp:33:80: note: deduced conflicting types for parameter ‘const _Tp’ (‘char’ and ‘int’)
dp[bit&~(1 << j)&~(1 << k)] = max(dp[bit&~(1 << j)&~(1 << k)], dp[bit] + 2);
^
In file included from /usr/local/gcc-5.1.0/include/c++/5.1.0/bits/char_traits.h:39:0,
from /usr/local/gcc-5.1.0/include/c++/5.1.0/ios:40,
from /usr/local/gcc-5.1.0/include/c++/5.1.0/istream:38,
from /usr/local/gcc-5.1.0/include/c++/5.1.0/sstream:38,
from /usr/local/gcc-5.1.0/include/c++/5.1.0/complex:45,
from /usr/local/gcc-5.1.0/include/c++/5.1.0/ccomplex:38,
from /usr/local/gcc-5.1.0/include/c++/5.1.0/x86_64-unknown-linux-gnu/bits/stdc++.h:52,
from ./Main.cpp:1:
/usr/local/gcc-5.1.0/include/c++/5.1.0/bits/stl_algobase.h:265:5: note: candidate: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
/usr/local/gcc-5.1.0/include/c++/5.1.0/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed:
./Main.cpp:33:80: note: deduced conflicting types for parameter ‘const _Tp’ (‘char’ and ‘int’)
dp[bit&~(1 << j)&~(1 << k)] = max(dp[bit&~(1 << j)&~(1 << k)], dp[bit] + 2);
^
In file included from /usr/local/gcc-5.1.0/include/c++/5.1.0/algorithm:62:0,
from /usr/local/gcc-5.1.0/include/c++/5.1.0/x86_64-unknown-linux-gnu/bits/stdc++.h:64,
from ./Main.cpp:1:
/usr/local/gcc-5.1.0/include/c++/5.1.0/bits/stl_algo.h:3457:5: note: candidate: template<class _Tp> _Tp std::max(std::initializer_list<_Tp>)
max(initializer_list<_Tp> __l)
^
/usr/local/gcc-5.1.0/include/c++/5.1.0/bits/stl_algo.h:3457:5: note: template argument deduction/substitution failed:
./Main.cpp:33:80: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘char’
dp[bit&~(1 << j)&~(1 << k)] = max(dp[bit&~(1 << j)&~(1 << k)], dp[bit] + 2);
^
In file included from /usr/local/gcc-5.1.0/include/c++/5.1.0/algorithm:62:0,
from /usr/local/gcc-5.1.0/include/c++/5.1.0/x86_64-unknown-linux-gnu/bits/stdc++.h:64,
from ./Main.cpp:1:
/usr/local/gcc-5.1.0/include/c++/5.1.0/bits/stl_algo.h:3463:5: note: candidate: template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare)
max(initializer_list<_Tp> __l, _Compare __comp)
^
/usr/local/gcc-5.1.0/include/c++/5.1.0/bits/stl_algo.h:3463:5: note: template argument deduction/substitution failed:
./Main.cpp:33:80: note: mismatched types ‘std::initializer_list<_Tp>’ and ‘char’
dp[bit&~(1 << j)&~(1 << k)] = max(dp[bit&~(1 << j)&~(1 << k)], dp[bit] + 2);
^
セット
テストケース