#P4309. [TJOI2013] 最长上升子序列
[TJOI2013] 最长上升子序列
Description
You are given a sequence that is initially empty. We will insert the numbers through into the sequence, each time inserting one number at a specific position. After each insertion, we want to know the length of the current longest increasing subsequence.
Input Format
The first line contains an integer , indicating that we will insert through into the sequence.
Then follow integers. The -th number indicates that we insert at position (, ).
Output Format
Output lines. The -th line is the length of the longest increasing subsequence after inserting at position .
3
0 0 2
1
1
2
Hint
Constraints: For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号