/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int main()':
foo.cpp:38:2: error: reference to 'hash' is ambiguous
  hash[s]=1;
  ^
foo.cpp:10:6: note: candidates are: bool hash [10005]
 bool hash[10005];
      ^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/basic_string.h:3068:0,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/string:52,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/locale_classes.h:40,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/ios_base.h:41,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ios:42,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ostream:38,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/iostream:39,
                 from foo.cpp:1:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^
foo.cpp:46:7: error: reference to 'hash' is ambiguous
    if(hash[p->num]==0)
       ^
foo.cpp:10:6: note: candidates are: bool hash [10005]
 bool hash[10005];
      ^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/basic_string.h:3068:0,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/string:52,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/locale_classes.h:40,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/ios_base.h:41,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ios:42,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ostream:38,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/iostream:39,
                 from foo.cpp:1:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^
foo.cpp:50:5: error: reference to 'hash' is ambiguous
     hash[p->num]=nl[p->num]=1;
     ^
foo.cpp:10:6: note: candidates are: bool hash [10005]
 bool hash[10005];
      ^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/basic_string.h:3068:0,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/string:52,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/locale_classes.h:40,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/ios_base.h:41,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ios:42,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ostream:38,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/iostream:39,
                 from foo.cpp:1:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^
foo.cpp:79:9: error: reference to 'hash' is ambiguous
  memset(hash,0,sizeof(hash));
         ^
foo.cpp:10:6: note: candidates are: bool hash [10005]
 bool hash[10005];
      ^
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/basic_string.h:3068:0,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/string:52,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/locale_classes.h:40,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/ios_base.h:41,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ios:42,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/ostream:38,
                 from C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/iostream:39,
                 from foo.cpp:1:
C:/TDM-GCC-32/lib/gcc/mingw32/4.9.2/include/c++/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^
foo.cpp:79:23: error: reference to 'hash' is ambiguous
  memset(hash,0,sizeof(ha

信息

递交者
类型
递交
题目
P1909 寻找道路
语言
C++
递交时间
2015-10-03 14:20:58
评测时间
2015-10-03 14:20:59
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes