/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'void bfs()':
/in/foo.cc:72:10: error: reference to 'hash' is ambiguous
     if (!hash[f.first]) {f.second=temp.second+1;q.push(f);hash[f.first]=true;}
          ^~~~
/in/foo.cc:14:20: note: candidates are: std::map<long long int, bool> hash
 map<long long,bool>hash;
                    ^~~~
In file included from /usr/include/c++/6/bits/basic_string.h:5643:0,
                 from /usr/include/c++/6/string:52,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:4:
/usr/include/c++/6/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
/in/foo.cc:72:59: error: reference to 'hash' is ambiguous
     if (!hash[f.first]) {f.second=temp.second+1;q.push(f);hash[f.first]=true;}
                                                           ^~~~
/in/foo.cc:14:20: note: candidates are: std::map<long long int, bool> hash
 map<long long,bool>hash;
                    ^~~~
In file included from /usr/include/c++/6/bits/basic_string.h:5643:0,
                 from /usr/include/c++/6/string:52,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:4:
/usr/include/c++/6/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:86:2: error: reference to 'hash' is ambiguous
  hash[s.first]=true;
  ^~~~
/in/foo.cc:14:20: note: candidates are: std::map<long long int, bool> hash
 map<long long,bool>hash;
                    ^~~~
In file included from /usr/include/c++/6/bits/basic_string.h:5643:0,
                 from /usr/include/c++/6/string:52,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:4:
/usr/include/c++/6/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~

信息

递交者
类型
递交
题目
P1360 八数码问题
语言
C++
递交时间
2019-08-01 11:15:11
评测时间
2019-08-01 11:15:11
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes