/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'void add(char)':
foo.cpp:21:10: error: reference to 'hash' is ambiguous
     if (!hash[ch-64])
          ^
foo.cpp:7:6: note: candidates are: bool hash [27]
 bool hash[27],used[27];
      ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\basic_string.h:3033:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\string:52,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\locale_classes.h:40,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\ios_base.h:41,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:42,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
                 from foo.cpp:4:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^
foo.cpp:23:9: error: reference to 'hash' is ambiguous
         hash[ch-64]=true;
         ^
foo.cpp:7:6: note: candidates are: bool hash [27]
 bool hash[27],used[27];
      ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\basic_string.h:3033:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\string:52,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\locale_classes.h:40,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\ios_base.h:41,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:42,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
                 from foo.cpp:4:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^
foo.cpp: In function 'void pre_do()':
foo.cpp:29:12: error: reference to 'hash' is ambiguous
     memset(hash,false,sizeof(hash));
            ^
foo.cpp:7:6: note: candidates are: bool hash [27]
 bool hash[27],used[27];
      ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\basic_string.h:3033:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\string:52,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\locale_classes.h:40,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\ios_base.h:41,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:42,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
                 from foo.cpp:4:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^
foo.cpp:29:30: error: reference to 'hash' is ambiguous
     memset(hash,false,sizeof(hash));
                              ^
foo.cpp:7:6: note: candidates are: bool hash [27]
 bool hash[27],used[27];
      ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\basic_string.h:3033:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\string:52,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\locale_classes.h:40,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\ios_base.h:41,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:42,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
                 from foo.cpp:4:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^

信息

递交者
类型
递交
题目
P1099 虫食算
语言
C++
递交时间
2016-09-08 15:08:24
评测时间
2016-09-08 15:08:39
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes