Detalii evaluare #8929803

Rezumat problemă

#1886 Rucsac1

Într-un magazin sunt n obiecte; pentru fiecare se cunoaște greutatea G și valoarea V. Un hoț intră în magazin având un rucsac ce poate transporta o greutate maximă GMax. El va fura anumite obiecte, astfel încât suma greutăților obiectelor furate să nu depășească GMax.

Să se stabilească câștigul maxim pe care îl poate obține hoțul. Câștigul este egal cu suma valorilor obiectelor furate.

Detalii

Problema Rucsac1 Operații I/O tastatură/ecran
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #8929803 Utilizator Raluca Sylvie (ralucasylvie)
Fișier rucsac1.cpp Dimensiune 1003 B
Data încărcării 20 Martie 2018, 10:51 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

rucsac1.cpp:1:1: error: 'include' does not name a type
 include <iostream>

 ^
In file included from /usr/include/c++/4.8/bits/move.h:57:0,
                 from /usr/include/c++/4.8/bits/stl_pair.h:59,
                 from /usr/include/c++/4.8/utility:70,
                 from /usr/include/c++/4.8/algorithm:60,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/type_traits:285:31: error: 'std::size_t' has not been declared
   template<typename _Tp, std::size_t _Size>
                               ^
/usr/include/c++/4.8/type_traits:419:34: error: 'nullptr_t' is not a member of 'std'
     struct __is_nullptr_t_helper<std::nullptr_t>
                                  ^
/usr/include/c++/4.8/type_traits:419:34: error: 'nullptr_t' is not a member of 'std'
/usr/include/c++/4.8/type_traits:419:48: error: template argument 1 is invalid
     struct __is_nullptr_t_helper<std::nullptr_t>
                                                ^
/usr/include/c++/4.8/type_traits:1239:32: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t, __alignof__(_Tp)> { };
                                ^
/usr/include/c++/4.8/type_traits:1239:32: error: 'size_t' is not a member of 'std'
/usr/include/c++/4.8/type_traits:1239:61: error: template argument 1 is invalid
     : public integral_constant<std::size_t, __alignof__(_Tp)> { };
                                                             ^
/usr/include/c++/4.8/type_traits:1239:61: note: invalid template non-type parameter
/usr/include/c++/4.8/type_traits:1244:32: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t, 0> { };
                                ^
/usr/include/c++/4.8/type_traits:1244:32: error: 'size_t' is not a member of 'std'
/usr/include/c++/4.8/type_traits:1244:46: error: template argument 1 is invalid
     : public integral_constant<std::size_t, 0> { };
                                              ^
/usr/include/c++/4.8/type_traits:1244:46: note: invalid template non-type parameter
/usr/include/c++/4.8/type_traits:1246:31: error: 'std::size_t' has not been declared
   template<typename _Tp, std::size_t _Size>
                               ^
/usr/include/c++/4.8/type_traits:1248:32: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
                                ^
/usr/include/c++/4.8/type_traits:1248:32: error: 'size_t' is not a member of 'std'
/usr/include/c++/4.8/type_traits:1248:65: error: template argument 1 is invalid
     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
                                                                 ^
/usr/include/c++/4.8/type_traits:1248:65: note: invalid template non-type parameter
/usr/include/c++/4.8/type_traits:1252:32: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
                                ^
/usr/include/c++/4.8/type_traits:1252:32: error: 'size_t' is not a member of 'std'
/usr/include/c++/4.8/type_traits:1252:65: error: template argument 1 is invalid
     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
                                                                 ^
/usr/include/c++/4.8/type_traits:1252:65: note: invalid template non-type parameter
/usr/include/c++/4.8/type_traits:1257:32: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t, 0> { };
                                ^
/usr/include/c++/4.8/type_traits:1257:32: error: 'size_t' is not a member of 'std'
/usr/include/c++/4.8/type_traits:1257:46: error: template argument 1 is invalid
     : public integral_constant<std::size_t, 0> { };
                                              ^
/usr/include/c++/4.8/type_traits:1257:46: note: invalid template non-type parameter
/usr/include/c++/4.8/type_traits:1259:47: error: 'std::size_t' has not been declared
   template<typename _Tp, unsigned _Uint, std::size_t _Size>
                                               ^
/usr/include/c++/4.8/type_traits:1261:32: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t,
                                ^
/usr/include/c++/4.8/type_traits:1261:32: error: 'size_t' is not a member of 'std'
/usr/include/c++/4.8/type_traits:1263:28: error: template argument 1 is invalid
           _Uint - 1>::value>
                            ^
/usr/include/c++/4.8/type_traits:1263:28: note: invalid template non-type parameter
/usr/include/c++/4.8/type_traits:1268:32: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t,
                                ^
/usr/include/c++/4.8/type_traits:1268:32: error: 'size_t' is not a member of 'std'
/usr/include/c++/4.8/type_traits:1270:31: error: template argument 1 is invalid
              _Uint - 1>::value>
                               ^
/usr/include/c++/4.8/type_traits:1270:31: note: invalid template non-type parameter
/usr/include/c++/4.8/type_traits:1627:31: error: 'std::size_t' has not been declared
   template<typename _Tp, std::size_t _Size>
                               ^
/usr/include/c++/4.8/type_traits:1640:31: error: 'std::size_t' has not been declared
   template<typename _Tp, std::size_t _Size>
                               ^
/usr/include/c++/4.8/type_traits:1671:17: error: 'std::size_t' has not been declared
   template<std::size_t _Len>
                 ^
/usr/include/c++/4.8/type_traits:1691:17: error: 'std::size_t' has not been declared
   template<std::size_t _Len, std::size_t _Align =
                 ^
/usr/include/c++/4.8/type_traits:1691:35: error: 'std::size_t' has not been declared
   template<std::size_t _Len, std::size_t _Align =
                                   ^
In file included from /usr/include/c++/4.8/bits/stl_pair.h:59:0,
                 from /usr/include/c++/4.8/utility:70,
                 from /usr/include/c++/4.8/algorithm:60,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/move.h:183:26: error: 'size_t' has not been declared
   template<typename _Tp, size_t _Nm>
                          ^
/usr/include/c++/4.8/bits/move.h: In function 'void std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])':
/usr/include/c++/4.8/bits/move.h:190:12: error: 'size_t' was not declared in this scope
       for (size_t __n = 0; __n < _Nm; ++__n)
            ^
/usr/include/c++/4.8/bits/move.h:190:19: error: expected ';' before '__n'
       for (size_t __n = 0; __n < _Nm; ++__n)
                   ^
/usr/include/c++/4.8/bits/move.h:190:28: error: '__n' was not declared in this scope
       for (size_t __n = 0; __n < _Nm; ++__n)
                            ^
In file included from /usr/include/c++/4.8/utility:70:0,
                 from /usr/include/c++/4.8/algorithm:60,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/stl_pair.h: At global scope:
/usr/include/c++/4.8/bits/stl_pair.h:85:17: error: 'std::size_t' has not been declared
   template<std::size_t...>
                 ^
/usr/include/c++/4.8/bits/stl_pair.h:204:41: error: 'std::size_t' has not been declared
       template<typename... _Args1, std::size_t... _Indexes1,
                                         ^
/usr/include/c++/4.8/bits/stl_pair.h:205:41: error: 'std::size_t' has not been declared
                typename... _Args2, std::size_t... _Indexes2>
                                         ^
In file included from /usr/include/c++/4.8/utility:74:0,
                 from /usr/include/c++/4.8/algorithm:60,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/initializer_list:53:15: error: 'size_t' does not name a type
       typedef size_t   size_type;
               ^
/usr/include/c++/4.8/initializer_list:59:7: error: 'size_type' does not name a type
       size_type   _M_len;
       ^
/usr/include/c++/4.8/initializer_list:62:54: error: 'size_type' has not been declared
       constexpr initializer_list(const_iterator __a, size_type __l)
                                                      ^
/usr/include/c++/4.8/initializer_list:70:17: error: 'size_type' does not name a type
       constexpr size_type
                 ^
/usr/include/c++/4.8/initializer_list: In constructor 'constexpr std::initializer_list<_E>::initializer_list(std::initializer_list<_E>::const_iterator, int)':
/usr/include/c++/4.8/initializer_list:63:24: error: class 'std::initializer_list<_E>' does not have any field named '_M_len'
       : _M_array(__a), _M_len(__l) { }
                        ^
/usr/include/c++/4.8/initializer_list: In constructor 'constexpr std::initializer_list<_E>::initializer_list()':
/usr/include/c++/4.8/initializer_list:67:22: error: class 'std::initializer_list<_E>' does not have any field named '_M_len'
       : _M_array(0), _M_len(0) { }
                      ^
/usr/include/c++/4.8/initializer_list: In member function 'constexpr const _E* std::initializer_list<_E>::end() const':
/usr/include/c++/4.8/initializer_list:79:52: error: there are no arguments to 'size' that depend on a template parameter, so a declaration of 'size' must be available [-fpermissive]
       end() const noexcept { return begin() + size(); }
                                                    ^
/usr/include/c++/4.8/initializer_list:79:52: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
In file included from /usr/include/c++/4.8/algorithm:60:0,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/utility: At global scope:
/usr/include/c++/4.8/utility:83:17: error: 'std::size_t' has not been declared
   template<std::size_t _Int, class _Tp>
                 ^
/usr/include/c++/4.8/utility:89:32: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t, 2> { };
                                ^
/usr/include/c++/4.8/utility:89:32: error: 'size_t' is not a member of 'std'
/usr/include/c++/4.8/utility:89:46: error: template argument 1 is invalid
     : public integral_constant<std::size_t, 2> { };
                                              ^
/usr/include/c++/4.8/utility:89:46: note: invalid template non-type parameter
/usr/include/c++/4.8/utility:99:17: error: 'std::size_t' has not been declared
   template<std::size_t _Int>
                 ^
/usr/include/c++/4.8/utility:140:17: error: 'std::size_t' has not been declared
   template<std::size_t _Int, class _Tp1, class _Tp2>
                 ^
/usr/include/c++/4.8/utility:145:17: error: 'std::size_t' has not been declared
   template<std::size_t _Int, class _Tp1, class _Tp2>
                 ^
/usr/include/c++/4.8/utility:150:17: error: 'std::size_t' has not been declared
   template<std::size_t _Int, class _Tp1, class _Tp2>
                 ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:65:0,
                 from /usr/include/c++/4.8/algorithm:61,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:116:67: error: expected type-specifier before 'ptrdiff_t'
   template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
                                                                   ^
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:116:67: error: expected '>' before 'ptrdiff_t'
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:127:15: error: '_Pointer' does not name a type
       typedef _Pointer   pointer;
               ^
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:129:15: error: '_Reference' does not name a type
       typedef _Reference reference;
               ^
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:179:15: error: 'ptrdiff_t' does not name a type
       typedef ptrdiff_t                   difference_type;
               ^
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:190:15: error: 'ptrdiff_t' does not name a type
       typedef ptrdiff_t                   difference_type;
               ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/4.8/algorithm:61,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/stl_iterator.h:101:69: error: wrong number of template arguments (5, should be 3)
                       typename iterator_traits<_Iterator>::reference>
                                                                     ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:65:0,
                 from /usr/include/c++/4.8/algorithm:61,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:118:12: error: provided for 'template<class _Category, class _Tp, class _Distance> struct std::iterator'
     struct iterator
            ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/4.8/algorithm:61,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/stl_iterator.h:403:66: error: wrong number of template arguments (5, should be 3)
     : public iterator<output_iterator_tag, void, void, void, void>
                                                                  ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:65:0,
                 from /usr/include/c++/4.8/algorithm:61,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:118:12: error: provided for 'template<class _Category, class _Tp, class _Distance> struct std::iterator'
     struct iterator
            ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/4.8/algorithm:61,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/stl_iterator.h:494:66: error: wrong number of template arguments (5, should be 3)
     : public iterator<output_iterator_tag, void, void, void, void>
                                                                  ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:65:0,
                 from /usr/include/c++/4.8/algorithm:61,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:118:12: error: provided for 'template<class _Category, class _Tp, class _Distance> struct std::iterator'
     struct iterator
            ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/4.8/algorithm:61,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/stl_iterator.h:588:66: error: wrong number of template arguments (5, should be 3)
     : public iterator<output_iterator_tag, void, void, void, void>
                                                                  ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:65:0,
                 from /usr/include/c++/4.8/algorithm:61,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/stl_iterator_base_types.h:118:12: error: provided for 'template<class _Category, class _Tp, class _Distance> struct std::iterator'
     struct iterator
            ^
