Borderou de evaluare (job #3121225)

Utilizator SorinBossuMarian Sorin SorinBossu Data 11 aprilie 2023 10:49:42
Problema Padure Status done
Runda Arhiva de probleme Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp: In function 'void transgraf()': main.cpp:75:82: error: no matching function for call to 'std::vector<int>::emplace(int&)' 75 | adj[ids[nr.first + dx[i]][nr.second + dy[i]]].emplace(id); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ In file included from /usr/include/c++/12.2.1/vector:64, from main.cpp:4: /usr/include/c++/12.2.1/bits/stl_vector.h:1341:9: note: candidate: 'template<class ... _Args> constexpr std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::emplace(const_iterator, _Args&& ...) [with _Args = {_Args ...}; _Tp = int; _Alloc = std::allocator<int>]' 1341 | emplace(const_iterator __position, _Args&&... __args) | ^~~~~~~ /usr/include/c++/12.2.1/bits/stl_vector.h:1341:9: note: template argument deduction/substitution failed: main.cpp:75:83: note: cannot convert 'id' (type 'int') to type 'std::vector<int>::const_iterator' 75 | adj[ids[nr.first + dx[i]][nr.second + dy[i]]].emplace(id); | ^~ main.cpp:76:66: error: no matching function for call to 'std::vector<int>::emplace(int&)' 76 | adj[ids[nr.first][nr.second]].emplace(ids[nr.first + dx[i]][nr.second + dy[i]]); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/12.2.1/bits/stl_vector.h:1341:9: note: candidate: 'template<class ... _Args> constexpr std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::emplace(const_iterator, _Args&& ...) [with _Args = {_Args ...}; _Tp = int; _Alloc = std::allocator<int>]' 1341 | emplace(const_iterator __position, _Args&&... __args) | ^~~~~~~ /usr/include/c++/12.2.1/bits/stl_vector.h:1341:9: note: template argument deduction/substitution failed: main.cpp:76:106: note: cannot convert 'ids[(nr.std::pair<int, int>::first + dx[i])][(nr.std::pair<int, int>::second + dy[i])]' (type 'int') to type 'std::vector<int>::const_iterator' 76 | adj[ids[nr.first][nr.second]].emplace(ids[nr.first + dx[i]][nr.second + dy[i]]); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ Non zero exit status: 1

Ceva nu functioneaza?