/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:15:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |         for(int i = 1;i<s.size();i++)
      |                       ~^~~~~~~~~
/in/foo.cc:22:18: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and 'char')
   22 |         cout<<ans<'\n';
      |         ~~~~~~~~~^~~~~
      |             |     |
      |             |     char
      |             std::basic_ostream<char>
/in/foo.cc:22:18: note: candidate: 'operator<(int, int)' (built-in)
   22 |         cout<<ans<'\n';
      |         ~~~~~~~~~^~~~~
/in/foo.cc:22:18: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int'
In file included from /usr/include/c++/12/regex:66,
                 from /usr/include/x86_64-linux-gnu/c++/12/bits/stdc++.h:110,
                 from /in/foo.cc:1:
/usr/include/c++/12/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
 1103 |     operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/12/bits/regex.h:1103:5: note:   template argument deduction/substitution failed:
/in/foo.cc:22:19: note:   'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   22 |         cout<<ans<'\n';
      |                   ^~~~
/usr/include/c++/12/bits/regex.h:1184:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
 1184 |     operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/regex.h:1184:5: note:   template argument deduction/substitution failed:
/in/foo.cc:22:19: note:   'std::basic_ostream<char>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
   22 |         cout<<ans<'\n';
      |                   ^~~~
/usr/include/c++/12/bits/regex.h:1277:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
 1277 |     operator<(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/regex.h:1277:5: note:   template argument deduction/substitution failed:
/in/foo.cc:22:19: note:   'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   22 |         cout<<ans<'\n';
      |                   ^~~~
/usr/include/c++/12/bits/regex.h:1351:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
 1351 |     operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/regex.h:1351:5: note:   template argument deduction/substitution failed:
/in/foo.cc:22:19: note:   mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
   22 |         cout<<ans<'\n';
      |                   ^~~~
/usr/include/c++/12/bits/regex.h:1445:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
 1445 |     operator<(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/regex.h:1445:5: note:   template argument deduction/substitution failed:
/in/foo.cc:22:19: note:   'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   22 |         cout<<ans<'\n';
      |                   ^~~~
/usr/include/c++/12/bits/regex.h:1520:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
 1520 |     operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/regex.h:1520:5: note:   template argument deduction/substitution failed:
/in/foo.cc:22:19: note:   mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
   22 |         cout<<ans<'\n';
      |                   ^~~~
/usr/include/c++/12/bits/regex.h:1620:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
 1620 |     operator<(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/12/bits/regex.h:1620:5: note:   template argument deduction/substitution failed:
/in/foo.cc:22:19: note:   'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   22 |         cout<<ans<'\n';
      |                   ^~~~
In file included from /usr/include/c++/12/string:47,
                 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,
                 from /usr/include/c++/12/istream:38,
                 from /usr/include/c++/12/sstream:38,
                 from /usr/include/c++/12/complex:45,
                 from /usr/include/c++/12/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/12/bits/stdc++.h:54:
/usr/include/c++/12/bits/stl_iterator.h:451:5: note: candidate: 'template<class _Iterator> bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  451 |     operator<(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:451:5: note:   template argument deduction/substitution failed:
/in/foo.cc:22:19: note:   'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
   22 |         cout<<ans<'\n';
      |                   ^~~~
/usr/include/c++/12/bits/stl_iterator.h:496:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  496 |     operator<(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:496:5: note:   template argument deduction/substitution failed:
/in/foo.cc:22:19: note:   'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
   22 |         cout<<ans<'\n';
      |                   ^~~~
/usr/include/c++/12/bits/stl_iterator.h:1683:5: note: candidate: 'template<class _IteratorL, class _IteratorR> bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1683 |     operator<(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:1683:5: note:   template argument deduction/substitution failed:
/in/foo.cc:22:19: note:   'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
   22 |         cout<<ans<'\n';
      |                   ^~~~
/usr/include/c++/12/bits/stl_iterator.h:1748:5: note: candidate: 'template<class _Iterator> bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
 1748 |     operator<(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:1748:5: note:   template argument deduction/substitution failed:
/in/foo.cc:22:19: note:   'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
   22 |         cout<<ans<'\n';
      |                   ^~~~
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:663:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
  663 |     operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_pair.h:663:5: note:   template argument deduction/substitu

信息

递交者
类型
递交
题目
P1848 记数问题
语言
C++
递交时间
2025-10-24 22:22:14
评测时间
2025-10-24 22:22:14
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes