Detalii evaluare #57009646

Rezumat problemă

eras

#4667

Stadionul pe care Taylor Swift concertează în cadrul Turului Eras poate fi reprezentat cu ajutorul unei matrice cu N linii și M coloane, numerotate începând de la 1. În fiecare celulă (i, j), de pe linia i și coloana j (1 ≤ i ≤ N și 1 ≤ j ≤ M), se află câte un scaun pe care pot fi așezate brățări ale prieteniei. Înainte de concert, pe fiecare dintre dintre cele N x M scaune, nu se află nicio brățară. Pe durata concertului, Steven efectuează, în ordine, U modificări, care pot fi de două tipuri:

  • tipul (L, a, v) cu semnificația că pe fiecare dintre cele M scaune de pe linia a sunt așezate câte v brățări noi (1 ≤ a ≤ N);
  • tipul (C, a, v) cu semnificația că pe fiecare dintre cele N scaune de pe coloana a sunt așezate câte v brățări noi (1 ≤ a ≤ M).

După ce toate modificările au fost efectuate, Caroline îi pune lui Steven, în ordine, Q întrebări. Pentru fiecare întrebare, se consideră un număr natural K și descrierile a K submatrice. Steven trebuie să determine câte brățări sunt, în total, pe scaunele ce se află în cel puțin una dintre cele K submatrice considerate. Ajutați-l pe Steven să răspundă corect la toate cele Q întrebări puse de Caroline!

Detalii

Problema eras Operații I/O eras.in/eras.out
Limita timp 1.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #57009646 Utilizator Rada Valer Nica (RadaValer)
Fișier eras.cpp Dimensiune 3.74 KB
Data încărcării 13 Martie 2025, 00:24 Scor / rezultat Eroare de compilare

Evaluare

Mesaj compilare

eras.cpp:68:29: error: 'long long int j1' redeclared as different kind of symbol
 long long n,m,c,x,y,q,i1,i2,j1,j2,k,sum,ai1,ai2,aj1,aj2,li1,li2,lj1,lj2,ni1, ni2, nj1, nj2;

                             ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426,
                 from /usr/include/c++/4.8/iostream:38,
                 from eras.cpp:1:
/usr/include/i386-linux-gnu/bits/mathcalls.h:238:1: error: previous declaration of 'double j1(double)'
 __MATHCALL (j1,, (_Mdouble_));
 ^
eras.cpp: In function 'bool overlap()':
eras.cpp:93:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
     if(j2<j1)

           ^
eras.cpp:94:19: error: no matching function for call to 'swap(double (&)(double)throw (), long long int&)'
         swap(j1,j2);

                   ^
eras.cpp:94:19: note: candidates are:
In file included from /usr/include/c++/4.8/bits/stl_pair.h:59:0,
                 from /usr/include/c++/4.8/bits/stl_algobase.h:64,
                 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 eras.cpp:1:
/usr/include/c++/4.8/bits/move.h:166:5: note: template<class _Tp> void std::swap(_Tp&, _Tp&)
     swap(_Tp& __a, _Tp& __b)
     ^
/usr/include/c++/4.8/bits/move.h:166:5: note:   template argument deduction/substitution failed:
eras.cpp:94:19: note:   deduced conflicting types for parameter '_Tp' ('double(double)throw ()' and 'long long int')
         swap(j1,j2);

                   ^
In file included from /usr/include/c++/4.8/bits/stl_pair.h:59:0,
                 from /usr/include/c++/4.8/bits/stl_algobase.h:64,
                 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 eras.cpp:1:
/usr/include/c++/4.8/bits/move.h:185:5: note: template<class _Tp, unsigned int _Nm> void std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])
     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
     ^
/usr/include/c++/4.8/bits/move.h:185:5: note:   template argument deduction/substitution failed:
eras.cpp:94:19: note:   mismatched types '_Tp [_Nm]' and 'double(double)throw ()'
         swap(j1,j2);

                   ^
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 eras.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:254:5: note: 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++/4.8/bits/stl_pair.h:254:5: note:   template argument deduction/substitution failed:
eras.cpp:94:19: note:   mismatched types 'std::pair<_T1, _T2>' and 'double(double)throw ()'
         swap(j1,j2);

                   ^
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from eras.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2717:5: note: template<class _CharT, class _Traits, class _Alloc> void std::swap(std::basic_string<_CharT, _Traits, _Alloc>&, std::basic_string<_CharT, _Traits, _Alloc>&)
     swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2717:5: note:   template argument deduction/substitution failed:
eras.cpp:94:19: note:   mismatched types 'std::basic_string<_CharT, _Traits, _Alloc>' and 'double(double)throw ()'
         swap(j1,j2);

                   ^
