摘要: 要点 官解使用的哈希,给每个数一个二维键值,这样每个排列就有唯一的键值,再预求一下所给数列的前缀键值,暴力寻找有多少个答案即可。 C++ include include include include include using namespace std; typedef long long ll 阅读全文
posted @ 2019-06-12 21:56 AlphaWA 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 要点 与cf 1168C相似的一点都是看某点x最远能拓展到哪里 看数据想要在logn内查询,考虑倍增步数 C++ const int maxn = 2e5 + 5, X = 5e5 + 5, LOG = 25; int n, m; int l, r; int dp[X][LOG];//点i走pow( 阅读全文
posted @ 2019-06-12 21:52 AlphaWA 阅读(244) 评论(0) 推荐(0) 编辑