Borderou de evaluare (job #2771052)

Utilizator hhhhhhhAndrei Boaca hhhhhhh Data 25 august 2021 08:55:49
Problema Expozitie2 Status done
Runda Lot 2016 baraj 4 Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp: In function 'int main()': main.cpp:38:13: error: no match for 'operator[]' (operand types are 'std::map<std::vector<short int>, short int>' and 'std::vector<int>') if(f[a]==0) ^ In file included from /usr/include/c++/6/map:61:0, from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:81, from main.cpp:1: /usr/include/c++/6/bits/stl_map.h:474:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::vector<short int>; _Tp = short int; _Compare = std::less<std::vector<short int> >; _Alloc = std::allocator<std::pair<const std::vector<short int>, short int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = short int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::vector<short int>] operator[](const key_type& __k) ^~~~~~~~ /usr/include/c++/6/bits/stl_map.h:474:7: note: no known conversion for argument 1 from 'std::vector<int>' to 'const key_type& {aka const std::vector<short int>&}' /usr/include/c++/6/bits/stl_map.h:494:7: note: candidate: 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::vector<short int>; _Tp = short int; _Compare = std::less<std::vector<short int> >; _Alloc = std::allocator<std::pair<const std::vector<short int>, short int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = short int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::vector<short int>] operator[](key_type&& __k) ^~~~~~~~ /usr/include/c++/6/bits/stl_map.h:494:7: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::map<std::vector<short int>, short int>::key_type&& {aka std::vector<short int>&&}' main.cpp:40:14: error: no match for 'operator[]' (operand types are 'std::map<std::vector<short int>, short int>' and 'std::vector<int>') f[a]=it-1; ^ In file included from /usr/include/c++/6/map:61:0, from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:81, from main.cpp:1: /usr/include/c++/6/bits/stl_map.h:474:7: note: candidate: std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::vector<short int>; _Tp = short int; _Compare = std::less<std::vector<short int> >; _Alloc = std::allocator<std::pair<const std::vector<short int>, short int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = short int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::vector<short int>] operator[](const key_type& __k) ^~~~~~~~ /usr/include/c++/6/bits/stl_map.h:474:7: note: no known conversion for argument 1 from 'std::vector<int>' to 'const key_type& {aka const std::vector<short int>&}' /usr/include/c++/6/bits/stl_map.h:494:7: note: candidate: 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::vector<short int>; _Tp = short int; _Compare = std::less<std::vector<short int> >; _Alloc = std::allocator<std::pair<const std::vector<short int>, short int> >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = short int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::vector<short int>] operator[](key_type&& __k) ^~~~~~~~ /usr/include/c++/6/bits/stl_map.h:494:7: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::map<std::vector<short int>, short int>::key_type&& {aka std::vector<short int>&&}' main.cpp:41:26: error: no matching function for call to 'std::vector<std::vector<short int> >::push_back(std::vector<int>&)' v.push_back(a); ^ In file included from /usr/include/c++/6/vector:64:0, from /usr/include/c++/6/queue:61, from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:86, from main.cpp:1: /usr/include/c++/6/bits/stl_vector.h:914:7: note: candidate: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::vector<short int>; _Alloc = std::allocator<std::vector<short int> >; std::vector<_Tp, _Alloc>::value_type = std::vector<short int>] push_back(const value_type& __x) ^~~~~~~~~ /usr/include/c++/6/bits/stl_vector.h:914:7: note: no known conversion for argument 1 from 'std::vector<int>' to 'const value_type& {aka const std::vector<short int>&}' /usr/include/c++/6/bits/stl_vector.h:932:7: note: candidate: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::vector<short int>; _Alloc = std::allocator<std::vector<short int> >; std::vector<_Tp, _Alloc>::value_type = std::vector<short int>] push_back(value_type&& __x) ^~~~~~~~~ /usr/include/c++/6/bits/stl_vector.h:932:7: note: no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<std::vector<short int> >::value_type&& {aka std::vector<short int>&&}' main.cpp:45:18: error: no match for 'operator[]' (operand types are 'std::map<std::vector<short int>, short int>' and 'std::vector<int>') poz=f[a]; ^ In file included from /usr/include/c++/6/map:61:0, from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:81, from main.cpp:1: Non zero exit status: 1

Ceva nu functioneaza?