In file included from /usr/include/c++/4.8/vector:64:0,
                 from /usr/include/c++/4.8/bits/random.h:34,
                 from /usr/include/c++/4.8/random:50,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_vector.h:1452:5: note: 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++/4.8/bits/stl_vector.h:1452:5: note:   template argument deduction/substitution failed:
eras.cpp:94:19: note:   mismatched types 'std::vector<_Tp, _Alloc>' and 'double(double)throw ()'
         swap(j1,j2);

                   ^
In file included from /usr/include/c++/4.8/vector:65:0,
                 from /usr/include/c++/4.8/bits/random.h:34,
                 from /usr/include/c++/4.8/random:50,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_bvector.h:112:3: note: void std::swap(std::_Bit_reference, std::_Bit_reference)
   swap(_Bit_reference __x, _Bit_reference __y) noexcept
   ^
/usr/include/c++/4.8/bits/stl_bvector.h:112:3: note:   no known conversion for argument 1 from 'double(double)throw ()' to 'std::_Bit_reference'
/usr/include/c++/4.8/bits/stl_bvector.h:120:3: note: void std::swap(std::_Bit_reference, bool&)
   swap(_Bit_reference __x, bool& __y) noexcept
   ^
/usr/include/c++/4.8/bits/stl_bvector.h:120:3: note:   no known conversion for argument 1 from 'double(double)throw ()' to 'std::_Bit_reference'
/usr/include/c++/4.8/bits/stl_bvector.h:128:3: note: void std::swap(bool&, std::_Bit_reference)
   swap(bool& __x, _Bit_reference __y) noexcept
   ^
/usr/include/c++/4.8/bits/stl_bvector.h:128:3: note:   no known conversion for argument 1 from 'double(double)throw ()' to 'bool&'
In file included from /usr/include/c++/4.8/tuple:39:0,
                 from /usr/include/c++/4.8/functional:55,
                 from /usr/include/c++/4.8/bits/stl_algo.h:66,
                 from /usr/include/c++/4.8/algorithm:62,
                 from eras.cpp:3:
/usr/include/c++/4.8/array:262:5: note: template<class _Tp, unsigned int _Nm> void std::swap(std::array<_Tp, _Nm>&, std::array<_Tp, _Nm>&)
     swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
     ^
/usr/include/c++/4.8/array:262:5: note:   template argument deduction/substitution failed:
eras.cpp:94:19: note:   mismatched types 'std::array<_Tp, _Nm>' and 'double(double)throw ()'
         swap(j1,j2);

                   ^
In file included from /usr/include/c++/4.8/functional:55:0,
                 from /usr/include/c++/4.8/bits/stl_algo.h:66,
                 from /usr/include/c++/4.8/algorithm:62,
                 from eras.cpp:3:
/usr/include/c++/4.8/tuple:1050:5: note: template<class ... _Elements> void std::swap(std::tuple<_Elements ...>&, std::tuple<_Elements ...>&)
     swap(tuple<_Elements...>& __x, tuple<_Elements...>& __y)
     ^
/usr/include/c++/4.8/tuple:1050:5: note:   template argument deduction/substitution failed:
eras.cpp:94:19: note:   mismatched types 'std::tuple<_Elements ...>' and 'double(double)throw ()'
         swap(j1,j2);

                   ^
In file included from /usr/include/c++/4.8/bits/stl_algo.h:66:0,
                 from /usr/include/c++/4.8/algorithm:62,
                 from eras.cpp:3:
/usr/include/c++/4.8/functional:2573:5: note: template<class _Res, class ... _Args> void std::swap(std::function<_Res(_ArgTypes ...)>&, std::function<_Res(_ArgTypes ...)>&)
     swap(function<_Res(_Args...)>& __x, function<_Res(_Args...)>& __y)
     ^
/usr/include/c++/4.8/functional:2573:5: note:   template argument deduction/substitution failed:
eras.cpp:94:19: note:   mismatched types 'std::function<_Res(_ArgTypes ...)>' and 'double(double)throw ()'
         swap(j1,j2);

                   ^
eras.cpp:98:22: error: no matching function for call to 'max(long long int&, double (&)(double)throw ())'
     nj1 = max(lj1, j1);

                      ^
eras.cpp:98:22: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 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 eras.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:216:5: note:   template argument deduction/substitution failed:
eras.cpp:98:22: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'double(double)throw ()')
     nj1 = max(lj1, j1);

                      ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 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 eras.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:260:5: note:   template argument deduction/substitution failed:
