/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:6:9: error: no match for 'operator^' (operand types are 'std::basic_ostream<char>' and 'int')
  cout<<2^n-1;
  ~~~~~~~^~~~
/in/foo.cc:6:9: note: candidate: operator^(int, int) <built-in>
/in/foo.cc:6:9: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int'
In file included from /usr/include/c++/6/ios:42:0,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/ios_base.h:91:3: note: candidate: constexpr std::_Ios_Fmtflags std::operator^(std::_Ios_Fmtflags, std::_Ios_Fmtflags)
   operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b)
   ^~~~~~~~
/usr/include/c++/6/bits/ios_base.h:91:3: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Fmtflags'
/usr/include/c++/6/bits/ios_base.h:133:3: note: candidate: constexpr std::_Ios_Openmode std::operator^(std::_Ios_Openmode, std::_Ios_Openmode)
   operator^(_Ios_Openmode __a, _Ios_Openmode __b)
   ^~~~~~~~
/usr/include/c++/6/bits/ios_base.h:133:3: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Openmode'
/usr/include/c++/6/bits/ios_base.h:173:3: note: candidate: constexpr std::_Ios_Iostate std::operator^(std::_Ios_Iostate, std::_Ios_Iostate)
   operator^(_Ios_Iostate __a, _Ios_Iostate __b)
   ^~~~~~~~
/usr/include/c++/6/bits/ios_base.h:173:3: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Iostate'
In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:66:0,
                 from /in/foo.cc:1:
/usr/include/c++/6/bitset:1443:5: note: candidate: template<long unsigned int _Nb> std::bitset<_Nb> std::operator^(const std::bitset<_Nb>&, const std::bitset<_Nb>&)
     operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT
     ^~~~~~~~
/usr/include/c++/6/bitset:1443:5: note:   template argument deduction/substitution failed:
/in/foo.cc:6:12: note:   'std::basic_ostream<char>' is not derived from 'const std::bitset<_Nb>'
  cout<<2^n-1;
            ^
In file included from /usr/include/c++/6/valarray:587:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:95,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/valarray_after.h:407:5: note: candidate: template<class _Dom1, class _Dom2> std::_Expr<std::_BinClos<std::__bitwise_xor, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&)
     _DEFINE_EXPR_BINARY_OPERATOR(^, __bitwise_xor)
     ^
/usr/include/c++/6/bits/valarray_after.h:407:5: note:   template argument deduction/substitution failed:
/in/foo.cc:6:12: note:   'std::basic_ostream<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
  cout<<2^n-1;
            ^
In file included from /usr/include/c++/6/valarray:587:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:95,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/valarray_after.h:407:5: note: candidate: template<class _Dom> std::_Expr<std::_BinClos<std::__bitwise_xor, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)
     _DEFINE_EXPR_BINARY_OPERATOR(^, __bitwise_xor)
     ^
/usr/include/c++/6/bits/valarray_after.h:407:5: note:   template argument deduction/substitution failed:
/in/foo.cc:6:12: note:   'std::basic_ostream<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
  cout<<2^n-1;
            ^
In file included from /usr/include/c++/6/valarray:587:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:95,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/valarray_after.h:407:5: note: candidate: template<class _Dom> std::_Expr<std::_BinClos<std::__bitwise_xor, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&)
     _DEFINE_EXPR_BINARY_OPERATOR(^, __bitwise_xor)
     ^
/usr/include/c++/6/bits/valarray_after.h:407:5: note:   template argument deduction/substitution failed:
/in/foo.cc:6:12: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
  cout<<2^n-1;
            ^
In file included from /usr/include/c++/6/valarray:587:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:95,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/valarray_after.h:407:5: note: candidate: template<class _Dom> std::_Expr<std::_BinClos<std::__bitwise_xor, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _Dom::value_type>&)
     _DEFINE_EXPR_BINARY_OPERATOR(^, __bitwise_xor)
     ^
/usr/include/c++/6/bits/valarray_after.h:407:5: note:   template argument deduction/substitution failed:
/in/foo.cc:6:12: note:   'std::basic_ostream<char>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
  cout<<2^n-1;
            ^
In file included from /usr/include/c++/6/valarray:587:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:95,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/valarray_after.h:407:5: note: candidate: template<class _Dom> std::_Expr<std::_BinClos<std::__bitwise_xor, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__bitwise_xor, typename _Dom1::value_type>::result_type> std::operator^(const std::valarray<typename _Dom::value_type>&, const std::_Expr<_Dom1, typename _Dom1::value_type>&)
     _DEFINE_EXPR_BINARY_OPERATOR(^, __bitwise_xor)
     ^
/usr/include/c++/6/bits/valarray_after.h:407:5: note:   template argument deduction/substitution failed:
/in/foo.cc:6:12: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
  cout<<2^n-1;
            ^
In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:95:0,
                 from /in/foo.cc:1:
/usr/include/c++/6/valarray:1172:1: note: candidate: template<class _Tp> std::_Expr<std::_BinClos<std::__bitwise_xor, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__bitwise_xor, _Tp>::result_type> std::operator^(const std::valarray<_Tp>&, const std::valarray<_Tp>&)
 _DEFINE_BINARY_OPERATOR(^, __bitwise_xor)
 ^
/usr/include/c++/6/valarray:1172:1: note:   template argument deduction/substitution failed:
/in/foo.cc:6:12: note:   'std::basic_ostream<char>' is not derived from 'const std::valarray<_Tp>'
  cout<<2^n-1;
            ^
In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:95:0,
                 from /in/foo.cc:1:
/usr/include/c++/6/valarray:1172:1: note: candidate: template<class _Tp> std::_Expr<std::_BinClos<std::__bitwise_xor, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__bitwise_xor, _Tp>::result_type> std::operator^(const std::valarray<_Tp>&, const _Tp&)
 _DEFINE_BINARY_OPERATOR(^, __bitwise_xor)
 ^
/usr/include/c++/6/valarray:1172:1: note:   template argument deduction/substitution failed:
/in/foo.cc:6:12: note:   'std::basic_ostream<char>' is not derived from 'const std::valarray<_Tp>'
  cout<<2^n-1;
            ^
In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:95:0,
                 from /in/foo.cc:1:
/usr/include/c++/6/valarray:1172:1: note: candidate: template<class _Tp> std:

信息

递交者
类型
递交
题目
P1354 Hanoi双塔问题
语言
C++
递交时间
2018-10-02 19:49:56
评测时间
2018-10-02 19:49:56
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes