摘要: A 我们考虑序列的最后一个数字 \(x\),那么 \(>x\) 的数字在排名中就没有贡献了,所以我们只能让前面 \(<x\) 的数尽量靠前。贪心的想我们肯定让这个 \(x\) 尽量大,也就是说如果把越大的数放在后面,那么就会有更多小的数在前面。 于是答案等价于求反过来的最大字典序。 #include 阅读全文
posted @ 2020-10-18 21:36 RainAir 阅读(119) 评论(0) 推荐(0) 编辑
摘要: A 枚举每个矩形,前缀和优化即可。 #include <bits/stdc++.h> #define fi first #define se second #define db double #define U unsigned #define P std::pair<int,int> #defin 阅读全文
posted @ 2020-10-18 21:14 RainAir 阅读(125) 评论(0) 推荐(0) 编辑