I’m having an issue with not converting const__gnu_cxx::__normal_iterator

std::min returns the minimum of 2 elements, not the minimum element of a range. Assuming you don’t want the minimum of 2 iterators, but the minimum element of a range, you need std::min_element and you need to dereference the result, like this:

amin = * min_element(a.begin(), a.end());
    // ^

And you need to do the same thing for bmin.


Also, please avoid using namespace std; and all the #defines for the types, it just makes the code more confusing to read.

Leave a Comment