其他分享
首页 > 其他分享> > D. Shortest and Longest LIS

D. Shortest and Longest LIS

作者:互联网

https://codeforces.com/problemset/problem/1304/D

Gildong recently learned how to find the longest increasing subsequence (LIS) in O(nlogn)O(nlog⁡n) time for a sequence of length nn. He wants to test himself if he can implement it correctly, but he couldn’t find any online judges that would do it (even though there are actually many of them). So instead he’s going to make a quiz for you about making permutations of nn distinct integers between 11 and nn, inclusive, to test his code with your output.

题意就是按照给的比较符号写出一个数列来,要求第一行的上升子序列最短,第二行的上升子序列最长

input
3
3 <<
7 >><>><
5 >>><

output
1 2 3
1 2 3
5 4 3 7 2 1 6
4 3 1 7 5 2 6
4 3 2 1 5
5 4 2 1 3

参考别人写的其实,很棒

标签:nn,int,第二行,cin,Longest,LIS,include,Shortest,he
来源: https://blog.csdn.net/qq_51392086/article/details/115642921