eras.cpp:98:22: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'double(double)throw ()')
     nj1 = max(lj1, j1);

                      ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:4231:5: note: template<class _Tp> _Tp std::max(std::initializer_list<_Tp>)
     max(initializer_list<_Tp> __l)
     ^
/usr/include/c++/4.8/bits/stl_algo.h:4231:5: note:   template argument deduction/substitution failed:
eras.cpp:98:22: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
     nj1 = max(lj1, j1);

                      ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:4236:5: note: template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare)
     max(initializer_list<_Tp> __l, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algo.h:4236:5: note:   template argument deduction/substitution failed:
eras.cpp:98:22: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
     nj1 = max(lj1, j1);

                      ^
eras.cpp: In function 'int main()':
eras.cpp:120:50: error: parameter declared 'auto'
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                                  ^
eras.cpp:120:65: error: parameter declared 'auto'
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                                                 ^
eras.cpp: In lambda function:
eras.cpp:121:12: error: 'a' was not declared in this scope
     return a.nr < b.nr;

            ^
eras.cpp:121:19: error: 'b' was not declared in this scope
     return a.nr < b.nr;

                   ^
eras.cpp: In function 'int main()':
eras.cpp:124:50: error: parameter declared 'auto'
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                                  ^
eras.cpp:124:65: error: parameter declared 'auto'
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                                                 ^
eras.cpp: In lambda function:
eras.cpp:125:12: error: 'a' was not declared in this scope
     return a.nr < b.nr;

            ^
eras.cpp:125:19: error: 'b' was not declared in this scope
     return a.nr < b.nr;

                   ^
eras.cpp: In function 'int main()':
eras.cpp:132:16: error: cannot bind 'std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}' lvalue to 'std::basic_istream<char>&&'
             fin>>i1>>j1>>i2>>j2;

                ^
In file included from /usr/include/c++/4.8/iostream:40:0,
                 from eras.cpp:1:
/usr/include/c++/4.8/istream:872:5: error:   initializing argument 1 of 'std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&&, _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = double(double)throw ()]'
     operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x)
     ^
eras.cpp:135:27: error: no matching function for call to 'swap(long long int&, double (&)(double)throw ())'
                 swap(j2,j1);

                           ^
eras.cpp:135:27: note: candidates are:
In file included from /usr/include/c++/4.8/bits/stl_pair.h:59:0,
                 from /usr/include/c++/4.8/bits/stl_algobase.h:64,
                 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 eras.cpp:1:
/usr/include/c++/4.8/bits/move.h:166:5: note: template<class _Tp> void std::swap(_Tp&, _Tp&)
     swap(_Tp& __a, _Tp& __b)
     ^
/usr/include/c++/4.8/bits/move.h:166:5: note:   template argument deduction/substitution failed:
eras.cpp:135:27: note:   deduced conflicting types for parameter '_Tp' ('long long int' and 'double(double)throw ()')
                 swap(j2,j1);

                           ^
In file included from /usr/include/c++/4.8/bits/stl_pair.h:59:0,
                 from /usr/include/c++/4.8/bits/stl_algobase.h:64,
                 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 eras.cpp:1:
/usr/include/c++/4.8/bits/move.h:185:5: note: template<class _Tp, unsigned int _Nm> void std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])
     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
     ^
/usr/include/c++/4.8/bits/move.h:185:5: note:   template argument deduction/substitution failed:
eras.cpp:135:27: note:   mismatched types '_Tp [_Nm]' and 'long long int'
                 swap(j2,j1);

                           ^
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 eras.cpp:1:
/usr/include/c++/4.8/bits/stl_pair.h:254:5: note: 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++/4.8/bits/stl_pair.h:254:5: note:   template argument deduction/substitution failed:
eras.cpp:135:27: note:   mismatched types 'std::pair<_T1, _T2>' and 'long long int'
                 swap(j2,j1);

                           ^
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from eras.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2717:5: note: template<class _CharT, class _Traits, class _Alloc> void std::swap(std::basic_string<_CharT, _Traits, _Alloc>&, std::basic_string<_CharT, _Traits, _Alloc>&)
     swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2717:5: note:   template argument deduction/substitution failed:
eras.cpp:135:27: note:   mismatched types 'std::basic_string<_CharT, _Traits, _Alloc>' and 'long long int'
                 swap(j2,j1);

                           ^
In file included from /usr/include/c++/4.8/vector:64:0,
                 from /usr/include/c++/4.8/bits/random.h:34,
                 from /usr/include/c++/4.8/random:50,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_vector.h:1452:5: note: 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++/4.8/bits/stl_vector.h:1452:5: note:   template argument deduction/substitution failed:
