cf/mirror

Longest Increasing Subsequence

CF
568E3000· legendary gm1.5s128 MB⌨ stdin/stdout

Examples

Sample 1of 5
Input
3
1 2 3
1
10
Output
1 2 3
Sample 2of 5
Input
3
1 -1 3
3
1 2 3
Output
1 2 3
Sample 3of 5
Input
2
-1 2
2
2 4
Output
2 2
Sample 4of 5
Input
3
-1 -1 -1
5
1 1 1 1 2
Output
1 1 2
Sample 5of 5
Input
4
-1 -1 -1 2
4
1 1 2 2
Output
1 2 1 2
568E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)