#P10668. BZOJ2720 [Violet 5] 列队春游
BZOJ2720 [Violet 5] 列队春游
Problem Description
Given a sequence of positive integers . Let be a random permutation of .
Define . Define as the largest such that (if it does not exist, let it be ).
Find the expected value of , and output it rounded to two decimal places.
Input Format
The first line contains a positive integer , which is the length of the sequence.
The second line contains positive integers .
Output Format
Output one real number in one line, which is the answer rounded to two decimal places.
3
3 2 1
4.33
Hint
For of the testdata, .
For of the testdata, , and all are distinct.
For of the testdata, it is guaranteed that and .
Translated by ChatGPT 5