QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#397437#4804. Regular Expressionucup-team2335#Compile Error//C++14866b2024-04-24 08:47:092024-04-24 08:47:09

詳細信息

answer.code:4:22: error: ‘ranges’ is not a namespace-name
    4 | using namespace std::ranges;
      |                      ^~~~~~
answer.code: In function ‘int main()’:
answer.code:27:20: error: ‘size’ was not declared in this scope
   27 |                 if(size(s) == 1) {
      |                    ^~~~
answer.code:31:20: error: ‘size’ was not declared in this scope
   31 |                 if(size(s) == 2) {
      |                    ^~~~
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)) {
      |                    ~~~~~^~~~~~~~~
answer.code:39:38: error: ‘size’ was not declared in this scope
   39 |                 if(count(s, s[0]) == size(s)) {
      |                                      ^~~~