上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 28 下一页
摘要: Aimee 很显然的做法就是枚举每个点为源点然后树形dp \[ d_s[x]=\sum_{y\in son(x)} \left\{ \begin{aligned} min((D_s[y],c(x,y)))\quad degeree_y>1 \\ c(x,y) \quad\quad\quad\quad 阅读全文
posted @ 2021-06-20 16:33 Simex 阅读(51) 评论(0) 推荐(0) 编辑
摘要: 我们需要的是解方程组 手解怎么解,挨个试呗 所以说呢,电脑也可以干一样的事情 从$x_1$到$x_n$一个一个得消去系数,然后倒着推回来 这里的问题很简单,不需要考虑自由元什么的 所以说搞就行了 在这里呢,我们把$1\rightarrow n$的系数依次搞成零 #include<iostream> 阅读全文
posted @ 2021-06-20 11:07 Simex 阅读(33) 评论(0) 推荐(0) 编辑
摘要: Aimee 按照依赖顺序建图后,显然可以发现一个递推的关系,如果一个点入度为零,那么它就可以完成 这样从入度为零的点开始更新,删边,并且在度数又为零后加入待处理的队列 #include<iostream> #include<cstdio> #include<algorithm> #include<q 阅读全文
posted @ 2021-06-03 14:34 Simex 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 静态查错指北 愿制约我们的只是代码能力 ###2020/9/26 可以注意,永远不要对于一个题同时采用两种思路,这样可能一个思路写了一半,最后挂掉 同上 一定要多想,多动笔,别口胡 出现了莫名奇妙无法编译 是不是拼错"main"了 写错数组名/变量名/函数名 奇怪的TLE,RE,MLE可以考虑 所谓 阅读全文
posted @ 2021-05-30 23:19 Simex 阅读(76) 评论(0) 推荐(0) 编辑
摘要: Aimee 显然可以证得,如果把所有可以交换的点之间连边,那么他们构成了联通块,对于每一个联通块,你可以让他们成为你想要的任何顺序 那就是找联通块,块内依次排序即可 #include<iostream> #include<cstring> #include<cstdio> #include<queu 阅读全文
posted @ 2021-05-30 23:06 Simex 阅读(1757) 评论(0) 推荐(0) 编辑
摘要: Aimee "Doctor,你觉得问题在哪" "就在这里" 不能摘得桃树没有意义,一次摘得消耗是一样得,而且把时间和体力的消耗是一样的,那么也不用开二维了,记得给他留一点体力就可以了 剩下的就是个多重背包 # include<iostream> #include<cstdio> #include<c 阅读全文
posted @ 2021-05-30 21:24 Simex 阅读(46) 评论(0) 推荐(0) 编辑
摘要: Aimee "Doctor,你这水平下降的有点。。。" '"我怎么知道能手残写了个return p" 很显然,那条路径一定在最大生成树上,然后在这条树上跑LCA即可 #include<iostream> #include<cstdio> #include<algorithm> #include<cs 阅读全文
posted @ 2021-05-30 20:06 Simex 阅读(39) 评论(0) 推荐(0) 编辑
摘要: ❤Aimee❤ 和普通的最短路相比,多了一个免费边的限制 可以考虑得到,如果没有免费边的话,其实也就都一样了,那么考虑只有一个免费边 我们使用了之后,是不是就相当与进入了一个新的(没有边可以免费的)图,在这张图上,就和原来一样跑最短路就可以了 推而广之,结合一下dp的思想,可以把图分成$k$层,每用 阅读全文
posted @ 2021-05-17 17:11 Simex 阅读(37) 评论(0) 推荐(0) 编辑
摘要: Aimee 模拟即可 #include<iostream> #include<algorithm> #include<cstring> #include<cstdio> using namespace std; int n,m,k,p; int a[110001]; int b[110001]; s 阅读全文
posted @ 2021-05-09 21:12 Simex 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Aimee 看起来就是个匹配问题 建模 超级源点和汇点是必须的,那么这样看来,我们把每个单位和每张桌子连一张容量为1的边,表示只能派一个人,超级源点和每个单位连对应人数的边,桌子同理,然后跑最大流并且检查最大流和人数就可以 #include<iostream> #include<cstdio> #i 阅读全文
posted @ 2021-05-09 20:02 Simex 阅读(39) 评论(0) 推荐(0) 编辑
摘要: Aimee 首先可以知道对于任意一个$a_i$,我们可以知道他的贡献在$[i,n]$ 那么对于每一次对于$ss_k$的查询,贡献是$(k-i+1)*a_i$ 分配一下,贡献是$a_i*(k+1)+a_i$,分别计算这两个就可以了 #include<iostream> #include<cstdio> 阅读全文
posted @ 2021-04-18 17:43 Simex 阅读(38) 评论(0) 推荐(0) 编辑
摘要: 游记这东西,有时候吧懒得写,可是不写,最后也就都忘了 你必须跳下悬崖,在堕落空中生出翅膀。 --雷-布拉德伯里 \(D0\) 上完了第三节课就走了,早晨带着行李箱上学感觉很蠢的样子,把行李箱选择塞进了最后的小桌子底下,亲爱的张克平爷爷还提醒我回来把卷子补上,上完物理人就没了,yyq早就去了机房,一路 阅读全文
posted @ 2021-04-11 23:01 Simex 阅读(68) 评论(0) 推荐(0) 编辑
摘要: Aimee 应该用线段树的,但是用树状数组就行 反正开方这个东西只能单点修改 最后用并查集优化一下 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> #define in 阅读全文
posted @ 2021-03-28 20:29 Simex 阅读(40) 评论(0) 推荐(0) 编辑
摘要: Aimee 这是一道分块好题 显然我们要分块,一开始我们要建立分块,在这里我们要统计的数据有:原序列,每个元素属于哪一个块,每一个块的左右边界,每一个块的lazy,块的总数。 由于这个题目的要求,我们还需要建立一个复制的块来排序,进行查询。 最后不成块元素单独成块。 void build() { b 阅读全文
posted @ 2021-03-28 17:33 Simex 阅读(53) 评论(0) 推荐(0) 编辑
摘要: Miku 悬线法: 对于每一个点,我们以这个点为矩形的最低点,然后向左右检查最大扩展位置,然后向上找在此情况下的最大高度 #include<cstdio> #include<algorithm> #include<cstring> #include<iostream> using namespace 阅读全文
posted @ 2021-03-14 14:45 Simex 阅读(57) 评论(0) 推荐(0) 编辑
摘要: Aimee 显然是可以继承的 #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<string> #include<algorithm> #include<cmath> using name 阅读全文
posted @ 2021-03-14 11:06 Simex 阅读(39) 评论(0) 推荐(0) 编辑
摘要: Aimee 因为可以堵出口和入口,所以只有 \({1,2,3}\) 那么先dfs一遍并且封锁路径,然后再dfs一遍 #include<iostream> #include<cstdio> #include<algorithm> #include<cstdio> #include<vector> us 阅读全文
posted @ 2021-03-07 21:41 Simex 阅读(51) 评论(0) 推荐(0) 编辑
摘要: [Aimee](P1855 榨取kkksc03) 很简单的dp #include<iostream> #include<cstring> using namespace std; int n,m,t; int mi[1000]; int ti[1000]; int dp[201][301][201] 阅读全文
posted @ 2021-03-07 11:26 Simex 阅读(63) 评论(0) 推荐(0) 编辑
摘要: Aimee 只要不能写成$2N N \subseteq N*$就肯定有 #include<iostream> #include<cstdio> #include<cmath> #define int long long using namespace std; int n,m; int prime[ 阅读全文
posted @ 2021-02-24 11:22 Simex 阅读(45) 评论(0) 推荐(0) 编辑
摘要: [Aimee](https://www.luogu.com.cn/problem/P1474) 显然是个背包 #include<iostream> #include<cstdio> #define int long long using namespace std; int n,v; int f[1 阅读全文
posted @ 2021-02-24 10:34 Simex 阅读(49) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 28 下一页