Detalii evaluare #49240144

Rezumat problemă

Se dă un șir de N numere întregi indexat de la 1. Să se afle suma maximă a unui subșir format din T elemente astfel încât oricare 2 elemente consecutive ale acestuia să se afle la distanță cel mult K în șirul dat (distanța dintre elementele de pe pozițiile i și j, i < j, este j - i).

Detalii

Problema best_sum2 Operații I/O tastatură/ecran
Limita timp 0.2 secunde Limita memorie Total: 8 MB / Stivă 2 MB
Id soluție #49240144 Utilizator Pop Iuliu-Daniel (tiwerlol)
Fișier best_sum2.cpp Dimensiune 1.07 KB
Data încărcării 21 Februarie 2024, 17:57 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

best_sum2.cpp: In function 'void solve()':
best_sum2.cpp:46:30: error: no match for 'operator+' (operand types are 'std::vector<long long int>' and 'int')
     cout << *max_element(dp1 + t, dp1 + n + 1);

                              ^
best_sum2.cpp:46:30: note: candidates are:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67: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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:333:5: note: template<class _Iterator> std::reverse_iterator<_Iterator> std::operator+(typename std::reverse_iterator<_Iterator>::difference_type, const std::reverse_iterator<_Iterator>&)
     operator+(typename reverse_iterator<_Iterator>::difference_type __n,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:333:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67: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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:1118:5: note: template<class _Iterator> std::move_iterator<_Iterator> std::operator+(typename std::move_iterator<_Iterator>::difference_type, const std::move_iterator<_Iterator>&)
     operator+(typename move_iterator<_Iterator>::difference_type __n,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:1118:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   mismatched types 'const std::move_iterator<_Iterator>' and 'int'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2365:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::basic_string<_CharT, _Traits, _Alloc>&, const std::basic_string<_CharT, _Traits, _Alloc>&)
     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2365:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   'std::vector<long long int>' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
In file included from /usr/include/c++/4.8/string:53: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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.tcc:692:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const _CharT*, const std::basic_string<_CharT, _Traits, _Alloc>&)
     operator+(const _CharT* __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.tcc:692:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   mismatched types 'const _CharT*' and 'std::vector<long long int>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
In file included from /usr/include/c++/4.8/string:53: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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.tcc:708:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(_CharT, const std::basic_string<_CharT, _Traits, _Alloc>&)
     operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs)
     ^
/usr/include/c++/4.8/bits/basic_string.tcc:708:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   mismatched types 'const std::basic_string<_CharT, _Traits, _Alloc>' and 'int'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2402:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2402:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   'std::vector<long long int>' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2418:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::basic_string<_CharT, _Traits, _Alloc>&, _CharT)
     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
     ^
