记录详情

Compile Error

/in/foo.cc: In function 'bool try_insert(int)':
/in/foo.cc:24:48: error: 'memcmp' was not declared in this scope
         if(!memcmp(st[u],st[rear],sizeof(st[0])))
                                                ^
/in/foo.cc:26:13: error: reference to 'next' is ambiguous
         u = next[u];
             ^~~~
/in/foo.cc:8:15: note: candidates are: int next [1000000]
 int head[HN], next[N];//链表(用于哈希)
               ^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
/in/foo.cc:28:5: error: reference to 'next' is ambiguous
     next[rear] = head[h];//rear指向旧的head[h]
     ^~~~
/in/foo.cc:8:15: note: candidates are: int next [1000000]
 int head[HN], next[N];//链表(用于哈希)
               ^~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:205:5: note:                 template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
     next(_ForwardIterator __x, typename
     ^~~~
/in/foo.cc: In function 'int bfs()':
/in/foo.cc:34:31: error: 'memset' was not declared in this scope
     memset(head,0,sizeof(head));
                               ^
/in/foo.cc:37:47: error: 'memcmp' was not declared in this scope
         if(!memcmp(goal,st[fron],sizeof(st[0])))
                                               ^
/in/foo.cc:47:57: error: 'memcpy' was not declared in this scope
                 memcpy(&st[rear],&st[fron],sizeof(st[0]));
                                                         ^

信息

递交者
类型
递交
题目
P1172 八数码问题
语言
C++
递交时间
2020-07-18 21:53:03
评测时间
2020-07-18 21:53:03
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes