上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 23 下一页
摘要: https://atcoder.jp/contests/abc248 G \(\sum_{i=1}^n\sum_{j=i+1}^n C(i,j)\) 关于 gcd 有关的要不就莫反要不就欧拉反演。 \(\gcd(S)=\sum_{d|\gcd(S)}\varphi(d)=\sum_{d|x,x\in 阅读全文
posted @ 2022-04-19 16:59 FxorG 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 考虑构造一个长度为 n,值域在 \([1,m]\) 的单调上升序列,显然方案数是 \(\binom{m}{n}\)。 考虑构造一个长度为 n,值域 \([1,m]\) 的单调不降序列。我们对于构造出来的序列 a,\(\forall a_i,i\in[1,n],a_i\gets a_i+i\),那么这 阅读全文
posted @ 2022-04-04 13:14 FxorG 阅读(97) 评论(0) 推荐(0) 编辑
摘要: NOIP T3!!!序列先看看差分数组!!! A. 删数 Solution 考虑操作本质上就是合并 2 个相邻且相同的差分数组,那么对于一个差分值 $x$,合成到最后一定是 $x*2^k$,考虑 dp,设 $f[i]$ 表示差分数组 $[1,i]$ 最少留下几个数,考虑以 $i$ 倍增去跳,即 $m 阅读全文
posted @ 2022-04-04 10:42 FxorG 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 防止颓废,作为假期任务。 CF1327G Letters and Question Marks Solution 发现是个 AC 自动机上 dp。 E1. Cats on the Upgrade (easy version) Solution 网上对于此题的题解并没有很好的说明。 首先,注意到这实际 阅读全文
posted @ 2022-03-31 13:41 FxorG 阅读(58) 评论(0) 推荐(0) 编辑
摘要: 二进制拆,考虑假如 \((x,y)\) 是最短的,那么 \(x\not = y\)。显然会跑到。 https://www.luogu.com.cn/problem/P5304 https://atcoder.jp/contests/abc245/tasks/abc245_g 阅读全文
posted @ 2022-03-27 12:29 FxorG 阅读(23) 评论(0) 推荐(0) 编辑
摘要: https://iai.sh.cn/problem/589 晚自修摸鱼 15 min 想了出来。 考虑朴素覆盖,显然不行。 换种思路,考虑一个数被多少数覆盖到了,发现 m 很小,直接状压。 \(f[S]\) 表示仅以 S 状态的覆盖到的数的数量,即 \(f[S]\) 贡献的数不能贡献到 \(f[T] 阅读全文
posted @ 2022-03-24 13:09 FxorG 阅读(69) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P6619 猜个二分+树状数组 一个小细节多拿 40 分,lowbit 要 define!!! #include <bits/stdc++.h> using namespace std; int rd() { int f=1,sum= 阅读全文
posted @ 2022-03-20 16:54 FxorG 阅读(42) 评论(0) 推荐(0) 编辑
摘要: https://atcoder.jp/contests/arc137/tasks/arc137_d 遇到 \(i\&j=i\) 的先不用急,i 是 j 的子集,\(i|j=j\),发现 FWT OR 恰好是这个东西。 阅读全文
posted @ 2022-03-20 16:38 FxorG 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 想不到吧,我被卡常了。 http://iai.sh.cn/problem/612 #pragma GCC optimize("Ofast","-funroll-loops") #pragma GCC target("sse4.1","sse4.2","ssse3","sse3","sse2","ss 阅读全文
posted @ 2022-03-17 14:06 FxorG 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 考虑差分,差分完就是正差分和负差分的最大。 序列 环上 阅读全文
posted @ 2022-03-07 11:51 FxorG 阅读(33) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 23 下一页