/usr/include/c++/4.8/bits/basic_string.h:2418:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   'std::vector<long long int>' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2430:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::basic_string<_CharT, _Traits, _Alloc>&&, const std::basic_string<_CharT, _Traits, _Alloc>&)
     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2430:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   'std::vector<long long int>' is not derived from 'std::basic_string<_CharT, _Traits, _Alloc>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2436:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::basic_string<_CharT, _Traits, _Alloc>&, std::basic_string<_CharT, _Traits, _Alloc>&&)
     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2436:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   'std::vector<long long int>' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2442:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::basic_string<_CharT, _Traits, _Alloc>&&, std::basic_string<_CharT, _Traits, _Alloc>&&)
     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2442:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   'std::vector<long long int>' is not derived from 'std::basic_string<_CharT, _Traits, _Alloc>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2454:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>&&)
     operator+(const _CharT* __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2454:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   mismatched types 'const _CharT*' and 'std::vector<long long int>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2460:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(_CharT, std::basic_string<_CharT, _Traits, _Alloc>&&)
     operator+(_CharT __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2460:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   mismatched types 'std::basic_string<_CharT, _Traits, _Alloc>' and 'int'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2466:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::basic_string<_CharT, _Traits, _Alloc>&&, const _CharT*)
     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2466:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   'std::vector<long long int>' is not derived from 'std::basic_string<_CharT, _Traits, _Alloc>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2472:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::basic_string<_CharT, _Traits, _Alloc>&&, _CharT)
     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2472:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   'std::vector<long long int>' is not derived from 'std::basic_string<_CharT, _Traits, _Alloc>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
In file included from /usr/include/c++/4.8/ccomplex:38:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/complex:324:5: note: template<class _Tp> std::complex<_Tp> std::operator+(const std::complex<_Tp>&, const std::complex<_Tp>&)
     operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
     ^
/usr/include/c++/4.8/complex:324:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   'std::vector<long long int>' is not derived from 'const std::complex<_Tp>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
In file included from /usr/include/c++/4.8/ccomplex:38:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/complex:333:5: note: template<class _Tp> std::complex<_Tp> std::operator+(const std::complex<_Tp>&, const _Tp&)
     operator+(const complex<_Tp>& __x, const _Tp& __y)
     ^
/usr/include/c++/4.8/complex:333:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   'std::vector<long long int>' is not derived from 'const std::complex<_Tp>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
In file included from /usr/include/c++/4.8/ccomplex:38:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/complex:342:5: note: template<class _Tp> std::complex<_Tp> std::operator+(const _Tp&, const std::complex<_Tp>&)
     operator+(const _Tp& __x, const complex<_Tp>& __y)
     ^
/usr/include/c++/4.8/complex:342:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   mismatched types 'const std::complex<_Tp>' and 'int'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
In file included from /usr/include/c++/4.8/ccomplex:38:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/complex:443:5: note: template<class _Tp> std::complex<_Tp> std::operator+(const std::complex<_Tp>&)
     operator+(const complex<_Tp>& __x)
     ^
/usr/include/c++/4.8/complex:443:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   'std::vector<long long int>' is not derived from 'const std::complex<_Tp>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
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 /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/stl_bvector.h:293:3: note: std::_Bit_iterator std::operator+(std::ptrdiff_t, const std::_Bit_iterator&)
   operator+(ptrdiff_t __n, const _Bit_iterator& __x)
   ^
/usr/include/c++/4.8/bits/stl_bvector.h:293:3: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'std::ptrdiff_t {aka int}'
/usr/include/c++/4.8/bits/stl_bvector.h:379:3: note: std::_Bit_const_iterator std::operator+(std::ptrdiff_t, const std::_Bit_const_iterator&)
   operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
   ^
/usr/include/c++/4.8/bits/stl_bvector.h:379:3: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'std::ptrdiff_t {aka int}'
In file included from /usr/include/c++/4.8/deque:64:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:67,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/stl_deque.h:354:5: note: template<class _Tp, class _Ref, class _Ptr> std::_Deque_iterator<_Tp, _Ref, _Ptr> std::operator+(std::ptrdiff_t, const std::_Deque_iterator<_Tp, _Ref, _Ptr>&)
     operator+(ptrdiff_t __n, const _Deque_iterator<_Tp, _Ref, _Ptr>& __x)
     ^
/usr/include/c++/4.8/bits/stl_deque.h:354:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   cannot convert 'dp1' (type 'std::vector<long long int>') to type 'std::ptrdiff_t {aka int}'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
In file included from /usr/include/c++/4.8/valarray:587:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note: template<class _Dom1, class _Dom2> std::_Expr<std::_BinClos<std::__plus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__plus, typename _Dom1::value_type>::result_type> std::operator+(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&)
     _DEFINE_EXPR_BINARY_OPERATOR(+, __plus)
     ^
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   'std::vector<long long int>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
In file included from /usr/include/c++/4.8/valarray:587:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__plus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__plus, typename _Dom1::value_type>::result_type> std::operator+(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)
     _DEFINE_EXPR_BINARY_OPERATOR(+, __plus)
     ^
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   'std::vector<long long int>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
In file included from /usr/include/c++/4.8/valarray:587:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__plus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__plus, typename _Dom1::value_type>::result_type> std::operator+(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&)
     _DEFINE_EXPR_BINARY_OPERATOR(+, __plus)
     ^
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
In file included from /usr/include/c++/4.8/valarray:587:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__plus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__plus, typename _Dom1::value_type>::result_type> std::operator+(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _Dom::value_type>&)
     _DEFINE_EXPR_BINARY_OPERATOR(+, __plus)
     ^
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   'std::vector<long long int>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
In file included from /usr/include/c++/4.8/valarray:587:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__plus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__plus, typename _Dom1::value_type>::result_type> std::operator+(const std::valarray<typename _Dom::value_type>&, const std::_Expr<_Dom1, typename _Dom1::value_type>&)
     _DEFINE_EXPR_BINARY_OPERATOR(+, __plus)
     ^
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   'std::vector<long long int>' is not derived from 'const std::valarray<typename _Dom::value_type>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/valarray:1167:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__plus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__plus, _Tp>::result_type> std::operator+(const std::valarray<_Tp>&, const std::valarray<_Tp>&)
 _DEFINE_BINARY_OPERATOR(+, __plus)
 ^
/usr/include/c++/4.8/valarray:1167:1: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   'std::vector<long long int>' is not derived from 'const std::valarray<_Tp>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/valarray:1167:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__plus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__plus, _Tp>::result_type> std::operator+(const std::valarray<_Tp>&, const _Tp&)
 _DEFINE_BINARY_OPERATOR(+, __plus)
 ^
/usr/include/c++/4.8/valarray:1167:1: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   'std::vector<long long int>' is not derived from 'const std::valarray<_Tp>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/valarray:1167:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__plus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__plus, _Tp>::result_type> std::operator+(const _Tp&, const std::valarray<_Tp>&)
 _DEFINE_BINARY_OPERATOR(+, __plus)
 ^
/usr/include/c++/4.8/valarray:1167:1: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   mismatched types 'const std::valarray<_Tp>' and 'int'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67: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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:902:5: note: template<class _Iterator, class _Container> __gnu_cxx::__normal_iterator<_Iterator, _Container> __gnu_cxx::operator+(typename __gnu_cxx::__normal_iterator<_Iterator, _Container>::difference_type, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)
     operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:902:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:32: note:   mismatched types 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>' and 'int'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                ^
best_sum2.cpp:46:39: error: no match for 'operator+' (operand types are 'std::vector<long long int>' and 'int')
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                       ^
best_sum2.cpp:46:39: note: candidates are:
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67: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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:333:5: note: template<class _Iterator> std::reverse_iterator<_Iterator> std::operator+(typename std::reverse_iterator<_Iterator>::difference_type, const std::reverse_iterator<_Iterator>&)
     operator+(typename reverse_iterator<_Iterator>::difference_type __n,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:333:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67: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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:1118:5: note: template<class _Iterator> std::move_iterator<_Iterator> std::operator+(typename std::move_iterator<_Iterator>::difference_type, const std::move_iterator<_Iterator>&)
     operator+(typename move_iterator<_Iterator>::difference_type __n,
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:1118:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   mismatched types 'const std::move_iterator<_Iterator>' and 'int'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2365:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::basic_string<_CharT, _Traits, _Alloc>&, const std::basic_string<_CharT, _Traits, _Alloc>&)
     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2365:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   'std::vector<long long int>' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
In file included from /usr/include/c++/4.8/string:53: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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.tcc:692:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const _CharT*, const std::basic_string<_CharT, _Traits, _Alloc>&)
     operator+(const _CharT* __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.tcc:692:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   mismatched types 'const _CharT*' and 'std::vector<long long int>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
In file included from /usr/include/c++/4.8/string:53: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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.tcc:708:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(_CharT, const std::basic_string<_CharT, _Traits, _Alloc>&)
     operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs)
     ^
/usr/include/c++/4.8/bits/basic_string.tcc:708:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   mismatched types 'const std::basic_string<_CharT, _Traits, _Alloc>' and 'int'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2402:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2402:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   'std::vector<long long int>' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2418:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::basic_string<_CharT, _Traits, _Alloc>&, _CharT)
     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
     ^
