atcoder#ARC140C. [ARC140C] ABS Permutation (LIS ver.)
[ARC140C] ABS Permutation (LIS ver.)
Score : points
Problem Statement
The happiness of a permutation of is defined as follows.
- Let be a sequence of length with . The happiness of is the length of a longest strictly increasing subsequence of .
Print a permutation such that with the greatest happiness.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print a permutation such that with the greatest happiness, in the following format:
If there are multiple solutions, printing any of them will be accepted.
3 2
2 1 3
Since , the happiness of is , which is the greatest happiness achievable, so the output meets the requirement.
3 1
1 2 3
Since , the happiness of is , which is the greatest happiness achievable, so the output meets the requirement.