上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 28 下一页
摘要: Aimee 鉴于本人代码一开始写得非常不美观 所以说一堆特判 边界是$a+b-2<=$且$K!=0$时不存在 然后一堆特殊情况 #include<iostream> #include<cstdio> #include<cstring> int a,b,k,z; using namespace std 阅读全文
posted @ 2021-02-24 09:14 Simex 阅读(48) 评论(0) 推荐(0) 编辑
摘要: Aimee 非常显然 #include<iostream> #include<cstring> using namespace std; int n; int h[1000001]; long long dp[1000001][2]; int main(){ cin>>n; memset(dp,0x 阅读全文
posted @ 2021-02-23 15:33 Simex 阅读(55) 评论(0) 推荐(0) 编辑
摘要: Aimee 一道非常水的分组背包求方案数 字典序这个东西要谨慎处理 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int n,m; int dp[20][2 阅读全文
posted @ 2021-02-23 15:08 Simex 阅读(58) 评论(0) 推荐(0) 编辑
摘要: AImee \(dp_{i,j}表示第i天到达第j个城市\) 反正是线性的,那么要不是早就到了j在那休息,要不就是上一天从上一座城市过来 #include<iostream> #include<cstdio> #include<cstring> using namespace std; int d[ 阅读全文
posted @ 2021-02-22 18:13 Simex 阅读(60) 评论(0) 推荐(0) 编辑
摘要: Aimee 这是个dp?不过没有必要用dp 毕竟显然距离为2中间一定要经过一个点,那枚举中间点即可 之后显然假设一个点所有相邻的点的点权为集合$A= { a_1,a_2,a_3······a_k}$ 显然对于这个点,和就是$\sum_{1} \sum_{1} a_i*a_j |i!=j$ 那么这样上 阅读全文
posted @ 2021-02-21 20:54 Simex 阅读(71) 评论(0) 推荐(0) 编辑
摘要: Aimee 很显然的区间dp 字符和数字之间使用map大法进行转换即可 经典边界问题以及一点点暴力判断和优化 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<map> using n 阅读全文
posted @ 2021-02-21 20:35 Simex 阅读(53) 评论(0) 推荐(0) 编辑
摘要: Aimee 这么个线段树版子还要解释 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #define int long long using namespace std; int n,m; int f 阅读全文
posted @ 2021-02-21 20:33 Simex 阅读(59) 评论(0) 推荐(0) 编辑
摘要: Aimee 很好想的是$f_{i,j}$表示到第i个时公差为j,显然j不需要枚举,因为无论如何都会枚举i之前的电塔的,那样的话知道了电塔也就知道的公差了 转移的时候由于边界不太好考虑,那就先不考虑单元素了 所以从2开始枚举然后边枚举边统计,最后加上n #include<iostream> #incl 阅读全文
posted @ 2021-02-21 16:24 Simex 阅读(48) 评论(0) 推荐(0) 编辑
摘要: Aimee 最小费用是最大流基础上的 那么就用spfa代替Ek的bfs就行 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<queue> using namespace std; i 阅读全文
posted @ 2021-02-21 14:56 Simex 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 根据konig定理可知 最大匹配数=最大流=最小割=最小点集覆盖 那么这个题就是一个最大流问题了 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<queue> using names 阅读全文
posted @ 2021-02-21 11:49 Simex 阅读(36) 评论(0) 推荐(0) 编辑
摘要: 加错边权了 最大流==最小割,毋庸置疑 但是这个题删的是点怎么办 那就把每一个点拆成两个,一入一出,然后中间连一条流量为1的边,图上原有的为inf 源点和汇点则大小也为inf 不能删啊 #include<iostream> #include<cstdio> #include<algorithm> # 阅读全文
posted @ 2021-02-21 10:32 Simex 阅读(61) 评论(0) 推荐(0) 编辑
摘要: Aimee 跳出来重新审视未注意的细节 就是输出整数aaa [斜率优化解释](https://www.luogu.com.cn/blog/hhz6830975/p3195-hnoi2008-wan-ju-zhuang-xiang-toy-xie-shuai-you-hua-ru-men-post) 阅读全文
posted @ 2021-02-21 10:21 Simex 阅读(49) 评论(0) 推荐(0) 编辑
摘要: Aimee 矩阵加速递推的模板了。 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #define int long long #define ll long long using names 阅读全文
posted @ 2021-02-21 10:17 Simex 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 矩阵乘法板子 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #define int long long #define ll long long using namespace std; const 阅读全文
posted @ 2021-02-21 08:32 Simex 阅读(69) 评论(0) 推荐(0) 编辑
摘要: Aimee 很水的题目 #include<iostream> using namespace std; int n; int mod=100003; int m; int x,y; int map[1001][1001]; long long dp[1001][1001]; int main(){ 阅读全文
posted @ 2021-02-20 20:32 Simex 阅读(75) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include //#define int long long using namespace std; struct Matrix{ int rec[40][40]; } uni,a; struct Ma2{ Matrix rec[5][5] 阅读全文
posted @ 2021-02-20 19:56 Simex 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 这个问题怎么搞呢 显然是个递推式,可是有个$i^4$ 把它展开,就可以完全递推了。 关于递推式的一点点理解 首先把需要递推的东西列为一列,不妨记长度为L,另外一边可以搞一个对应的L*L的矩阵(先前矩阵其余部分用0填充) 其中每一行的每一个数也就对应的那一列中的元素的系数。 如此如此,这般这般。 矩阵 阅读全文
posted @ 2021-02-20 16:24 Simex 阅读(28) 评论(0) 推荐(0) 编辑
摘要: Aimee 首先的问题,如果这个题是无向图怎么搞,显然dp[i][j]表示到点i走了j步就可以了。 但是这是无向图啊,怎么搞呢 那就统计一下从那条边来的,也就是i表示从i边结束 然后暴力转移显然,但是tle起飞 显然可以用矩阵优化一下。 下标很重要,因为矩阵乘法的美妙性质。 最后的统计的时候正难则反 阅读全文
posted @ 2021-02-20 11:50 Simex 阅读(48) 评论(0) 推荐(0) 编辑
摘要: Aimee 把马路竖起来,横轴是时间 那么显然扫过的面积就是遮挡的水量 之后就是计算几何的事了 #include<iostream> #include<cstdio> #include<algorithm> #include<cstdio> #include<cstring> using names 阅读全文
posted @ 2021-02-08 10:58 Simex 阅读(78) 评论(0) 推荐(0) 编辑
摘要: Aimee 数据很小,直接爆搜 唯一麻烦的是检查是否重叠以及计算面积 但问题也不大 记得剪枝 #include<iostream> #include<cstdio> #include<algorithm> #include<cstdio> #include<cstring> using namesp 阅读全文
posted @ 2021-02-07 20:45 Simex 阅读(196) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 28 下一页