luogu#P7931. [COCI 2021/2022 #1] Volontiranje
[COCI 2021/2022 #1] Volontiranje
Problem Description
Given a permutation of , please take as many pairwise disjoint increasing subsequences as possible, where each subsequence has length equal to the LIS length of the original permutation, and construct one valid solution.
Input Format
The first line contains an integer .
The next line contains integers .
Output Format
On the first line, output the number of increasing subsequences you choose and their length.
On the next several lines, output several integers per line, representing the indices of the elements in one increasing subsequence.
You may output the increasing subsequences in any order.
3
1 2 3
1 3
1 2 3
4
4 3 2 1
4 1
1
2
3
4
7
2 1 6 5 7 3 4
2 3
1 3 5
2 6 7
Hint
Constraints
For all testdata, , .
| Subtask | Constraints | Score |
|---|---|---|
| No additional constraints |
Notes
The total score for this problem is points.
This problem is translated from Croatian Open Competition in Informatics 2021/2022 Contest #1 T5 Volontiranje.
A checker.cpp is provided in the additional files.
Translated by ChatGPT 5