摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=2038 【题解】 莫队出的裸莫队。 # include <math.h> # include <stdio.h> # include <string.h> # include <iostream 阅读全文
posted @ 2017-07-16 15:16 Galaxies 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=2844 【题解】 考虑$n$个数组成的基,大小为$k$,那么每种方案都有$2^{n-k}$可以取到。 观察样例也能发现这个结论。 然后就是正常的线性基统计,最后乘一个$2^{n-k}$,加一即可 阅读全文
posted @ 2017-07-16 15:02 Galaxies 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3224 【题解】 写起来跟*一样,但是还是挺快调出来了。 主要就是每个数可以有多个,我们可以用一个splay节点存多个数,然后find即可。 注意的是每个操作过后基本都要splay一下保证复杂度 阅读全文
posted @ 2017-07-16 11:12 Galaxies 阅读(245) 评论(0) 推荐(0) 编辑