In file included from /usr/include/c++/4.8/algorithm:61:0,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/stl_algobase.h: In static member function 'static _Tp* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(const _Tp*, const _Tp*, _Tp*)':
/usr/include/c++/4.8/bits/stl_algobase.h:370:10: error: 'ptrdiff_t' does not name a type
    const ptrdiff_t _Num = __last - __first;
          ^
/usr/include/c++/4.8/bits/stl_algobase.h:371:8: error: '_Num' was not declared in this scope
    if (_Num)
        ^
/usr/include/c++/4.8/bits/stl_algobase.h:373:22: error: '_Num' was not declared in this scope
    return __result + _Num;
                      ^
/usr/include/c++/4.8/bits/stl_algobase.h: In static member function 'static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*)':
/usr/include/c++/4.8/bits/stl_algobase.h:565:10: error: 'ptrdiff_t' does not name a type
    const ptrdiff_t _Num = __last - __first;
          ^
/usr/include/c++/4.8/bits/stl_algobase.h:566:8: error: '_Num' was not declared in this scope
    if (_Num)
        ^
/usr/include/c++/4.8/bits/stl_algobase.h:568:22: error: '_Num' was not declared in this scope
    return __result - _Num;
                      ^
/usr/include/c++/4.8/bits/stl_algobase.h: In static member function 'static bool std::__lexicographical_compare<true>::__lc(const _Tp*, const _Tp*, const _Up*, const _Up*)':
/usr/include/c++/4.8/bits/stl_algobase.h:904:10: error: 'size_t' does not name a type
    const size_t __len1 = __last1 - __first1;
          ^
/usr/include/c++/4.8/bits/stl_algobase.h:905:10: error: 'size_t' does not name a type
    const size_t __len2 = __last2 - __first2;
          ^
/usr/include/c++/4.8/bits/stl_algobase.h:907:16: error: '__len1' was not declared in this scope
       std::min(__len1, __len2));
                ^
/usr/include/c++/4.8/bits/stl_algobase.h:907:24: error: '__len2' was not declared in this scope
       std::min(__len1, __len2));
                        ^
In file included from /usr/include/c++/4.8/exception:152:0,
                 from /usr/include/c++/4.8/new:40,
                 from /usr/include/c++/4.8/bits/stl_construct.h:59,
                 from /usr/include/c++/4.8/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/4.8/bits/stl_algo.h:62,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/exception_ptr.h: At global scope:
/usr/include/c++/4.8/bits/exception_ptr.h:95:30: error: field 'nullptr_t' has incomplete type
       exception_ptr(nullptr_t) noexcept
                              ^
/usr/include/c++/4.8/bits/exception_ptr.h:95:30: error: expected ';' at end of member declaration
/usr/include/c++/4.8/bits/exception_ptr.h:95:32: error: expected unqualified-id before 'noexcept'
       exception_ptr(nullptr_t) noexcept
                                ^
In file included from /usr/include/c++/4.8/bits/stl_construct.h:59:0,
                 from /usr/include/c++/4.8/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/4.8/bits/stl_algo.h:62,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/new:91:31: error: declaration of 'operator new' as non-function
 void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
                               ^
/usr/include/c++/4.8/new:91:20: error: 'size_t' is not a member of 'std'
 void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
                    ^
/usr/include/c++/4.8/new:91:20: note: suggested alternative:
In file included from /usr/include/stdlib.h:32:0,
                 from /usr/include/c++/4.8/cstdlib:72,
                 from /usr/include/c++/4.8/bits/stl_algo.h:59,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^
In file included from /usr/include/c++/4.8/bits/stl_construct.h:59:0,
                 from /usr/include/c++/4.8/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/4.8/bits/stl_algo.h:62,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/new:93:33: error: declaration of 'operator new []' as non-function
 void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
                                 ^
/usr/include/c++/4.8/new:93:22: error: 'size_t' is not a member of 'std'
 void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
                      ^
/usr/include/c++/4.8/new:93:22: note: suggested alternative:
In file included from /usr/include/stdlib.h:32:0,
                 from /usr/include/c++/4.8/cstdlib:72,
                 from /usr/include/c++/4.8/bits/stl_algo.h:59,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^
In file included from /usr/include/c++/4.8/bits/stl_construct.h:59:0,
                 from /usr/include/c++/4.8/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/4.8/bits/stl_algo.h:62,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/new:99:25: error: declaration of 'operator new' as non-function
 void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                         ^
/usr/include/c++/4.8/new:99:20: error: 'size_t' is not a member of 'std'
 void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                    ^
/usr/include/c++/4.8/new:99:20: note: suggested alternative:
In file included from /usr/include/stdlib.h:32:0,
                 from /usr/include/c++/4.8/cstdlib:72,
                 from /usr/include/c++/4.8/bits/stl_algo.h:59,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^
In file included from /usr/include/c++/4.8/bits/stl_construct.h:59:0,
                 from /usr/include/c++/4.8/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/4.8/bits/stl_algo.h:62,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/new:99:33: error: expected primary-expression before 'const'
 void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                                 ^
/usr/include/c++/4.8/new:101:27: error: declaration of 'operator new []' as non-function
 void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                           ^
/usr/include/c++/4.8/new:101:22: error: 'size_t' is not a member of 'std'
 void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                      ^
/usr/include/c++/4.8/new:101:22: note: suggested alternative:
In file included from /usr/include/stdlib.h:32:0,
                 from /usr/include/c++/4.8/cstdlib:72,
                 from /usr/include/c++/4.8/bits/stl_algo.h:59,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^
In file included from /usr/include/c++/4.8/bits/stl_construct.h:59:0,
                 from /usr/include/c++/4.8/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/4.8/bits/stl_algo.h:62,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/new:101:35: error: expected primary-expression before 'const'
 void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                                   ^
