Please someone write this algorithm in Python please.
Divide and conquer
N runners participate in a 100-meter sprinting competition. All runners are seeded from number 1 to number n. After all the running heats are over, the competition results are determined by comparing the time. The sprinter with the fastest time is ranked 1st and the sprinter with the slowest time ranked nth.
Write an algorithm that computes the number of sprinter pairs that have the competition results opposite to the pairs’ seed numbers.
The running time of the algorithm must be O(nlgn).
Input: list of seed numbers according to the sprinter results, from the fastest to the slowest.
Output: the number of sprinter pairs that get the results opposite to the seeding.