Take a look at the end of these two programs:
https://atcoder.jp/contests/abc188/submissions/19361247
https://atcoder.jp/contests/abc188/submissions/19361394
One is correct and the other is not, even though in theory the one with std::min should be equivalent, since the first values of the arrays are all pairwise distinct.