/usr/include/c++/4.8/new:109:32: error: declaration of 'operator new' as non-function
 inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
                                ^
/usr/include/c++/4.8/new:109:27: error: 'size_t' is not a member of 'std'
 inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
                           ^
/usr/include/c++/4.8/new:109:27: note: suggested alternative:
In file included from /usr/include/stdlib.h:32:0,
                 from /usr/include/c++/4.8/cstdlib:72,
                 from /usr/include/c++/4.8/bits/stl_algo.h:59,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^
In file included from /usr/include/c++/4.8/bits/stl_construct.h:59:0,
                 from /usr/include/c++/4.8/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/4.8/bits/stl_algo.h:62,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/new:109:40: error: expected primary-expression before 'void'
 inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
                                        ^
/usr/include/c++/4.8/new:111:34: error: declaration of 'operator new []' as non-function
 inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
                                  ^
/usr/include/c++/4.8/new:111:29: error: 'size_t' is not a member of 'std'
 inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
                             ^
/usr/include/c++/4.8/new:111:29: note: suggested alternative:
In file included from /usr/include/stdlib.h:32:0,
                 from /usr/include/c++/4.8/cstdlib:72,
                 from /usr/include/c++/4.8/bits/stl_algo.h:59,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^
In file included from /usr/include/c++/4.8/bits/stl_construct.h:59:0,
                 from /usr/include/c++/4.8/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/4.8/bits/stl_algo.h:62,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/new:111:42: error: expected primary-expression before 'void'
 inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
                                          ^
In file included from /usr/include/c++/4.8/bits/alloc_traits.h:36:0,
                 from /usr/include/c++/4.8/ext/alloc_traits.h:36,
                 from /usr/include/c++/4.8/bits/stl_construct.h:61,
                 from /usr/include/c++/4.8/bits/stl_tempbuf.h:60,
                 from /usr/include/c++/4.8/bits/stl_algo.h:62,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/ptr_traits.h:69:15: error: 'ptrdiff_t' does not name a type
       typedef ptrdiff_t __type;
               ^
/usr/include/c++/4.8/bits/ptr_traits.h:162:15: error: 'ptrdiff_t' does not name a type
       typedef ptrdiff_t difference_type;
               ^
In file included from /usr/include/c++/4.8/bits/stl_algo.h:62:0,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/stl_tempbuf.h:84:16: error: 'ptrdiff_t' was not declared in this scope
     pair<_Tp*, ptrdiff_t>
                ^
/usr/include/c++/4.8/bits/stl_tempbuf.h:84:25: error: template argument 2 is invalid
     pair<_Tp*, ptrdiff_t>
                         ^
/usr/include/c++/4.8/bits/stl_tempbuf.h:85:25: error: invalid type in declaration before '(' token
     get_temporary_buffer(ptrdiff_t __len) _GLIBCXX_NOEXCEPT
                         ^
/usr/include/c++/4.8/bits/stl_tempbuf.h:85:25: error: template declaration of 'int std::get_temporary_buffer'
/usr/include/c++/4.8/bits/stl_tempbuf.h:85:26: error: 'ptrdiff_t' was not declared in this scope
     get_temporary_buffer(ptrdiff_t __len) _GLIBCXX_NOEXCEPT
                          ^
/usr/include/c++/4.8/bits/stl_tempbuf.h:131:15: error: 'ptrdiff_t' does not name a type
       typedef ptrdiff_t   size_type;
               ^
/usr/include/c++/4.8/bits/stl_tempbuf.h:134:7: error: 'size_type' does not name a type
       size_type  _M_original_len;
       ^
/usr/include/c++/4.8/bits/stl_tempbuf.h:135:7: error: 'size_type' does not name a type
       size_type  _M_len;
       ^
/usr/include/c++/4.8/bits/stl_tempbuf.h:140:7: error: 'size_type' does not name a type
       size_type
       ^
/usr/include/c++/4.8/bits/stl_tempbuf.h:145:7: error: 'size_type' does not name a type
       size_type
       ^
/usr/include/c++/4.8/bits/stl_tempbuf.h: In member function 'std::_Temporary_buffer<_ForwardIterator, _Tp>::value_type* std::_Temporary_buffer<_ForwardIterator, _Tp>::end()':
/usr/include/c++/4.8/bits/stl_tempbuf.h:157:28: error: '_M_len' was not declared in this scope
       { return _M_buffer + _M_len; }
                            ^
/usr/include/c++/4.8/bits/stl_tempbuf.h: In destructor 'std::_Temporary_buffer<_ForwardIterator, _Tp>::~_Temporary_buffer()':
/usr/include/c++/4.8/bits/stl_tempbuf.h:167:39: error: '_M_len' was not declared in this scope
  std::_Destroy(_M_buffer, _M_buffer + _M_len);
                                       ^
/usr/include/c++/4.8/bits/stl_tempbuf.h: In constructor 'std::_Temporary_buffer<_ForwardIterator, _Tp>::_Temporary_buffer(_ForwardIterator, _ForwardIterator)':
/usr/include/c++/4.8/bits/stl_tempbuf.h:245:7: error: class 'std::_Temporary_buffer<_ForwardIterator, _Tp>' does not have any field named '_M_original_len'
     : _M_original_len(std::distance(__first, __last)),
       ^
/usr/include/c++/4.8/bits/stl_tempbuf.h:246:7: error: class 'std::_Temporary_buffer<_ForwardIterator, _Tp>' does not have any field named '_M_len'
       _M_len(0), _M_buffer(0)
       ^
/usr/include/c++/4.8/bits/stl_tempbuf.h:250:23: error: 'size_type' was not declared in this scope
    std::pair<pointer, size_type> __p(std::get_temporary_buffer<
                       ^
/usr/include/c++/4.8/bits/stl_tempbuf.h:250:32: error: template argument 2 is invalid
    std::pair<pointer, size_type> __p(std::get_temporary_buffer<
                                ^
/usr/include/c++/4.8/bits/stl_tempbuf.h:250:37: error: invalid type in declaration before '(' token
    std::pair<pointer, size_type> __p(std::get_temporary_buffer<
                                     ^
/usr/include/c++/4.8/bits/stl_tempbuf.h:250:38: error: 'get_temporary_buffer' is not a member of 'std'
    std::pair<pointer, size_type> __p(std::get_temporary_buffer<
                                      ^
/usr/include/c++/4.8/bits/stl_tempbuf.h:251:20: error: expected primary-expression before '>' token
          value_type>(_M_original_len));
                    ^
/usr/include/c++/4.8/bits/stl_tempbuf.h:251:22: error: '_M_original_len' was not declared in this scope
          value_type>(_M_original_len));
                      ^
/usr/include/c++/4.8/bits/stl_tempbuf.h:252:20: error: request for member 'first' in '__p', which is of non-class type 'int'
    _M_buffer = __p.first;
                    ^
/usr/include/c++/4.8/bits/stl_tempbuf.h:253:4: error: '_M_len' was not declared in this scope
    _M_len = __p.second;
    ^
/usr/include/c++/4.8/bits/stl_tempbuf.h:253:17: error: request for member 'second' in '__p', which is of non-class type 'int'
    _M_len = __p.second;
                 ^
/usr/include/c++/4.8/bits/stl_tempbuf.h:262:4: error: '_M_len' was not declared in this scope
    _M_len = 0;
    ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:40:0,
                 from /usr/include/c++/4.8/string:40,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/postypes.h: At global scope:
/usr/include/c++/4.8/bits/postypes.h:98:11: error: 'ptrdiff_t' does not name a type
   typedef ptrdiff_t streamsize; // Signed integral type
           ^
In file included from /usr/include/c++/4.8/string:40:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/char_traits.h:104:66: error: 'std::size_t' has not been declared
       compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
                                                                  ^
/usr/include/c++/4.8/bits/char_traits.h:106:14: error: 'size_t' in namespace 'std' does not name a type
       static std::size_t
              ^
/usr/include/c++/4.8/bits/char_traits.h:110:39: error: 'std::size_t' has not been declared
       find(const char_type* __s, std::size_t __n, const char_type& __a);
                                       ^
/usr/include/c++/4.8/bits/char_traits.h:113:57: error: 'std::size_t' has not been declared
       move(char_type* __s1, const char_type* __s2, std::size_t __n);
                                                         ^
/usr/include/c++/4.8/bits/char_traits.h:116:57: error: 'std::size_t' has not been declared
       copy(char_type* __s1, const char_type* __s2, std::size_t __n);
                                                         ^
/usr/include/c++/4.8/bits/char_traits.h:119:35: error: 'std::size_t' has not been declared
       assign(char_type* __s, std::size_t __n, char_type __a);
                                   ^
/usr/include/c++/4.8/bits/char_traits.h:145:64: error: 'std::size_t' has not been declared
     compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
                                                                ^
/usr/include/c++/4.8/bits/char_traits.h: In static member function 'static int __gnu_cxx::char_traits<_CharT>::compare(const char_type*, const char_type*, int)':
/usr/include/c++/4.8/bits/char_traits.h:147:12: error: 'size_t' is not a member of 'std'
       for (std::size_t __i = 0; __i < __n; ++__i)
            ^
/usr/include/c++/4.8/bits/char_traits.h:147:12: note: suggested alternative:
In file included from /usr/include/stdlib.h:32:0,
                 from /usr/include/c++/4.8/cstdlib:72,
                 from /usr/include/c++/4.8/bits/stl_algo.h:59,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^
In file included from /usr/include/c++/4.8/string:40:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/char_traits.h:147:24: error: expected ';' before '__i'
       for (std::size_t __i = 0; __i < __n; ++__i)
                        ^
/usr/include/c++/4.8/bits/char_traits.h:147:33: error: '__i' was not declared in this scope
       for (std::size_t __i = 0; __i < __n; ++__i)
                                 ^
/usr/include/c++/4.8/bits/char_traits.h: At global scope:
/usr/include/c++/4.8/bits/char_traits.h:156:5: error: 'size_t' in namespace 'std' does not name a type
     std::size_t
     ^
/usr/include/c++/4.8/bits/char_traits.h:169:37: error: 'std::size_t' has not been declared
     find(const char_type* __s, std::size_t __n, const char_type& __a)
                                     ^
/usr/include/c++/4.8/bits/char_traits.h: In static member function 'static const char_type* __gnu_cxx::char_traits<_CharT>::find(const char_type*, int, const char_type&)':
/usr/include/c++/4.8/bits/char_traits.h:171:12: error: 'size_t' is not a member of 'std'
       for (std::size_t __i = 0; __i < __n; ++__i)
            ^
/usr/include/c++/4.8/bits/char_traits.h:171:12: note: suggested alternative:
In file included from /usr/include/stdlib.h:32:0,
                 from /usr/include/c++/4.8/cstdlib:72,
                 from /usr/include/c++/4.8/bits/stl_algo.h:59,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/lib/gcc/i686-linux-gnu/4.8/include/stddef.h:212:23: note:   'size_t'
 typedef __SIZE_TYPE__ size_t;
                       ^
In file included from /usr/include/c++/4.8/string:40:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/char_traits.h:171:24: error: expected ';' before '__i'
       for (std::size_t __i = 0; __i < __n; ++__i)
                        ^
/usr/include/c++/4.8/bits/char_traits.h:171:33: error: '__i' was not declared in this scope
       for (std::size_t __i = 0; __i < __n; ++__i)
                                 ^
/usr/include/c++/4.8/bits/char_traits.h: At global scope:
/usr/include/c++/4.8/bits/char_traits.h:180:55: error: 'std::size_t' has not been declared
     move(char_type* __s1, const char_type* __s2, std::size_t __n)
                                                       ^
/usr/include/c++/4.8/bits/char_traits.h:189:55: error: 'std::size_t' has not been declared
     copy(char_type* __s1, const char_type* __s2, std::size_t __n)
                                                       ^
/usr/include/c++/4.8/bits/char_traits.h:199:33: error: 'std::size_t' has not been declared
     assign(char_type* __s, std::size_t __n, char_type __a)
                                 ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/c++allocator.h:33:0,
                 from /usr/include/c++/4.8/bits/allocator.h:46,
                 from /usr/include/c++/4.8/string:41,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/ext/new_allocator.h:44:14: error: 'std::size_t' has not been declared
   using std::size_t;
              ^
/usr/include/c++/4.8/ext/new_allocator.h:45:14: error: 'std::ptrdiff_t' has not been declared
   using std::ptrdiff_t;
              ^
/usr/include/c++/4.8/ext/new_allocator.h:62:15: error: 'ptrdiff_t' does not name a type
       typedef ptrdiff_t  difference_type;
               ^
In file included from /usr/include/c++/4.8/string:41:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/allocator.h:67:15: error: 'ptrdiff_t' does not name a type
       typedef ptrdiff_t   difference_type;
               ^
/usr/include/c++/4.8/bits/allocator.h:96:15: error: 'ptrdiff_t' does not name a type
       typedef ptrdiff_t  difference_type;
               ^
In file included from /usr/include/c++/4.8/string:44:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/ostream_insert.h:45:26: error: 'streamsize' has not been declared
       const _CharT* __s, streamsize __n)
                          ^
/usr/include/c++/4.8/bits/ostream_insert.h: In function 'void std::__ostream_write(std::basic_ostream<_CharT, _Traits>&, const _CharT*, int)':
/usr/include/c++/4.8/bits/ostream_insert.h:50:13: error: 'streamsize' does not name a type
       const streamsize __put = __out.rdbuf()->sputn(__s, __n);
             ^
/usr/include/c++/4.8/bits/ostream_insert.h:51:11: error: '__put' was not declared in this scope
       if (__put != __n)
           ^
/usr/include/c++/4.8/bits/ostream_insert.h: At global scope:
/usr/include/c++/4.8/bits/ostream_insert.h:57:59: error: 'streamsize' has not been declared
     __ostream_fill(basic_ostream<_CharT, _Traits>& __out, streamsize __n)
                                                           ^
/usr/include/c++/4.8/bits/ostream_insert.h:77:27: error: 'streamsize' has not been declared
        const _CharT* __s, streamsize __n)
                           ^
