Lab 3.1.1 sort and count

Lab 3.1.1 sort and count

You cannot submit for this problem because the homework's deadline is due.

Description

Use python3 or OCmal to implement sort and count algorithm.

Submission Format

Submit a tar or zip file including a script named sortcount.py or sortcount.ml.

IO

Input

A line of numbers, separated by single space.

Output

Two lines.
The first line is the count of inversions.
The second line is the sorted results.

Sample IO

input

3 4 2 1

output

5
[1, 2, 3, 4]

Lab 3

Not Claimed
Status
Finished
Problems
4
Open Since
2022-10-13 00:00
DDL
2022-11-03 23:59
Extension
72.0 hour(s)