UTD-outreach-2

Start

2018-06-15 14:30 UTC

UTD-outreach-2

End

2018-06-15 16:30 UTC
The end is near!
Contest is over.
Not yet started.
Contest is starting in -279 days 23:52:57

Time elapsed

2:00:00

Time remaining

0:00:00

Problem E
Longest Increasing Subsequence

Input

The input consists of several test cases. Each test case begins with a positive integer $n \le 100\, 000$, indicating the length of a sequence. Then follows a sequence of $n$ integers, that fit into 32-bit integer variables.

Output

For each test case, output a line containing the length of a longest increasing subsequence, followed by a line containing the indices of the elements in one such sequence (the first element has index $0$, the second index $1$, and so on). The indices should be given in ascending order.

Sample Input 1 Sample Output 1
10
1 2 3 4 5 6 7 8 9 10
10
1 1 1 1 1 1 1 1 1 1
10
5 19 5 81 50 28 29 1 83 23
10
0 1 2 3 4 5 6 7 8 9
1
7
5
0 1 5 6 8