/usr/include/c++/4.8/bits/ostream_insert.h: In function 'std::basic_ostream<_CharT, _Traits>& std::__ostream_insert(std::basic_ostream<_CharT, _Traits>&, const _CharT*, int)':
/usr/include/c++/4.8/bits/ostream_insert.h:87:14: error: 'streamsize' does not name a type
        const streamsize __w = __out.width();
              ^
/usr/include/c++/4.8/bits/ostream_insert.h:88:12: error: '__w' was not declared in this scope
        if (__w > __n)
            ^
/usr/include/c++/4.8/bits/ostream_insert.h: At global scope:
/usr/include/c++/4.8/bits/ostream_insert.h:118:68: error: 'streamsize' has not been declared
   extern template ostream& __ostream_insert(ostream&, const char*, streamsize);
                                                                    ^
/usr/include/c++/4.8/bits/ostream_insert.h:122:11: error: 'streamsize' has not been declared
           streamsize);
           ^
In file included from /usr/include/c++/4.8/bits/basic_string.h:2815:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/ext/string_conversions.h:55:51: error: 'std::size_t' has not been declared
     const char* __name, const _CharT* __str, std::size_t* __idx,
                                                   ^
/usr/include/c++/4.8/ext/string_conversions.h:83:48: error: 'std::size_t' has not been declared
     __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
                                                ^
/usr/include/c++/4.8/ext/string_conversions.h:84:31: error: 'std::size_t' has not been declared
      __builtin_va_list), std::size_t __n,
                               ^
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/basic_string.h: In instantiation of 'class std::basic_string<char>':
/usr/include/c++/4.8/bits/basic_string.h:2824:68:   required from here
/usr/include/c++/4.8/bits/basic_string.h:122:61: error: no type named 'difference_type' in 'std::basic_string<char>::_CharT_alloc_type {aka class std::allocator<char>}'
       typedef typename _CharT_alloc_type::difference_type   difference_type;
                                                             ^
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/basic_string.h: In function 'int std::stoi(const string&, size_t*, int)':
/usr/include/c++/4.8/bits/basic_string.h:2825:19: error: no matching function for call to '__stoa(long int (*)(const char*, char**, int)throw (), const char [5], const char*, size_t*&, int&)'
      __idx, __base); }
                   ^
/usr/include/c++/4.8/bits/basic_string.h:2825:19: note: candidate is:
In file included from /usr/include/c++/4.8/bits/basic_string.h:2815:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/ext/string_conversions.h:54:5: note: template<class _TRet, class _Ret, class _CharT, class ... _Base> _Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, int*, _Base ...)
     __stoa(_TRet (*__convf) (const _CharT*, _CharT**, _Base...),
     ^
/usr/include/c++/4.8/ext/string_conversions.h:54:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/basic_string.h:2825:19: note:   cannot convert '__idx' (type 'size_t* {aka unsigned int*}') to type 'int*'
      __idx, __base); }
                   ^
/usr/include/c++/4.8/bits/basic_string.h: In function 'long int std::stol(const string&, size_t*, int)':
/usr/include/c++/4.8/bits/basic_string.h:2830:22: error: no matching function for call to '__stoa(long int (*)(const char*, char**, int)throw (), const char [5], const char*, size_t*&, int&)'
         __idx, __base); }
                      ^
/usr/include/c++/4.8/bits/basic_string.h:2830:22: note: candidate is:
In file included from /usr/include/c++/4.8/bits/basic_string.h:2815:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/ext/string_conversions.h:54:5: note: template<class _TRet, class _Ret, class _CharT, class ... _Base> _Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, int*, _Base ...)
     __stoa(_TRet (*__convf) (const _CharT*, _CharT**, _Base...),
     ^
/usr/include/c++/4.8/ext/string_conversions.h:54:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/basic_string.h:2830:22: note:   cannot convert '__idx' (type 'size_t* {aka unsigned int*}') to type 'int*'
         __idx, __base); }
                      ^
/usr/include/c++/4.8/bits/basic_string.h: In function 'long unsigned int std::stoul(const string&, size_t*, int)':
/usr/include/c++/4.8/bits/basic_string.h:2835:22: error: no matching function for call to '__stoa(long unsigned int (*)(const char*, char**, int)throw (), const char [6], const char*, size_t*&, int&)'
         __idx, __base); }
                      ^
