随笔分类 -  动态规划 -- 决策单调性

摘要:$CSP\space S$ 格雷码 $solution:$ 直接模拟即可。 时间复杂度 $O(n)$ 。 #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> using namespace std; vo 阅读全文
posted @ 2019-11-21 19:38 siruiyang_sry 阅读(315) 评论(0) 推荐(2)
摘要:异或约数和 题意简述 求 $f_1\space xor\space f_2…\space xor\space f_n$ , $f_i$ 表示 $i$ 的所有约数的异或和。 $n\leq 10^{14}$ 。 $solution:$ 考虑 $xor$ 有结合律与交换律,所以考虑优化给定式子。 对于 $ 阅读全文
posted @ 2019-07-27 13:31 siruiyang_sry 阅读(185) 评论(0) 推荐(0)