eras.cpp:135:27: note:   mismatched types 'std::vector<_Tp, _Alloc>' and 'long long int'
                 swap(j2,j1);

                           ^
In file included from /usr/include/c++/4.8/vector:65:0,
                 from /usr/include/c++/4.8/bits/random.h:34,
                 from /usr/include/c++/4.8/random:50,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_bvector.h:112:3: note: void std::swap(std::_Bit_reference, std::_Bit_reference)
   swap(_Bit_reference __x, _Bit_reference __y) noexcept
   ^
/usr/include/c++/4.8/bits/stl_bvector.h:112:3: note:   no known conversion for argument 1 from 'long long int' to 'std::_Bit_reference'
/usr/include/c++/4.8/bits/stl_bvector.h:120:3: note: void std::swap(std::_Bit_reference, bool&)
   swap(_Bit_reference __x, bool& __y) noexcept
   ^
/usr/include/c++/4.8/bits/stl_bvector.h:120:3: note:   no known conversion for argument 1 from 'long long int' to 'std::_Bit_reference'
/usr/include/c++/4.8/bits/stl_bvector.h:128:3: note: void std::swap(bool&, std::_Bit_reference)
   swap(bool& __x, _Bit_reference __y) noexcept
   ^
/usr/include/c++/4.8/bits/stl_bvector.h:128:3: note:   no known conversion for argument 1 from 'long long int' to 'bool&'
In file included from /usr/include/c++/4.8/tuple:39:0,
                 from /usr/include/c++/4.8/functional:55,
                 from /usr/include/c++/4.8/bits/stl_algo.h:66,
                 from /usr/include/c++/4.8/algorithm:62,
                 from eras.cpp:3:
/usr/include/c++/4.8/array:262:5: note: template<class _Tp, unsigned int _Nm> void std::swap(std::array<_Tp, _Nm>&, std::array<_Tp, _Nm>&)
     swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
     ^
/usr/include/c++/4.8/array:262:5: note:   template argument deduction/substitution failed:
eras.cpp:135:27: note:   mismatched types 'std::array<_Tp, _Nm>' and 'long long int'
                 swap(j2,j1);

                           ^
In file included from /usr/include/c++/4.8/functional:55:0,
                 from /usr/include/c++/4.8/bits/stl_algo.h:66,
                 from /usr/include/c++/4.8/algorithm:62,
                 from eras.cpp:3:
/usr/include/c++/4.8/tuple:1050:5: note: template<class ... _Elements> void std::swap(std::tuple<_Elements ...>&, std::tuple<_Elements ...>&)
     swap(tuple<_Elements...>& __x, tuple<_Elements...>& __y)
     ^
/usr/include/c++/4.8/tuple:1050:5: note:   template argument deduction/substitution failed:
eras.cpp:135:27: note:   mismatched types 'std::tuple<_Elements ...>' and 'long long int'
                 swap(j2,j1);

                           ^
In file included from /usr/include/c++/4.8/bits/stl_algo.h:66:0,
                 from /usr/include/c++/4.8/algorithm:62,
                 from eras.cpp:3:
/usr/include/c++/4.8/functional:2573:5: note: template<class _Res, class ... _Args> void std::swap(std::function<_Res(_ArgTypes ...)>&, std::function<_Res(_ArgTypes ...)>&)
     swap(function<_Res(_Args...)>& __x, function<_Res(_Args...)>& __y)
     ^
/usr/include/c++/4.8/functional:2573:5: note:   template argument deduction/substitution failed:
eras.cpp:135:27: note:   mismatched types 'std::function<_Res(_ArgTypes ...)>' and 'long long int'
                 swap(j2,j1);

                           ^
eras.cpp:137:37: error: invalid conversion from 'double (*)(double)throw ()' to 'int' [-fpermissive]
             sum += findA(i1,j1,i2,j2);

                                     ^
eras.cpp:69:11: error:   initializing argument 2 of 'long long int findA(int, int, int, int)' [-fpermissive]
 long long findA(int i1, int j1, int i2, int j2){

           ^
eras.cpp:143:37: error: invalid conversion from 'double (*)(double)throw ()' to 'long long int' [-fpermissive]
             li1 = i1, li2 = i2, lj1 = j1, lj2 =j2;

                                     ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = op*; _Compare = main()::__lambda0]':
/usr/include/c++/4.8/bits/stl_algo.h:2226:70:   required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = op*; _Compare = main()::__lambda0]'
/usr/include/c++/4.8/bits/stl_algo.h:5500:55:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = op*; _Compare = main()::__lambda0]'
eras.cpp:122:2:   required from here
/usr/include/c++/4.8/bits/stl_algo.h:2159:29: error: no match for call to '(main()::__lambda0) (op&, op&)'
    if (__comp(*__i, *__first))
                             ^