/usr/include/c++/4.8/bits/basic_string.h:2835:22: note: candidate is:
In file included from /usr/include/c++/4.8/bits/basic_string.h:2815:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/ext/string_conversions.h:54:5: note: template<class _TRet, class _Ret, class _CharT, class ... _Base> _Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, int*, _Base ...)
     __stoa(_TRet (*__convf) (const _CharT*, _CharT**, _Base...),
     ^
/usr/include/c++/4.8/ext/string_conversions.h:54:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/basic_string.h:2835:22: note:   cannot convert '__idx' (type 'size_t* {aka unsigned int*}') to type 'int*'
         __idx, __base); }
                      ^
/usr/include/c++/4.8/bits/basic_string.h: In function 'long long int std::stoll(const string&, size_t*, int)':
/usr/include/c++/4.8/bits/basic_string.h:2840:22: error: no matching function for call to '__stoa(long long int (*)(const char*, char**, int)throw (), const char [6], const char*, size_t*&, int&)'
         __idx, __base); }
                      ^
/usr/include/c++/4.8/bits/basic_string.h:2840:22: note: candidate is:
In file included from /usr/include/c++/4.8/bits/basic_string.h:2815:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/ext/string_conversions.h:54:5: note: template<class _TRet, class _Ret, class _CharT, class ... _Base> _Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, int*, _Base ...)
     __stoa(_TRet (*__convf) (const _CharT*, _CharT**, _Base...),
     ^
/usr/include/c++/4.8/ext/string_conversions.h:54:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/basic_string.h:2840:22: note:   cannot convert '__idx' (type 'size_t* {aka unsigned int*}') to type 'int*'
         __idx, __base); }
                      ^
/usr/include/c++/4.8/bits/basic_string.h: In function 'long long unsigned int std::stoull(const string&, size_t*, int)':
/usr/include/c++/4.8/bits/basic_string.h:2845:22: error: no matching function for call to '__stoa(long long unsigned int (*)(const char*, char**, int)throw (), const char [7], const char*, size_t*&, int&)'
         __idx, __base); }
                      ^
/usr/include/c++/4.8/bits/basic_string.h:2845:22: note: candidate is:
In file included from /usr/include/c++/4.8/bits/basic_string.h:2815:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/ext/string_conversions.h:54:5: note: template<class _TRet, class _Ret, class _CharT, class ... _Base> _Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, int*, _Base ...)
     __stoa(_TRet (*__convf) (const _CharT*, _CharT**, _Base...),
     ^
/usr/include/c++/4.8/ext/string_conversions.h:54:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/basic_string.h:2845:22: note:   cannot convert '__idx' (type 'size_t* {aka unsigned int*}') to type 'int*'
         __idx, __base); }
                      ^
/usr/include/c++/4.8/bits/basic_string.h: In function 'float std::stof(const string&, size_t*)':
/usr/include/c++/4.8/bits/basic_string.h:2850:72: error: no matching function for call to '__stoa(float (*)(const char*, char**)throw (), const char [5], const char*, size_t*&)'
   { return __gnu_cxx::__stoa(&std::strtof, "stof", __str.c_str(), __idx); }
                                                                        ^
/usr/include/c++/4.8/bits/basic_string.h:2850:72: note: candidate is:
In file included from /usr/include/c++/4.8/bits/basic_string.h:2815:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/ext/string_conversions.h:54:5: note: template<class _TRet, class _Ret, class _CharT, class ... _Base> _Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, int*, _Base ...)
     __stoa(_TRet (*__convf) (const _CharT*, _CharT**, _Base...),
     ^
/usr/include/c++/4.8/ext/string_conversions.h:54:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/basic_string.h:2850:72: note:   cannot convert '__idx' (type 'size_t* {aka unsigned int*}') to type 'int*'
   { return __gnu_cxx::__stoa(&std::strtof, "stof", __str.c_str(), __idx); }
                                                                        ^
/usr/include/c++/4.8/bits/basic_string.h: In function 'double std::stod(const string&, size_t*)':
/usr/include/c++/4.8/bits/basic_string.h:2854:72: error: no matching function for call to '__stoa(double (*)(const char*, char**)throw (), const char [5], const char*, size_t*&)'
   { return __gnu_cxx::__stoa(&std::strtod, "stod", __str.c_str(), __idx); }
                                                                        ^
/usr/include/c++/4.8/bits/basic_string.h:2854:72: note: candidate is:
In file included from /usr/include/c++/4.8/bits/basic_string.h:2815:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/ext/string_conversions.h:54:5: note: template<class _TRet, class _Ret, class _CharT, class ... _Base> _Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, int*, _Base ...)
     __stoa(_TRet (*__convf) (const _CharT*, _CharT**, _Base...),
     ^
/usr/include/c++/4.8/ext/string_conversions.h:54:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/basic_string.h:2854:72: note:   cannot convert '__idx' (type 'size_t* {aka unsigned int*}') to type 'int*'
   { return __gnu_cxx::__stoa(&std::strtod, "stod", __str.c_str(), __idx); }
                                                                        ^
/usr/include/c++/4.8/bits/basic_string.h: In function 'long double std::stold(const string&, size_t*)':
/usr/include/c++/4.8/bits/basic_string.h:2858:74: error: no matching function for call to '__stoa(long double (*)(const char*, char**)throw (), const char [6], const char*, size_t*&)'
   { return __gnu_cxx::__stoa(&std::strtold, "stold", __str.c_str(), __idx); }
                                                                          ^
/usr/include/c++/4.8/bits/basic_string.h:2858:74: note: candidate is:
In file included from /usr/include/c++/4.8/bits/basic_string.h:2815:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/ext/string_conversions.h:54:5: note: template<class _TRet, class _Ret, class _CharT, class ... _Base> _Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, int*, _Base ...)
     __stoa(_TRet (*__convf) (const _CharT*, _CharT**, _Base...),
     ^
/usr/include/c++/4.8/ext/string_conversions.h:54:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/basic_string.h:2858:74: note:   cannot convert '__idx' (type 'size_t* {aka unsigned int*}') to type 'int*'
   { return __gnu_cxx::__stoa(&std::strtold, "stold", __str.c_str(), __idx); }
                                                                          ^
/usr/include/c++/4.8/bits/basic_string.h: In function 'std::string std::to_string(int)':
/usr/include/c++/4.8/bits/basic_string.h:2866:20: error: no matching function for call to '__to_xstring(int (*)(char*, size_t, const char*, __gnuc_va_list)throw (), unsigned int, const char [3], int&)'
         "%d", __val); }
                    ^
