Language: C++

#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>

using namespace std;

int main(){
    cin.tie(0);
   	ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<int> v(N), noten;
    for (int i = 0; i < N; ++i){
        cin >> v[i];
    }

    for (int i = 0; i < N; ++i){
        if (v[i] % 10 != 0) noten.push_back(v[i]);
    }

    //sort(noten.begin(), noten.end());
    int sum = accumulate(v.begin(), v.end(), 0);

    if (sum % 10 != 0) cout << sum << endl;
    else cout << sum - min_element(noten.begin(), noten.end()) << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:22: error: no match for 'operator-' (operand types are 'int' and '__gnu_cxx::__normal_iterator<int*, std::vector<int> >')
   26 |     else cout << sum - min_element(noten.begin(), noten.end()) << endl;
      |                  ~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                  |                |
      |                  int              __gnu_cxx::__normal_iterator<int*, std::vector<int> >
In file included from /usr/include/c++/14/string:48,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   template argument deduction/substitution failed:
a.cc:26:62: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
   26 |     else cout << sum - min_element(noten.begin(), noten.end()) << endl;
      |                                                              ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   template argument deduction/substitution failed:
a.cc:26:62: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
   26 |     else cout << sum - min_element(noten.begin(), noten.end()) << endl;
      |                                                              ^
/usr/include/c++/14/bits/stl_iterator.h:1312:5: note: candidate: 'template<class _IteratorL, class _IteratorR, class _Container> decltype ((__lhs.base() - __rhs.base())) __gnu_cxx::operator-(const __normal_iterator<_IteratorL, _Container>&, const __normal_iterator<_IteratorR, _Container>&)'
 1312 |     operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1312:5: note:   template argument deduction/substitution failed:
a.cc:26:62: note:   mismatched types 'const __gnu_cxx::__normal_iterator<_IteratorL, _Container>' and 'int'
   26 |     else cout << sum - min_element(noten.begin(), noten.end()) << endl;
      |                                                              ^
/usr/include/c++/14/bits/stl_iterator.h:1325:5: note: candidate: 'template<class _Iterator, class _Container> typename __gnu_cxx::__normal_iterator<_Iterator, _Container>::difference_type __gnu_cxx::operator-(const __normal_iterator<_Iterator, _Container>&, const __normal_iterator<_Iterator, _Container>&)'
 1325 |     operator-(const __normal_iterator<_Iterator, _Container>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1325:5: note:   template argument deduction/substitution failed:
a.cc:26:62: note:   mismatched types 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>' and 'int'
   26 |     else cout << sum - min_element(noten.begin(), noten.end()) << endl;
      |                                                              ^