eras.cpp:120:36: note: candidates are:
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:2159:29: note: void (*)() <conversion>
    if (__comp(*__i, *__first))
                             ^
/usr/include/c++/4.8/bits/stl_algo.h:2159:29: note:   candidate expects 1 argument, 3 provided
eras.cpp:120:66: note: main()::__lambda0
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:120:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = op*; _Compare = main()::__lambda1]':
/usr/include/c++/4.8/bits/stl_algo.h:2226:70:   required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = op*; _Compare = main()::__lambda1]'
/usr/include/c++/4.8/bits/stl_algo.h:5500:55:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = op*; _Compare = main()::__lambda1]'
eras.cpp:126:2:   required from here
/usr/include/c++/4.8/bits/stl_algo.h:2159:29: error: no match for call to '(main()::__lambda1) (op&, op&)'
    if (__comp(*__i, *__first))
                             ^
eras.cpp:124:36: note: candidates are:
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:2159:29: note: void (*)() <conversion>
    if (__comp(*__i, *__first))
                             ^
/usr/include/c++/4.8/bits/stl_algo.h:2159:29: note:   candidate expects 1 argument, 3 provided
eras.cpp:124:66: note: main()::__lambda1
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:124:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h: In instantiation of 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = op*; _Compare = main()::__lambda0]':
/usr/include/c++/4.8/bits/stl_algo.h:5349:59:   required from 'void std::partial_sort(_RAIter, _RAIter, _RAIter, _Compare) [with _RAIter = op*; _Compare = main()::__lambda0]'
/usr/include/c++/4.8/bits/stl_algo.h:2332:68:   required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = op*; _Size = int; _Compare = main()::__lambda0]'
/usr/include/c++/4.8/bits/stl_algo.h:5499:44:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = op*; _Compare = main()::__lambda0]'
eras.cpp:122:2:   required from here
/usr/include/c++/4.8/bits/stl_algo.h:1948:27: error: no match for call to '(main()::__lambda0) (op&, op&)'
  if (__comp(*__i, *__first))
                           ^
eras.cpp:120:36: note: candidates are:
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:1948:27: note: void (*)() <conversion>
  if (__comp(*__i, *__first))
                           ^
/usr/include/c++/4.8/bits/stl_algo.h:1948:27: note:   candidate expects 1 argument, 3 provided
eras.cpp:120:66: note: main()::__lambda0
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:120:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h: In instantiation of 'void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = op*; _Compare = main()::__lambda0]':
/usr/include/c++/4.8/bits/stl_algo.h:2295:13:   required from '_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = op*; _Compare = main()::__lambda0]'
/usr/include/c++/4.8/bits/stl_algo.h:2337:62:   required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = op*; _Size = int; _Compare = main()::__lambda0]'
/usr/include/c++/4.8/bits/stl_algo.h:5499:44:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = op*; _Compare = main()::__lambda0]'
eras.cpp:122:2:   required from here
/usr/include/c++/4.8/bits/stl_algo.h:114:28: error: no match for call to '(main()::__lambda0) (op&, op&)'
       if (__comp(*__a, *__b))
                            ^
eras.cpp:120:36: note: candidates are:
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:114:28: note: void (*)() <conversion>
       if (__comp(*__a, *__b))
                            ^
/usr/include/c++/4.8/bits/stl_algo.h:114:28: note:   candidate expects 1 argument, 3 provided
eras.cpp:120:66: note: main()::__lambda0
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:120:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:116:25: error: no match for call to '(main()::__lambda0) (op&, op&)'
    if (__comp(*__b, *__c))
                         ^
eras.cpp:120:36: note: candidates are:
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:116:25: note: void (*)() <conversion>
    if (__comp(*__b, *__c))
                         ^
/usr/include/c++/4.8/bits/stl_algo.h:116:25: note:   candidate expects 1 argument, 3 provided
eras.cpp:120:66: note: main()::__lambda0
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:120:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:118:30: error: no match for call to '(main()::__lambda0) (op&, op&)'
    else if (__comp(*__a, *__c))
                              ^
eras.cpp:120:36: note: candidates are:
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:118:30: note: void (*)() <conversion>
    else if (__comp(*__a, *__c))
                              ^
/usr/include/c++/4.8/bits/stl_algo.h:118:30: note:   candidate expects 1 argument, 3 provided
eras.cpp:120:66: note: main()::__lambda0
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:120:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:123:33: error: no match for call to '(main()::__lambda0) (op&, op&)'
       else if (__comp(*__a, *__c))
                                 ^
