摘要:
题目链接 "戳我" $Solution$ 如果一个 要更改,那么一个四个格子的正方形只有他一个是 ,bfs弄一下就好了 $Code$ cpp include using namespace std; const int inf=1e9,mod=1e9+7; typedef long long ll; 阅读全文
摘要:
题目链接 "戳我" $Solution$ 观察发现如果一个数两边都比他大,删掉他可以保证最优,这个应该是显然的。这个东西用单调栈维护一下,最后剩下的就是个单调递减或单调递增的数列,从小到大排个序取前面$n 2$个,$n$为数列长度 $Code$ cpp include define int long 阅读全文