摘要: Description: 有 \(N\) 个洞,每个洞有相应的弹力,能把这个球弹到 \(i+power[i]\) 位置。当球的位置 \(>N\) 时即视为被弹出。 有两种操作: 修改某个点的弹力值。 询一个球从某点几次能够弹出,弹出前的最后一个位置是哪里。 Solution 考虑分块,对于每个点,记 阅读全文
posted @ 2021-07-21 11:18 feicheng 阅读(44) 评论(0) 推荐(0) 编辑
摘要: Description: 给定 \(A,B,d\) ,求满足$1\le a\le A,1\le b\le B \(且\)\gcd(a,b)=d$ 的数对数 Solution 考虑莫比乌斯反演 原式可化为 \(\sum_{i=1}^A\sum_{j=1}^B\gcd(i,j)=d\) 根据套路,我们先 阅读全文
posted @ 2021-07-21 11:17 feicheng 阅读(34) 评论(0) 推荐(0) 编辑
摘要: $\text 给定长度为 \(n\) 的序列 \(a\),求一个子集 \(S\),使得 \(\forall i,j\in S,|a_i-a_j|\ge \text{MAX}\),其中 \(\text{MAX}=\max_{i\in S} a_i\),最大化 \(|S|\)。 $\text 首先对于所 阅读全文
posted @ 2021-07-21 11:14 feicheng 阅读(41) 评论(0) 推荐(0) 编辑
摘要: Description 给定长度为 \(n\) 的序列 \(a\),\(m\) 次询问,求: \(\max_{i\in[l,r]}cnt[a_i]\times a_i\) 即带权众数。 \(1\le n,m\leq 10^5,1\le a_i \le 10^9\) Solution 前置芝士:莫队( 阅读全文
posted @ 2021-07-21 11:13 feicheng 阅读(30) 评论(0) 推荐(0) 编辑
摘要: \(\mathtt{Description}\) 给 \(\deg = n\) 的多项式 \(f\),求一多项式 \(g\),使 \(g= \ln f\)。 对 \(998244353\) 取模。 \(\mathtt{restrictions:}1\le n \le 10^5\)。 \(\matht 阅读全文
posted @ 2021-07-21 11:07 feicheng 阅读(39) 评论(0) 推荐(0) 编辑
摘要: $\mathtt 给定 \(\deg = n\) 的多项式 \(f\) 和 \(\text{type}\),求一个多项式 \(g\) 使得 \[ g\equiv \sin f \pmod {998244353}\quad(\text{type}=0) \] \[ g\equiv \cos f \pm 阅读全文
posted @ 2021-07-21 11:06 feicheng 阅读(54) 评论(0) 推荐(0) 编辑
摘要: $\text $\mathtt 给定 \(2n\) 个整数,若能将其分成 \(n\) 组,使得每组内的两个数加和为奇数,则输出 Yes,反之输出 No。多测。 \(1\le n\le100\) $\mathtt 考虑分成奇数的情况:每组内必然是一个奇数和一个偶数,所以只需要记录奇数个数和偶数个数,再 阅读全文
posted @ 2021-07-21 11:05 feicheng 阅读(59) 评论(0) 推荐(0) 编辑
摘要: $\text $\mathtt 给定 \(a,b\),求 $\max \gcd(a+k,b+k),k\in [-\min(a,b),+\infty] \cap \mathbb Z $ 多组数据。 特殊规定:\(\gcd(0,x)=x\) \(\mathtt{restrictions:}1\leq a 阅读全文
posted @ 2021-07-21 11:04 feicheng 阅读(50) 评论(0) 推荐(0) 编辑
摘要: $\mathtt 给 \(n\) 个点的树,可以进行如下操作: 选择三个点 \(a,b,c\),要求 \(a,b\) 相邻,\(b,c\) 相邻,断掉 \(a\) 的所有边,并连到 \(c\) 上,将 \(a,c\) 连边。 求最小操作次数使得该树变成菊花图。 \(n\le2\times 10^5\ 阅读全文
posted @ 2021-07-21 11:03 feicheng 阅读(38) 评论(0) 推荐(0) 编辑
摘要: $\mathtt 求一个满足 \(k\) 阶齐次线性递推数列 \({a_i}\) 的第 \(n\) 项,即: \(a_n=\sum\limits_{i=1}^{k}f_i \times a_{n-i}\) \(\mathtt{restrictions:}n=10^9,k = 32000\) $\ma 阅读全文
posted @ 2021-07-21 11:02 feicheng 阅读(53) 评论(0) 推荐(0) 编辑