eras.cpp:120:36: note: candidates are:
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:123:33: note: void (*)() <conversion>
       else if (__comp(*__a, *__c))
                                 ^
/usr/include/c++/4.8/bits/stl_algo.h:123:33: note:   candidate expects 1 argument, 3 provided
eras.cpp:120:66: note: main()::__lambda0
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:120:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:125:33: error: no match for call to '(main()::__lambda0) (op&, op&)'
       else if (__comp(*__b, *__c))
                                 ^
eras.cpp:120:36: note: candidates are:
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:125:33: note: void (*)() <conversion>
       else if (__comp(*__b, *__c))
                                 ^
/usr/include/c++/4.8/bits/stl_algo.h:125:33: note:   candidate expects 1 argument, 3 provided
eras.cpp:120:66: note: main()::__lambda0
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:120:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h: In instantiation of '_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, const _Tp&, _Compare) [with _RandomAccessIterator = op*; _Tp = op; _Compare = main()::__lambda0]':
/usr/include/c++/4.8/bits/stl_algo.h:2296:78:   required from '_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = op*; _Compare = main()::__lambda0]'
/usr/include/c++/4.8/bits/stl_algo.h:2337:62:   required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = op*; _Size = int; _Compare = main()::__lambda0]'
/usr/include/c++/4.8/bits/stl_algo.h:5499:44:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = op*; _Compare = main()::__lambda0]'
eras.cpp:122:2:   required from here
/usr/include/c++/4.8/bits/stl_algo.h:2263:35: error: no match for call to '(main()::__lambda0) (op&, const op&)'
    while (__comp(*__first, __pivot))
                                   ^
eras.cpp:120:36: note: candidates are:
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:2263:35: note: void (*)() <conversion>
    while (__comp(*__first, __pivot))
                                   ^
/usr/include/c++/4.8/bits/stl_algo.h:2263:35: note:   candidate expects 1 argument, 3 provided
eras.cpp:120:66: note: main()::__lambda0
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:120:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:2266:34: error: no match for call to '(main()::__lambda0) (const op&, op&)'
    while (__comp(__pivot, *__last))
                                  ^
eras.cpp:120:36: note: candidates are:
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:2266:34: note: void (*)() <conversion>
    while (__comp(__pivot, *__last))
                                  ^
/usr/include/c++/4.8/bits/stl_algo.h:2266:34: note:   candidate expects 1 argument, 3 provided
eras.cpp:120:66: note: main()::__lambda0
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:120:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h: In instantiation of 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = op*; _Compare = main()::__lambda1]':
/usr/include/c++/4.8/bits/stl_algo.h:5349:59:   required from 'void std::partial_sort(_RAIter, _RAIter, _RAIter, _Compare) [with _RAIter = op*; _Compare = main()::__lambda1]'
/usr/include/c++/4.8/bits/stl_algo.h:2332:68:   required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = op*; _Size = int; _Compare = main()::__lambda1]'
/usr/include/c++/4.8/bits/stl_algo.h:5499:44:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = op*; _Compare = main()::__lambda1]'
eras.cpp:126:2:   required from here
/usr/include/c++/4.8/bits/stl_algo.h:1948:27: error: no match for call to '(main()::__lambda1) (op&, op&)'
  if (__comp(*__i, *__first))
                           ^
eras.cpp:124:36: note: candidates are:
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:1948:27: note: void (*)() <conversion>
  if (__comp(*__i, *__first))
                           ^
/usr/include/c++/4.8/bits/stl_algo.h:1948:27: note:   candidate expects 1 argument, 3 provided
eras.cpp:124:66: note: main()::__lambda1
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:124:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h: In instantiation of 'void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = op*; _Compare = main()::__lambda1]':
/usr/include/c++/4.8/bits/stl_algo.h:2295:13:   required from '_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = op*; _Compare = main()::__lambda1]'
/usr/include/c++/4.8/bits/stl_algo.h:2337:62:   required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = op*; _Size = int; _Compare = main()::__lambda1]'
/usr/include/c++/4.8/bits/stl_algo.h:5499:44:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = op*; _Compare = main()::__lambda1]'
eras.cpp:126:2:   required from here
/usr/include/c++/4.8/bits/stl_algo.h:114:28: error: no match for call to '(main()::__lambda1) (op&, op&)'
       if (__comp(*__a, *__b))
                            ^
eras.cpp:124:36: note: candidates are:
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:114:28: note: void (*)() <conversion>
       if (__comp(*__a, *__b))
                            ^
