Submission #44981

#TimeUsernameProblemLanguageResultExecution timeMemory
44981junodeveloperLanguages (IOI10_languages)C++14
Compilation error
0 ms0 KiB
#include "lang.h" #include "grader.h" #include <map> #include <algorithm> using namespace std; typedef unsigned long long ll; map<ll, int> mp[56]; ll cnt[56] = {0}; void excerpt(int* a) { for(int i=0; i<56; i++) cnt[i] = 0; for(int i=0; i<97; i++) { ll val = 0; for(int j=0; j<4; j++) val = val * 65535 + a[i] - 1; if(mp.count(val)) cnt[mp[val]]++; } int ret = max_element(cnt, cnt+56) - cnt; int ans = language(ret); for(int i=0; i<97; i++) { ll val = 0; for(int j=0; j<4; j++) val = val * 65535 + a[i] - 1; mp[val] = ans; } }

Compilation message (stderr)

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:15:9: error: request for member 'count' in 'mp', which is of non-class type 'std::map<long long unsigned int, int> [56]'
   if(mp.count(val)) cnt[mp[val]]++;
         ^~~~~
lang.cpp:15:24: error: no match for 'operator[]' (operand types are 'll [56] {aka long long unsigned int [56]}' and 'std::map<long long unsigned int, int>')
   if(mp.count(val)) cnt[mp[val]]++;
                        ^
lang.cpp:23:13: error: no match for 'operator=' (operand types are 'std::map<long long unsigned int, int>' and 'int')
   mp[val] = ans;
             ^~~
In file included from /usr/include/c++/7/map:61:0,
                 from lang.cpp:3:
/usr/include/c++/7/bits/stl_map.h:311:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>& std::map<_Key, _Tp, _Compare, _Alloc>::operator=(const std::map<_Key, _Tp, _Compare, _Alloc>&) [with _Key = long long unsigned int; _Tp = int; _Compare = std::less<long long unsigned int>; _Alloc = std::allocator<std::pair<const long long unsigned int, int> >]
       operator=(const map&) = default;
       ^~~~~~~~
/usr/include/c++/7/bits/stl_map.h:311:7: note:   no known conversion for argument 1 from 'int' to 'const std::map<long long unsigned int, int>&'
/usr/include/c++/7/bits/stl_map.h:315:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>& std::map<_Key, _Tp, _Compare, _Alloc>::operator=(std::map<_Key, _Tp, _Compare, _Alloc>&&) [with _Key = long long unsigned int; _Tp = int; _Compare = std::less<long long unsigned int>; _Alloc = std::allocator<std::pair<const long long unsigned int, int> >]
       operator=(map&&) = default;
       ^~~~~~~~
/usr/include/c++/7/bits/stl_map.h:315:7: note:   no known conversion for argument 1 from 'int' to 'std::map<long long unsigned int, int>&&'
/usr/include/c++/7/bits/stl_map.h:329:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>& std::map<_Key, _Tp, _Compare, _Alloc>::operator=(std::initializer_list<std::pair<const _Key, _Tp> >) [with _Key = long long unsigned int; _Tp = int; _Compare = std::less<long long unsigned int>; _Alloc = std::allocator<std::pair<const long long unsigned int, int> >]
       operator=(initializer_list<value_type> __l)
       ^~~~~~~~
/usr/include/c++/7/bits/stl_map.h:329:7: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<std::pair<const long long unsigned int, int> >'