/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:19:12: error: reference to 'hash' is ambiguous
   int xx = hash.count(x) ? hash[x] : hash[x] = ++tot;
            ^~~~
/in/foo.cc:6:16: note: candidates are: std::map<std::pair<int, int>, int> hash
 map<type, int> hash;
                ^~~~
In file included from /usr/include/c++/7/bits/basic_string.h:6575:0,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/stl_map.h:63,
                 from /usr/include/c++/7/map:61,
                 from /in/foo.cc:2:
/usr/include/c++/7/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
/in/foo.cc:19:28: error: reference to 'hash' is ambiguous
   int xx = hash.count(x) ? hash[x] : hash[x] = ++tot;
                            ^~~~
/in/foo.cc:6:16: note: candidates are: std::map<std::pair<int, int>, int> hash
 map<type, int> hash;
                ^~~~
In file included from /usr/include/c++/7/bits/basic_string.h:6575:0,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/stl_map.h:63,
                 from /usr/include/c++/7/map:61,
                 from /in/foo.cc:2:
/usr/include/c++/7/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
/in/foo.cc:19:38: error: reference to 'hash' is ambiguous
   int xx = hash.count(x) ? hash[x] : hash[x] = ++tot;
                                      ^~~~
/in/foo.cc:6:16: note: candidates are: std::map<std::pair<int, int>, int> hash
 map<type, int> hash;
                ^~~~
In file included from /usr/include/c++/7/bits/basic_string.h:6575:0,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/stl_map.h:63,
                 from /usr/include/c++/7/map:61,
                 from /in/foo.cc:2:
/usr/include/c++/7/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
/in/foo.cc:20:12: error: reference to 'hash' is ambiguous
   int yy = hash.count(y) ? hash[y] : hash[y] = ++tot;
            ^~~~
/in/foo.cc:6:16: note: candidates are: std::map<std::pair<int, int>, int> hash
 map<type, int> hash;
                ^~~~
In file included from /usr/include/c++/7/bits/basic_string.h:6575:0,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/stl_map.h:63,
                 from /usr/include/c++/7/map:61,
                 from /in/foo.cc:2:
/usr/include/c++/7/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
/in/foo.cc:20:28: error: reference to 'hash' is ambiguous
   int yy = hash.count(y) ? hash[y] : hash[y] = ++tot;
                            ^~~~
/in/foo.cc:6:16: note: candidates are: std::map<std::pair<int, int>, int> hash
 map<type, int> hash;
                ^~~~
In file included from /usr/include/c++/7/bits/basic_string.h:6575:0,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/stl_map.h:63,
                 from /usr/include/c++/7/map:61,
                 from /in/foo.cc:2:
/usr/include/c++/7/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~
/in/foo.cc:20:38: error: reference to 'hash' is ambiguous
   int yy = hash.count(y) ? hash[y] : hash[y] = ++tot;
                                      ^~~~
/in/foo.cc:6:16: note: candidates are: std::map<std::pair<int, int>, int> hash
 map<type, int> hash;
                ^~~~
In file included from /usr/include/c++/7/bits/basic_string.h:6575:0,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/stl_map.h:63,
                 from /usr/include/c++/7/map:61,
                 from /in/foo.cc:2:
/usr/include/c++/7/bits/functional_hash.h:58:12: note:                 template<class _Tp> struct std::hash
     struct hash;
            ^~~~

信息

递交者
类型
递交
题目
P1112 小胖的奇偶
语言
C++
递交时间
2017-10-09 20:21:36
评测时间
2017-10-09 20:21:36
评测机
分数
0
总耗时
294ms
峰值内存
29.859 MiB