/usr/include/c++/4.8/bits/stl_algo.h:114:28: note:   candidate expects 1 argument, 3 provided
eras.cpp:124:66: note: main()::__lambda1
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:124:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:116:25: error: no match for call to '(main()::__lambda1) (op&, op&)'
    if (__comp(*__b, *__c))
                         ^
eras.cpp:124:36: note: candidates are:
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:116:25: note: void (*)() <conversion>
    if (__comp(*__b, *__c))
                         ^
/usr/include/c++/4.8/bits/stl_algo.h:116:25: note:   candidate expects 1 argument, 3 provided
eras.cpp:124:66: note: main()::__lambda1
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:124:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:118:30: error: no match for call to '(main()::__lambda1) (op&, op&)'
    else if (__comp(*__a, *__c))
                              ^
eras.cpp:124:36: note: candidates are:
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:118:30: note: void (*)() <conversion>
    else if (__comp(*__a, *__c))
                              ^
/usr/include/c++/4.8/bits/stl_algo.h:118:30: note:   candidate expects 1 argument, 3 provided
eras.cpp:124:66: note: main()::__lambda1
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:124:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:123:33: error: no match for call to '(main()::__lambda1) (op&, op&)'
       else if (__comp(*__a, *__c))
                                 ^
eras.cpp:124:36: note: candidates are:
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:123:33: note: void (*)() <conversion>
       else if (__comp(*__a, *__c))
                                 ^
/usr/include/c++/4.8/bits/stl_algo.h:123:33: note:   candidate expects 1 argument, 3 provided
eras.cpp:124:66: note: main()::__lambda1
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:124:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:125:33: error: no match for call to '(main()::__lambda1) (op&, op&)'
       else if (__comp(*__b, *__c))
                                 ^
eras.cpp:124:36: note: candidates are:
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:125:33: note: void (*)() <conversion>
       else if (__comp(*__b, *__c))
                                 ^
/usr/include/c++/4.8/bits/stl_algo.h:125:33: note:   candidate expects 1 argument, 3 provided
eras.cpp:124:66: note: main()::__lambda1
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:124:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h: In instantiation of '_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, const _Tp&, _Compare) [with _RandomAccessIterator = op*; _Tp = op; _Compare = main()::__lambda1]':
/usr/include/c++/4.8/bits/stl_algo.h:2296:78:   required from '_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = op*; _Compare = main()::__lambda1]'
/usr/include/c++/4.8/bits/stl_algo.h:2337:62:   required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = op*; _Size = int; _Compare = main()::__lambda1]'
/usr/include/c++/4.8/bits/stl_algo.h:5499:44:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = op*; _Compare = main()::__lambda1]'
eras.cpp:126:2:   required from here
/usr/include/c++/4.8/bits/stl_algo.h:2263:35: error: no match for call to '(main()::__lambda1) (op&, const op&)'
    while (__comp(*__first, __pivot))
                                   ^
eras.cpp:124:36: note: candidates are:
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:2263:35: note: void (*)() <conversion>
    while (__comp(*__first, __pivot))
                                   ^
/usr/include/c++/4.8/bits/stl_algo.h:2263:35: note:   candidate expects 1 argument, 3 provided
eras.cpp:124:66: note: main()::__lambda1
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:124:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:2266:34: error: no match for call to '(main()::__lambda1) (const op&, op&)'
    while (__comp(__pivot, *__last))
                                  ^
eras.cpp:124:36: note: candidates are:
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h:2266:34: note: void (*)() <conversion>
    while (__comp(__pivot, *__last))
                                  ^
/usr/include/c++/4.8/bits/stl_algo.h:2266:34: note:   candidate expects 1 argument, 3 provided
eras.cpp:124:66: note: main()::__lambda1
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:124:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/bits/stl_algo.h:61:0,
                 from /usr/include/c++/4.8/algorithm:62,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_heap.h: In instantiation of 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = op*; _Distance = int; _Tp = op; _Compare = main()::__lambda0]':
/usr/include/c++/4.8/bits/stl_heap.h:448:15:   required from 'void std::make_heap(_RAIter, _RAIter, _Compare) [with _RAIter = op*; _Compare = main()::__lambda0]'
/usr/include/c++/4.8/bits/stl_algo.h:1946:47:   required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = op*; _Compare = main()::__lambda0]'
/usr/include/c++/4.8/bits/stl_algo.h:5349:59:   required from 'void std::partial_sort(_RAIter, _RAIter, _RAIter, _Compare) [with _RAIter = op*; _Compare = main()::__lambda0]'
/usr/include/c++/4.8/bits/stl_algo.h:2332:68:   required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = op*; _Size = int; _Compare = main()::__lambda0]'
/usr/include/c++/4.8/bits/stl_algo.h:5499:44:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = op*; _Compare = main()::__lambda0]'
eras.cpp:122:2:   required from here
/usr/include/c++/4.8/bits/stl_heap.h:313:40: error: no match for call to '(main()::__lambda0) (op&, op&)'
        *(__first + (__secondChild - 1))))
                                        ^
