Problem Description

Read n integers. Use function mergesort_count(arr) to return inversion count and output it.

Input Format

First line n. Second line n integers.

Output Format

One integer inversions.

Sample Test Case

Input:
5 2 4 1 3 5
Output:
3

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next