QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#397438#4804. Regular Expressionucup-team2335#Compile Error//C++17866b2024-04-24 08:47:492024-04-24 08:47:50

Details

answer.code:4:22: error: ‘ranges’ is not a namespace-name
    4 | using namespace std::ranges;
      |                      ^~~~~~
answer.code: In function ‘int main()’:
answer.code:39:25: error: no matching function for call to ‘count(std::string&, __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)’
   39 |                 if(count(s, s[0]) == size(s)) {
      |                    ~~~~~^~~~~~~~~
In file included from /usr/include/c++/13/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
                 from answer.code:1:
/usr/include/c++/13/bits/stl_algo.h:4072:5: note: candidate: ‘template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)’
 4072 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
/usr/include/c++/13/bits/stl_algo.h:4072:5: note:   template argument deduction/substitution failed:
answer.code:39:25: note:   deduced conflicting types for parameter ‘_IIter’ (‘std::__cxx11::basic_string<char>’ and ‘char’)
   39 |                 if(count(s, s[0]) == size(s)) {
      |                    ~~~~~^~~~~~~~~
In file included from /usr/include/c++/13/algorithm:73:
/usr/include/c++/13/pstl/glue_algorithm_defs.h:101:1: note: candidate: ‘template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)’
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/13/pstl/glue_algorithm_defs.h:101:1: note:   template argument deduction/substitution failed:
answer.code:39:25: note:   candidate expects 4 arguments, 2 provided
   39 |                 if(count(s, s[0]) == size(s)) {
      |                    ~~~~~^~~~~~~~~