摘要: https://loj.ac/problem/6622 求最大是假的,其实是求方案数。 每一位独立,每一位做不同的FWT后变点积,直接跑矩阵树即可。 矩阵树模一个质数,最好别取常见质数。 Code: #include<bits/stdc++.h> #define fo(i, x, y) for(in 阅读全文
posted @ 2020-06-10 22:14 Cold_Chair 阅读(328) 评论(0) 推荐(0) 编辑
摘要: https://loj.ac/problem/2027 https://loj.ac/submission/831930 https://loj.ac/problem/2091 https://loj.ac/submission/831907 对于T1,发现是要每个颜色恰好选一个。 对于T2,发现是 阅读全文
posted @ 2020-06-10 21:15 Cold_Chair 阅读(183) 评论(0) 推荐(0) 编辑
摘要: https://loj.ac/problem/2093 题解: 我想这题时卡死在枚举每个点求答案,结果最优也只能$O(n^4)$,要多从整体看。 考虑对整体来做,枚举$x$,表示求$\le x$的方案数(经过尝试得到这个好算),$x$可以是离散后的,转换真正的答案显然。 考虑大于$x$的数把序列分成 阅读全文
posted @ 2020-06-10 20:44 Cold_Chair 阅读(216) 评论(0) 推荐(0) 编辑