[algorithms] Uniform notation of distance(first, last) to (last - first)

As allowed in 25.1 [algorithms.general] p12, to express the same things
as same.

For is_permutation, it is really bad because last1 - first1 is used in the previous line.
Others are just for consistency.