F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_36682676_30921.cpp: In function 'int main()':
0_0_36682676_30921.cpp:23:15: error: no match for 'operator[]' (operand types are 'std::map<std::basic_string<char>, int>' and 'std::pair<const std::basic_string<char>, int>')
    if(res < mp[t])
               ^
0_0_36682676_30921.cpp:23:15: note: candidates are:
In file included from GCC4.9.2/x86_64-w64-mingw32/include/c++/map:61:0,
                 from 0_0_36682676_30921.cpp:3:
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_map.h:491:7: note: std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::basic_string<char>; _Tp = int; _Compare = std::less<std::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::basic_string<char>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::basic_string<char>]
       operator[](const key_type& __k)
       ^
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_map.h:491:7: note:   no known conversion for argument 1 from 'std::pair<const std::basic_string<char>, int>' to 'const key_type& {aka const std::basic_string<char>&}'
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_map.h:511:7: note: std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&) [with _Key = std::basic_string<char>; _Tp = int; _Compare = std::less<std::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::basic_string<char>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::basic_string<char>]
       operator[](key_type&& __k)
       ^
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_map.h:511:7: note:   no known conversion for argument 1 from 'std::pair<const std::basic_string<char>, int>' to 'std::map<std::basic_string<char>, int>::key_type&& {aka std::basic_string<char>&&}'
0_0_36682676_30921.cpp:25:13: error: no match for 'operator[]' (operand types are 'std::map<std::basic_string<char>, int>' and 'std::pair<const std::basic_string<char>, int>')
     res = mp[t];
             ^
0_0_36682676_30921.cpp:25:13: note: candidates are:
In file included from GCC4.9.2/x86_64-w64-mingw32/include/c++/map:61:0,
                 from 0_0_36682676_30921.cpp:3:
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_map.h:491:7: note: std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::basic_string<char>; _Tp = int; _Compare = std::less<std::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::basic_string<char>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::basic_string<char>]
       operator[](const key_type& __k)
       ^
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_map.h:491:7: note:   no known conversion for argument 1 from 'std::pair<const std::basic_string<char>, int>' to 'const key_type& {aka const std::basic_string<char>&}'
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_map.h:511:7: note: std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&) [with _Key = std::basic_string<char>; _Tp = int; _Compare = std::less<std::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::basic_string<char>, int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::basic_string<char>]
       operator[](key_type&& __k)
       ^
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_map.h:511:7: note:   no known conversion for argument 1 from 'std::pair<const std::basic_string<char>, int>' to 'std::map<std::basic_string<char>, int>::key_type&& {aka std::basic_string<char>&&}'
0_0_36682676_30921.cpp:26:7: error: no match for 'operator=' (operand types are 'std::string {aka std::basic_string<char>}' and 'std::pair<const std::basic_string<char>, int>')
     s = t;
       ^
0_0_36682676_30921.cpp:26:7: note: candidates are:
In file included from GCC4.9.2/x86_64-w64-mingw32/include/c++/string:52:0,
                 from GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/locale_classes.h:40,
                 from GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/ios_base.h:41,
                 from GCC4.9.2/x86_64-w64-mingw32/include/c++/ios:42,
                 from GCC4.9.2/x86_64-w64-mingw32/include/c++/ostream:38,
                 from GCC4.9.2/x86_64-w64-mingw32/include/c++/iostream:39,
                 from 0_0_36682676_30921.cpp:1:
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/basic_string.h:554:7: note: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       operator=(const basic_string& __str) 
       ^
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/basic_string.h:554:7: note:   no known conversion for argument 1 from 'std::pair<const std::basic_string<char>, int>' to 'const std::basic_string<char>&'
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/basic_string.h:562:7: note: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       operator=(const _CharT* __s) 
       ^
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/basic_string.h:562:7: note:   no known conversion for argument 1 from 'std::pair<const std::basic_string<char>, int>' to 'const char*'
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/basic_string.h:573:7: note: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       operator=(_CharT __c) 
       ^
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/basic_string.h:573:7: note:   no known conversion for argument 1 from 'std::pair<const std::basic_string<char>, int>' to 'char'
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/basic_string.h:589:7: note: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(std::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       operator=(basic_string&& __str)
       ^
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/basic_string.h:589:7: note:   no known conversion for argument 1 from 'std::pair<const std::basic_string<char>, int>' to 'std::basic_string<char>&&'
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/basic_string.h:601:7: note: std::basic_string<_CharT, _Traits, _Alloc>& std::basic_string<_CharT, _Traits, _Alloc>::operator=(std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]
       operator=(initializer_list<_CharT> __l)
       ^
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/basic_string.h:601:7: note:   no known conversion for argument 1 from 'std::pair<const std::basic_string<char>, int>' to 'std::initializer_list<char>'
0_0_36682676_30921.cpp:28:20: error: cannot pass objects of non-trivially-copyable type 'std::string {aka class std::basic_string<char>}' through '...'
      printf("%s", s);
                    ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-25 17:59:59, Gzip enabled