摘要: $\color{purple}\text{Greedy Change}$ $\color{red}\text{Rating:2600}$ $\color{green}\text{time:2023.3.9}$ 有时侯越是深入,越难看清,不如置身世外,跟着感觉走。 我们记答案为 $\text{S}$ 阅读全文
posted @ 2023-03-26 16:19 FJOI 阅读(101) 评论(0) 推荐(0)
摘要: $\color{orange}\text{ARC-158}$ $\color{RED}\text{Performance:1703}$ $\color{GREEN}\text{time:2023.3.12}$ 比赛状态:切了 $\text{A,B}$ ,两发罚时。(写 $\text{B}$ 时忘删调 阅读全文
posted @ 2023-03-19 13:12 FJOI 阅读(166) 评论(0) 推荐(0)
摘要: ## 字典树 其实是将字母放在树边上,利用空间换时间,解决前缀等问题。 点击查看代码 ``` #include using namespace std; const int N=3e6+110; int read(){ int x=0,f=1;char c=getchar(); while(c>'9 阅读全文
posted @ 2023-07-17 20:12 FJOI 阅读(8) 评论(0) 推荐(0)
摘要: # definition $\varphi(n)$ 表示不超过 $n$ 且与 $n$ 互质的正整数的个数。 欧拉函数是一个**数论函数**(定义域为正整数)和**积性函数**(对于互质的正整数 $a,b$ 满足 $f(a,b)=f(a)f(b)$ ) 积性函数的性质: $n=\prod p_i^{a 阅读全文
posted @ 2023-06-09 08:44 FJOI 阅读(65) 评论(0) 推荐(0)
摘要: # Introduce 给定 $n$ 个点,那么可以确定一个不超过 $n-1$ 项的多项式函数值。我们可以使用高斯消元,但是 $O(n^3)$ 的时间复杂度和精度误差难以接受。 # Principle 我们考虑构造函数 $fi$ ,满足其在 $x=x_i$ 时函数值为 $1$ ,在 $x=x_j(j 阅读全文
posted @ 2023-06-07 16:00 FJOI 阅读(24) 评论(0) 推荐(0)
摘要: ## [$\color{purple}\text{P3389 【模板】高斯消元法}$](https://www.luogu.com.cn/problem/P3389) 所谓高斯消元就是解个 $n$ 元一次方程。 用矩阵记录每个方程的系数满足第 $i$ 个方程:$a[i][1]x_1+a[i][2]x 阅读全文
posted @ 2023-06-01 21:15 FJOI 阅读(81) 评论(0) 推荐(0)
摘要: # [$\color{purple}\text{P7984 [USACO21DEC] Tickets P}$](https://www.luogu.com.cn/problem/P7984) 首先这个建边方式一眼就能发现用线段树优化建边。但是要注意一定要**建一个虚点**,把起点连向虚点,虚点连向区 阅读全文
posted @ 2023-05-30 21:57 FJOI 阅读(26) 评论(0) 推荐(0)
摘要: # [$\color{purple}\text{Palindrome Partition}$](https://www.luogu.com.cn/problem/CF1827C) >该说不难,只待一切走上正轨。 显然我们不能枚举每个子串,所以我们考虑枚举以 $i$ 结尾的**“好的”子串**的个数。 阅读全文
posted @ 2023-05-25 21:28 FJOI 阅读(51) 评论(0) 推荐(0)
摘要: # [$\color{purple}\text{The Fox and the Complete Tree Traversal}$](https://www.luogu.com.cn/problem/CF1819C) 比较有意思的一题。先考虑一个序列的权值。对长度为 $len$ 的序列排序,价值为 阅读全文
posted @ 2023-05-24 22:33 FJOI 阅读(38) 评论(0) 推荐(0)
摘要: ## [$\color{purple}\text{P2495 [SDOI2011] 消耗战}$](https://www.luogu.com.cn/problem/P2495) 所谓虚树,就是对树上 $dp$ 的优化,建立一棵新树,上面包含原树的部分节点,且父子关系不变。套路是他会有很多个询问,每个 阅读全文
posted @ 2023-05-19 16:01 FJOI 阅读(22) 评论(0) 推荐(0)
摘要: $\color{purple}\text{P4169 [Violet]天使玩偶/SJY摆棋子}$ 以本题为例题讲解模板怎么写。 思路 $\text{K-D Tree}$ 是一种类二叉查找树,不过元素是多维的,所以每次对于子树的划分也是依据不同维度的。 本题使用二维的 $\text{K-D Tree} 阅读全文
posted @ 2023-05-07 15:58 FJOI 阅读(31) 评论(0) 推荐(0)
摘要: $\color{red}\text{总述}$ 所谓同余最短路,就是把余数相同的情况归为一类,然后找到形成这种情况的最短路径。 $\color{purple}\text{P3403 跳楼机}$ 我们假设只能跳 $x$ 步。那么可以达到的楼层是 $x,2x,3x,4x$ ,他们的共同点是 $%x=0$ 阅读全文
posted @ 2023-05-05 15:42 FJOI 阅读(75) 评论(0) 推荐(0)