/usr/include/c++/4.8/bits/basic_string.h:2866:20: note: candidate is:
In file included from /usr/include/c++/4.8/bits/basic_string.h:2815:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/ext/string_conversions.h:83:5: note: template<class _String, class _CharT> _String __gnu_cxx::__to_xstring(int (*)(_CharT*, int, const _CharT*, char*), int, const _CharT*, ...)
     __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
     ^
/usr/include/c++/4.8/ext/string_conversions.h:83:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/basic_string.h:2866:20: note:   mismatched types 'int' and 'size_t {aka unsigned int}'
         "%d", __val); }
                    ^
/usr/include/c++/4.8/bits/basic_string.h: In function 'std::string std::to_string(unsigned int)':
/usr/include/c++/4.8/bits/basic_string.h:2872:20: error: no matching function for call to '__to_xstring(int (*)(char*, size_t, const char*, __gnuc_va_list)throw (), unsigned int, const char [3], unsigned int&)'
         "%u", __val); }
                    ^
/usr/include/c++/4.8/bits/basic_string.h:2872:20: note: candidate is:
In file included from /usr/include/c++/4.8/bits/basic_string.h:2815:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/ext/string_conversions.h:83:5: note: template<class _String, class _CharT> _String __gnu_cxx::__to_xstring(int (*)(_CharT*, int, const _CharT*, char*), int, const _CharT*, ...)
     __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
     ^
/usr/include/c++/4.8/ext/string_conversions.h:83:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/basic_string.h:2872:20: note:   mismatched types 'int' and 'size_t {aka unsigned int}'
         "%u", __val); }
                    ^
/usr/include/c++/4.8/bits/basic_string.h: In function 'std::string std::to_string(long int)':
/usr/include/c++/4.8/bits/basic_string.h:2877:21: error: no matching function for call to '__to_xstring(int (*)(char*, size_t, const char*, __gnuc_va_list)throw (), unsigned int, const char [4], long int&)'
         "%ld", __val); }
                     ^
/usr/include/c++/4.8/bits/basic_string.h:2877:21: note: candidate is:
In file included from /usr/include/c++/4.8/bits/basic_string.h:2815:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/ext/string_conversions.h:83:5: note: template<class _String, class _CharT> _String __gnu_cxx::__to_xstring(int (*)(_CharT*, int, const _CharT*, char*), int, const _CharT*, ...)
     __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
     ^
/usr/include/c++/4.8/ext/string_conversions.h:83:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/basic_string.h:2877:21: note:   mismatched types 'int' and 'size_t {aka unsigned int}'
         "%ld", __val); }
                     ^
/usr/include/c++/4.8/bits/basic_string.h: In function 'std::string std::to_string(long unsigned int)':
/usr/include/c++/4.8/bits/basic_string.h:2883:21: error: no matching function for call to '__to_xstring(int (*)(char*, size_t, const char*, __gnuc_va_list)throw (), unsigned int, const char [4], long unsigned int&)'
         "%lu", __val); }
                     ^
/usr/include/c++/4.8/bits/basic_string.h:2883:21: note: candidate is:
In file included from /usr/include/c++/4.8/bits/basic_string.h:2815:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/ext/string_conversions.h:83:5: note: template<class _String, class _CharT> _String __gnu_cxx::__to_xstring(int (*)(_CharT*, int, const _CharT*, char*), int, const _CharT*, ...)
     __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
     ^
/usr/include/c++/4.8/ext/string_conversions.h:83:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/basic_string.h:2883:21: note:   mismatched types 'int' and 'size_t {aka unsigned int}'
         "%lu", __val); }
                     ^
/usr/include/c++/4.8/bits/basic_string.h: In function 'std::string std::to_string(long long int)':
/usr/include/c++/4.8/bits/basic_string.h:2889:22: error: no matching function for call to '__to_xstring(int (*)(char*, size_t, const char*, __gnuc_va_list)throw (), unsigned int, const char [5], long long int&)'
         "%lld", __val); }
                      ^
/usr/include/c++/4.8/bits/basic_string.h:2889:22: note: candidate is:
In file included from /usr/include/c++/4.8/bits/basic_string.h:2815:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/ext/string_conversions.h:83:5: note: template<class _String, class _CharT> _String __gnu_cxx::__to_xstring(int (*)(_CharT*, int, const _CharT*, char*), int, const _CharT*, ...)
     __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
     ^
/usr/include/c++/4.8/ext/string_conversions.h:83:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/basic_string.h:2889:22: note:   mismatched types 'int' and 'size_t {aka unsigned int}'
         "%lld", __val); }
                      ^
/usr/include/c++/4.8/bits/basic_string.h: In function 'std::string std::to_string(long long unsigned int)':
/usr/include/c++/4.8/bits/basic_string.h:2895:22: error: no matching function for call to '__to_xstring(int (*)(char*, size_t, const char*, __gnuc_va_list)throw (), unsigned int, const char [5], long long unsigned int&)'
         "%llu", __val); }
                      ^
/usr/include/c++/4.8/bits/basic_string.h:2895:22: note: candidate is:
In file included from /usr/include/c++/4.8/bits/basic_string.h:2815:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/ext/string_conversions.h:83:5: note: template<class _String, class _CharT> _String __gnu_cxx::__to_xstring(int (*)(_CharT*, int, const _CharT*, char*), int, const _CharT*, ...)
     __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
     ^
/usr/include/c++/4.8/ext/string_conversions.h:83:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/string:52:0,
                 from /usr/include/c++/4.8/random:41,
                 from /usr/include/c++/4.8/bits/stl_algo.h:65,
                 from /usr/include/c++/4.8/algorithm:62,
                 from rucsac1.cpp:2:
/usr/include/c++/4.8/bits/basic_string.h:2895:22: note:   mismatched types 'int' and 

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 Rucsac1 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ă.