Borderou de evaluare (job #1426136)

Utilizator IrinaaaBotez Irina Irinaaa Data 28 aprilie 2015 23:49:31
Problema Arbore partial de cost minim Status done
Runda Arhiva educationala Compilator cpp | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: user.cpp: In function ‘int main()’: user.cpp:32:4: error: no match for ‘operator=’ (operand types are ‘std::pair<int, int>’ and ‘std::pair<int, int>*’) Q=new pair<int,int>[n-1]; ^ user.cpp:32:4: note: candidates are: In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from user.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:158:7: note: std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_T1, _T2>&) [with _T1 = int; _T2 = int] operator=(const pair& __p) ^ /usr/include/c++/4.8/bits/stl_pair.h:158:7: note: no known conversion for argument 1 from ‘std::pair<int, int>*’ to ‘const std::pair<int, int>&’ /usr/include/c++/4.8/bits/stl_pair.h:166:7: note: std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_T1, _T2>&&) [with _T1 = int; _T2 = int] operator=(pair&& __p) ^ /usr/include/c++/4.8/bits/stl_pair.h:166:7: note: no known conversion for argument 1 from ‘std::pair<int, int>*’ to ‘std::pair<int, int>&&’ /usr/include/c++/4.8/bits/stl_pair.h:177:2: note: template<class _U1, class _U2> std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U1 = _U1; _U2 = _U2; _T1 = int; _T2 = int] operator=(const pair<_U1, _U2>& __p) ^ /usr/include/c++/4.8/bits/stl_pair.h:177:2: note: template argument deduction/substitution failed: user.cpp:32:4: note: mismatched types ‘const std::pair<_T1, _T2>’ and ‘std::pair<int, int>*’ Q=new pair<int,int>[n-1]; ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from user.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:186:2: note: template<class _U1, class _U2> std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U1 = _U1; _U2 = _U2; _T1 = int; _T2 = int] operator=(pair<_U1, _U2>&& __p) ^ /usr/include/c++/4.8/bits/stl_pair.h:186:2: note: template argument deduction/substitution failed: user.cpp:32:4: note: mismatched types ‘std::pair<_T1, _T2>’ and ‘std::pair<int, int>*’ Q=new pair<int,int>[n-1]; ^ user.cpp:60:12: error: no match for ‘operator[]’ (operand types are ‘std::pair<int, int>’ and ‘int’) Q[x++]=make_pair(a,b); ^ user.cpp:68:30: error: no match for ‘operator[]’ (operand types are ‘std::pair<int, int>’ and ‘int’) for(int i=0;i<n-1;i++) g<<Q[i].first<<" "<<Q[i].second<<endl; ^ user.cpp:68:47: error: no match for ‘operator[]’ (operand types are ‘std::pair<int, int>’ and ‘int’) for(int i=0;i<n-1;i++) g<<Q[i].first<<" "<<Q[i].second<<endl; ^

Ceva nu functioneaza?