题目分析
打算去cf写写大致题解:
There might be another greedy algorithm using LIS/LDS which is more easier to make sense(it doesn‘t need swapping):
To the first element $a_1$,it belongs to the increasing/decreasing sequence.Let‘s only consider it‘s in the increasing sequence,for the other situation is just the same.
原文地址:https://www.cnblogs.com/antiquality/p/10732496.html
时间: 2024-10-19 04:38:49