【例57.1】 字典序第几小
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Description
From the digits starting from to (), a total of different permutations can be formed. Given one of these permutations, determine its lexicographical order among all permutations.
Input Format
The first line contains an integer .
The second line contains an integer , which is a permutation of the digits from to .
Output Format
An integer representing the lexicographical order of the given permutation.
Sample
4
21438
20251025D班作业(4)
- Status
- Done
- Problem
- 12
- Open Since
- 2025-10-26 0:00
- Deadline
- 2025-11-3 23:59
- Extension
- 24 hour(s)