记录详情

Compile Error

foo.cc: In function 'void getNext(std::__cxx11::string)':
foo.cc:9:6: error: reference to 'next' is ambiguous
      next[0] = -1;
      ^~~~
foo.cc:5:6: note: candidates are: int next [100]
  int next[MAX] = {0};
      ^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
foo.cc:14:14: error: reference to 'next' is ambiguous
              next[j] = k;
              ^~~~
foo.cc:5:6: note: candidates are: int next [100]
  int next[MAX] = {0};
      ^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
foo.cc:16:18: error: reference to 'next' is ambiguous
              k = next[k];
                  ^~~~
foo.cc:5:6: note: candidates are: int next [100]
  int next[MAX] = {0};
      ^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
foo.cc: In function 'int kmpMatch(std::__cxx11::string, std::__cxx11::string, int)':
foo.cc:31:18: error: reference to 'next' is ambiguous
              j = next[j]; // 如果出现部分不匹配,获取跳过的位置
                  ^~~~
foo.cc:5:6: note: candidates are: int next [100]
  int next[MAX] = {0};
      ^~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from foo.cc:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:208:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~

自豪的采用 HydroJudge 进行评测(github.com/hydro-dev/HydroJudge)

信息

递交者
类型
自测
题目
DS3-1 字符串的模式匹配
语言
C++
递交时间
2020-07-29 22:31:40
评测时间
2020-07-29 22:31:40
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes