Borderou de evaluare (job #2328940)

Utilizator mareadevarIonescu Andrei mareadevar Data 26 ianuarie 2019 11:34:21
Problema Arbore partial de cost minim Status done
Runda Arhiva educationala Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp:13:1: error: expected initializer before 'void' void swap(int i,int j) ^~~~ main.cpp: In function 'void push(int)': main.cpp:21:12: error: no matching function for call to 'swap(int&, int)' {swap(x,x/2); ^ In file included from /usr/include/c++/6/bits/stl_pair.h:59:0, from /usr/include/c++/6/bits/stl_algobase.h:64, from /usr/include/c++/6/vector:60, from main.cpp:2: /usr/include/c++/6/bits/move.h:179:5: note: candidate: typename std::enable_if<std::__and_<std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> >::value>::type std::swap(_Tp&, _Tp&) [with _Tp = int; typename std::enable_if<std::__and_<std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> >::value>::type = void] <near match> swap(_Tp& __a, _Tp& __b) ^~~~ /usr/include/c++/6/bits/move.h:179:5: note: conversion of argument 2 would be ill-formed: main.cpp:21:10: error: invalid initialization of non-const reference of type 'int&' from an rvalue of type 'int' {swap(x,x/2); ~^~ In file included from /usr/include/c++/6/bits/stl_pair.h:59:0, from /usr/include/c++/6/bits/stl_algobase.h:64, from /usr/include/c++/6/vector:60, from main.cpp:2: /usr/include/c++/6/bits/move.h:202:5: note: candidate: template<class _Tp, long unsigned int _Nm> typename std::enable_if<std::__is_swappable<_Tp>::value>::type std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm]) swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) ^~~~ /usr/include/c++/6/bits/move.h:202:5: note: template argument deduction/substitution failed: main.cpp:21:12: note: mismatched types '_Tp [_Nm]' and 'int' {swap(x,x/2); ^ In file included from /usr/include/c++/6/bits/stl_algobase.h:64:0, from /usr/include/c++/6/vector:60, from main.cpp:2: /usr/include/c++/6/bits/stl_pair.h:475:5: note: candidate: template<class _T1, class _T2> void std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&) swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) ^~~~ /usr/include/c++/6/bits/stl_pair.h:475:5: note: template argument deduction/substitution failed: main.cpp:21:12: note: mismatched types 'std::pair<_T1, _T2>' and 'int' {swap(x,x/2); ^ In file included from /usr/include/c++/6/vector:64:0, from main.cpp:2: /usr/include/c++/6/bits/stl_vector.h:1557:5: note: candidate: template<class _Tp, class _Alloc> void std::swap(std::vector<_Tp, _Alloc>&, std::vector<_Tp, _Alloc>&) swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y) ^~~~ /usr/include/c++/6/bits/stl_vector.h:1557:5: note: template argument deduction/substitution failed: main.cpp:21:12: note: mismatched types 'std::vector<_Tp, _Alloc>' and 'int' {swap(x,x/2); ^ In file included from /usr/include/c++/6/vector:65:0, from main.cpp:2: Non zero exit status: 1

Ceva nu functioneaza?