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 #define
s for the types, it just makes the code more confusing to read.