eras.cpp:120:36: note: candidates are:
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/bits/stl_algo.h:61:0,
                 from /usr/include/c++/4.8/algorithm:62,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_heap.h:313:40: note: void (*)() <conversion>
        *(__first + (__secondChild - 1))))
                                        ^
/usr/include/c++/4.8/bits/stl_heap.h:313:40: note:   candidate expects 1 argument, 3 provided
eras.cpp:120:66: note: main()::__lambda0
 std::sort(C + 1, C + C[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:120:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/bits/stl_algo.h:61:0,
                 from /usr/include/c++/4.8/algorithm:62,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_heap.h: In instantiation of 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = op*; _Distance = int; _Tp = op; _Compare = main()::__lambda1]':
/usr/include/c++/4.8/bits/stl_heap.h:448:15:   required from 'void std::make_heap(_RAIter, _RAIter, _Compare) [with _RAIter = op*; _Compare = main()::__lambda1]'
/usr/include/c++/4.8/bits/stl_algo.h:1946:47:   required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = op*; _Compare = main()::__lambda1]'
/usr/include/c++/4.8/bits/stl_algo.h:5349:59:   required from 'void std::partial_sort(_RAIter, _RAIter, _RAIter, _Compare) [with _RAIter = op*; _Compare = main()::__lambda1]'
/usr/include/c++/4.8/bits/stl_algo.h:2332:68:   required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = op*; _Size = int; _Compare = main()::__lambda1]'
/usr/include/c++/4.8/bits/stl_algo.h:5499:44:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = op*; _Compare = main()::__lambda1]'
eras.cpp:126:2:   required from here
/usr/include/c++/4.8/bits/stl_heap.h:313:40: error: no match for call to '(main()::__lambda1) (op&, op&)'
        *(__first + (__secondChild - 1))))
                                        ^
eras.cpp:124:36: note: candidates are:
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                    ^
In file included from /usr/include/c++/4.8/bits/stl_algo.h:61:0,
                 from /usr/include/c++/4.8/algorithm:62,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_heap.h:313:40: note: void (*)() <conversion>
        *(__first + (__secondChild - 1))))
                                        ^
/usr/include/c++/4.8/bits/stl_heap.h:313:40: note:   candidate expects 1 argument, 3 provided
eras.cpp:124:66: note: main()::__lambda1
 std::sort(L + 1, L + L[0].nr + 1, [](const auto &a, const auto &b) {

                                                                  ^
eras.cpp:124:66: note:   candidate expects 0 arguments, 2 provided
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_algo.h: At global scope:
/usr/include/c++/4.8/bits/stl_algo.h:2110:5: error: 'void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = op*; _Compare = main()::__lambda0]', declared using local type 'main()::__lambda0', is used but never defined [-fpermissive]
     __unguarded_linear_insert(_RandomAccessIterator __last,
     ^
/usr/include/c++/4.8/bits/stl_algo.h:2110:5: error: 'void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = op*; _Compare = main()::__lambda1]', declared using local type 'main()::__lambda1', is used but never defined [-fpermissive]
In file included from /usr/include/c++/4.8/bits/stl_algo.h:61:0,
                 from /usr/include/c++/4.8/algorithm:62,
                 from eras.cpp:3:
/usr/include/c++/4.8/bits/stl_heap.h:331:5: error: 'void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = op*; _Compare = main()::__lambda0]', declared using local type 'main()::__lambda0', is used but never defined [-fpermissive]
     __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
     ^
/usr/include/c++/4.8/bits/stl_heap.h:331:5: error: 'void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = op*; _Compare = main()::__lambda1]', declared using local type 'main()::__lambda1', is used but never defined [-fpermissive]
/usr/include/c++/4.8/bits/stl_heap.h:178:5: error: 'void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = op*; _Distance = int; _Tp = op; _Compare = main()::__lambda0]', declared using local type 'main()::__lambda0', is used but never defined [-fpermissive]
     __push_heap(_RandomAccessIterator __first, _Distance __holeIndex,
     ^
/usr/include/c++/4.8/bits/stl_heap.h:178:5: error: 'void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = op*; _Distance = int; _Tp = op; _Compare = main()::__lambda1]', declared using local type 'main()::__lambda1', is used but never defined [-fpermissive]

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema eras face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.

Du-te sus!