/usr/include/c++/4.8/bits/basic_string.h:2418:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   'std::vector<long long int>' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2430:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::basic_string<_CharT, _Traits, _Alloc>&&, const std::basic_string<_CharT, _Traits, _Alloc>&)
     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2430:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   'std::vector<long long int>' is not derived from 'std::basic_string<_CharT, _Traits, _Alloc>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2436:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::basic_string<_CharT, _Traits, _Alloc>&, std::basic_string<_CharT, _Traits, _Alloc>&&)
     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2436:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   'std::vector<long long int>' is not derived from 'const std::basic_string<_CharT, _Traits, _Alloc>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2442:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::basic_string<_CharT, _Traits, _Alloc>&&, std::basic_string<_CharT, _Traits, _Alloc>&&)
     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2442:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   'std::vector<long long int>' is not derived from 'std::basic_string<_CharT, _Traits, _Alloc>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2454:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const _CharT*, std::basic_string<_CharT, _Traits, _Alloc>&&)
     operator+(const _CharT* __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2454:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   mismatched types 'const _CharT*' and 'std::vector<long long int>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2460:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(_CharT, std::basic_string<_CharT, _Traits, _Alloc>&&)
     operator+(_CharT __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2460:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   mismatched types 'std::basic_string<_CharT, _Traits, _Alloc>' and 'int'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2466:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::basic_string<_CharT, _Traits, _Alloc>&&, const _CharT*)
     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2466:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   'std::vector<long long int>' is not derived from 'std::basic_string<_CharT, _Traits, _Alloc>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2472:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::basic_string<_CharT, _Traits, _Alloc>&&, _CharT)
     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
     ^
/usr/include/c++/4.8/bits/basic_string.h:2472:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   'std::vector<long long int>' is not derived from 'std::basic_string<_CharT, _Traits, _Alloc>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
In file included from /usr/include/c++/4.8/ccomplex:38:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/complex:324:5: note: template<class _Tp> std::complex<_Tp> std::operator+(const std::complex<_Tp>&, const std::complex<_Tp>&)
     operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
     ^
/usr/include/c++/4.8/complex:324:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   'std::vector<long long int>' is not derived from 'const std::complex<_Tp>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
In file included from /usr/include/c++/4.8/ccomplex:38:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/complex:333:5: note: template<class _Tp> std::complex<_Tp> std::operator+(const std::complex<_Tp>&, const _Tp&)
     operator+(const complex<_Tp>& __x, const _Tp& __y)
     ^
/usr/include/c++/4.8/complex:333:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   'std::vector<long long int>' is not derived from 'const std::complex<_Tp>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
In file included from /usr/include/c++/4.8/ccomplex:38:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/complex:342:5: note: template<class _Tp> std::complex<_Tp> std::operator+(const _Tp&, const std::complex<_Tp>&)
     operator+(const _Tp& __x, const complex<_Tp>& __y)
     ^
/usr/include/c++/4.8/complex:342:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   mismatched types 'const std::complex<_Tp>' and 'int'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
In file included from /usr/include/c++/4.8/ccomplex:38:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/complex:443:5: note: template<class _Tp> std::complex<_Tp> std::operator+(const std::complex<_Tp>&)
     operator+(const complex<_Tp>& __x)
     ^
/usr/include/c++/4.8/complex:443:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   'std::vector<long long int>' is not derived from 'const std::complex<_Tp>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
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 /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/stl_bvector.h:293:3: note: std::_Bit_iterator std::operator+(std::ptrdiff_t, const std::_Bit_iterator&)
   operator+(ptrdiff_t __n, const _Bit_iterator& __x)
   ^
/usr/include/c++/4.8/bits/stl_bvector.h:293:3: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'std::ptrdiff_t {aka int}'
/usr/include/c++/4.8/bits/stl_bvector.h:379:3: note: std::_Bit_const_iterator std::operator+(std::ptrdiff_t, const std::_Bit_const_iterator&)
   operator+(ptrdiff_t __n, const _Bit_const_iterator& __x)
   ^
/usr/include/c++/4.8/bits/stl_bvector.h:379:3: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'std::ptrdiff_t {aka int}'
In file included from /usr/include/c++/4.8/deque:64:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:67,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/stl_deque.h:354:5: note: template<class _Tp, class _Ref, class _Ptr> std::_Deque_iterator<_Tp, _Ref, _Ptr> std::operator+(std::ptrdiff_t, const std::_Deque_iterator<_Tp, _Ref, _Ptr>&)
     operator+(ptrdiff_t __n, const _Deque_iterator<_Tp, _Ref, _Ptr>& __x)
     ^
/usr/include/c++/4.8/bits/stl_deque.h:354:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   cannot convert 'dp1' (type 'std::vector<long long int>') to type 'std::ptrdiff_t {aka int}'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
In file included from /usr/include/c++/4.8/valarray:587:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note: template<class _Dom1, class _Dom2> std::_Expr<std::_BinClos<std::__plus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__plus, typename _Dom1::value_type>::result_type> std::operator+(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&)
     _DEFINE_EXPR_BINARY_OPERATOR(+, __plus)
     ^
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   'std::vector<long long int>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
In file included from /usr/include/c++/4.8/valarray:587:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__plus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__plus, typename _Dom1::value_type>::result_type> std::operator+(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)
     _DEFINE_EXPR_BINARY_OPERATOR(+, __plus)
     ^
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   'std::vector<long long int>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
In file included from /usr/include/c++/4.8/valarray:587:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__plus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__plus, typename _Dom1::value_type>::result_type> std::operator+(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&)
     _DEFINE_EXPR_BINARY_OPERATOR(+, __plus)
     ^
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'int'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
In file included from /usr/include/c++/4.8/valarray:587:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__plus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__plus, typename _Dom1::value_type>::result_type> std::operator+(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _Dom::value_type>&)
     _DEFINE_EXPR_BINARY_OPERATOR(+, __plus)
     ^
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   'std::vector<long long int>' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
In file included from /usr/include/c++/4.8/valarray:587:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__plus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__plus, typename _Dom1::value_type>::result_type> std::operator+(const std::valarray<typename _Dom::value_type>&, const std::_Expr<_Dom1, typename _Dom1::value_type>&)
     _DEFINE_EXPR_BINARY_OPERATOR(+, __plus)
     ^
/usr/include/c++/4.8/bits/valarray_after.h:402:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   'std::vector<long long int>' is not derived from 'const std::valarray<typename _Dom::value_type>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/valarray:1167:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__plus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__plus, _Tp>::result_type> std::operator+(const std::valarray<_Tp>&, const std::valarray<_Tp>&)
 _DEFINE_BINARY_OPERATOR(+, __plus)
 ^
/usr/include/c++/4.8/valarray:1167:1: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   'std::vector<long long int>' is not derived from 'const std::valarray<_Tp>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/valarray:1167:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__plus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__plus, _Tp>::result_type> std::operator+(const std::valarray<_Tp>&, const _Tp&)
 _DEFINE_BINARY_OPERATOR(+, __plus)
 ^
/usr/include/c++/4.8/valarray:1167:1: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   'std::vector<long long int>' is not derived from 'const std::valarray<_Tp>'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/valarray:1167:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__plus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__plus, _Tp>::result_type> std::operator+(const _Tp&, const std::valarray<_Tp>&)
 _DEFINE_BINARY_OPERATOR(+, __plus)
 ^
/usr/include/c++/4.8/valarray:1167:1: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   mismatched types 'const std::valarray<_Tp>' and 'int'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^
In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67: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/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from best_sum2.cpp:1:
/usr/include/c++/4.8/bits/stl_iterator.h:902:5: note: template<class _Iterator, class _Container> __gnu_cxx::__normal_iterator<_Iterator, _Container> __gnu_cxx::operator+(typename __gnu_cxx::__normal_iterator<_Iterator, _Container>::difference_type, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)
     operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
     ^
/usr/include/c++/4.8/bits/stl_iterator.h:902:5: note:   template argument deduction/substitution failed:
best_sum2.cpp:46:41: note:   mismatched types 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>' and 'int'
     cout << *max_element(dp1 + t, dp1 + n + 1);

                                         ^

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