I'll show you min_element(v.begin(), v.end()) to find the smallest value. This returns an iterator, so dereference it: *min_element(v.begin(), v.end()). You can get the index: min_element(v.begin(), v.end()) - v.begin().
Subtracting the begin iterator gives you the position. max_element() works identically for finding the largest value. Both run in time and work with custom comparators.