记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:11:10: error: no match for 'operator==' (operand types are 'std::basic_ostream<char>' and 'int')
   11 | cout << j==i?1:0;
      | ~~~~~~~~~^~~
      |      |     |
      |      |     int
      |      std::basic_ostream<char>
/in/foo.cc:11:10: note: candidate: 'operator==(int, int)' (built-in)
   11 | cout << j==i?1:0;
      | ~~~~~~~~~^~~
/in/foo.cc:11:10: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int'
In file included from /usr/include/c++/12/iosfwd:40,
                 from /usr/include/c++/12/ios:38,
                 from /usr/include/c++/12/ostream:38,
                 from /usr/include/c++/12/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/12/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
  192 |     operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/12/bits/postypes.h:192:5: note:   template argument deduction/substitution failed:
/in/foo.cc:11:12: note:   'std::basic_ostream<char>' is not derived from 'const std::fpos<_StateT>'
   11 | cout << j==i?1:0;
      |            ^
In file included from /usr/include/c++/12/string:41,
                 from /usr/include/c++/12/bits/locale_classes.h:40,
                 from /usr/include/c++/12/bits/ios_base.h:41,
                 from /usr/include/c++/12/ios:42:
/usr/include/c++/12/bits/allocator.h:219:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
  219 |     operator==(const allocator<_T1>&, const allocator<_T2>&)
      |     ^~~~~~~~
/usr/include/c++/12/bits/allocator.h:219:5: note:   template argument deduction/substitution failed:
/in/foo.cc:11:12: note:   'std::basic_ostream<char>' is not derived from 'const std::allocator<_CharT>'
   11 | cout << j==i?1:0;
      |            ^
In file included from /usr/include/c++/12/string:47:
/usr/include/c++/12/bits/stl_iterator.h:444:5: note: candidate: 'template<class _Iterator> bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  444 |     operator==(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:444:5: note:   template argument deduction/substitution failed:
/in/foo.cc:11:12: note:   'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
   11 | cout << j==i?1:0;
      |            ^
/usr/include/c++/12/bits/stl_iterator.h:489:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  489 |     operator==(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:489:5: note:   template argument deduction/substitution failed:
/in/foo.cc:11:12: note:   'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
   11 | cout << j==i?1:0;
      |            ^
/usr/include/c++/12/bits/stl_iterator.h:1656:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1656 |     operator==(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:1656:5: note:   template argument deduction/substitution failed:
/in/foo.cc:11:12: note:   'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
   11 | cout << j==i?1:0;
      |            ^
/usr/include/c++/12/bits/stl_iterator.h:1726:5: note: candidate: 'template<class _Iterator> bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
 1726 |     operator==(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:1726:5: note:   template argument deduction/substitution failed:
/in/foo.cc:11:12: note:   'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
   11 | cout << j==i?1:0;
      |            ^
In file included from /usr/include/c++/12/bits/stl_algobase.h:64,
                 from /usr/include/c++/12/string:50:
/usr/include/c++/12/bits/stl_pair.h:640:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
  640 |     operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_pair.h:640:5: note:   template argument deduction/substitution failed:
/in/foo.cc:11:12: note:   'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
   11 | cout << j==i?1:0;
      |            ^
In file included from /usr/include/c++/12/string:53:
/usr/include/c++/12/bits/basic_string.h:3575:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
 3575 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/basic_string.h:3575:5: note:   template argument deduction/substitution failed:
/in/foo.cc:11:12: note:   'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
   11 | cout << j==i?1:0;
      |            ^
/usr/include/c++/12/bits/basic_string.h:3584:5: note: candidate: 'template<class _CharT> typename __gnu_cxx::__enable_if<std::__is_char<_Tp>::__value, bool>::__type std::operator==(const __cxx11::basic_string<_CharT>&, const __cxx11::basic_string<_CharT>&)'
 3584 |     operator==(const basic_string<_CharT>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/basic_string.h:3584:5: note:   template argument deduction/substitution failed:
/in/foo.cc:11:12: note:   'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT>'
   11 | cout << j==i?1:0;
      |            ^
/usr/include/c++/12/bits/basic_string.h:3599:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)'
 3599 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/basic_string.h:3599:5: note:   template argument deduction/substitution failed:
/in/foo.cc:11:12: note:   'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
   11 | cout << j==i?1:0;
      |            ^
/usr/include/c++/12/bits/basic_string.h:3640:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
 3640 |     operator==(const _CharT* __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/basic_string.h:3640:5: note:   template argument deduction/substitution failed:
/in/foo.cc:11:12: note:   mismatched types 'const _CharT*' and 'std::basic_ostream<char>'
   11 | cout << j==i?1:0;
      |            ^
In file included from /usr/include/c++/12/bits/locale_facets.h:48,
                 from /usr/include/c++/12/bits/basic_ios.h:37,
                 from /usr/include/c++/12/ios:44:
/usr/include/c++/12/bits/streambuf_iterator.h:233:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator==(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)'
  233 |     operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
      |     ^~~~~~~~
/usr/include/c++/12/bits/streambuf_iterator.h:233:5: note:   template argument deduction/substitution failed:
/in/foo.cc:11:12: note:   'std::basic_ostream<char>' is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>'
   11 | cout << j==i?1:0;
      |            ^
In file included from /usr/include/c++/12/bits/ios_base.h:46:
/usr/include/c++/12/system_error:362:3: note: candidate: 'bool std::operator==(const error_code&, const error_code&)'
  362 |   op

信息

递交者
类型
递交
题目
P1027 输出矩阵1
语言
C++
递交时间
2026-11-29 20:50:49
评测时间
2026-11-29 20:50:49
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes