上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 28 下一页
摘要: Aimee 非常简单 运用一点点的数学知识算出两两之间的距离 然后跑最短路 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> using namespace std; i 阅读全文
posted @ 2021-02-06 19:35 Simex 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Aimee 可以用网络流解决 建超级源点与超级汇点,源点与所有的外籍飞行员相连,容量为1(顶多选一人一次) 超级汇点同理,容量还是1,而飞行员之间的点就可以使大于等于1的任意数 顶多只有1的流量 最后所有漫流的边即为方案 方案书就是最大流 #include<iostream> #include<cs 阅读全文
posted @ 2021-02-04 11:50 Simex 阅读(240) 评论(0) 推荐(0) 编辑
摘要: Aimee 显然这是一个网络流 一开始,我们大可以随便找一条可行流 然后再找一条,可是如果要返回怎么办?可以建立对应的反向边,反向边的容量即即为正向边流量,构成残余网络,在残余网络上找到的从s$\rightarrow$t的路径,就是一条可行流,并且,找到最大流的充要条件是它的对应残余网络没有增广路 阅读全文
posted @ 2021-02-04 11:34 Simex 阅读(76) 评论(0) 推荐(0) 编辑
摘要: Aimee 显然这是一个网络流 一开始,我们大可以随便找一条可行流 然后再找一条,可是如果要返回怎么办?可以建立对应的反向边,反向边的容量即即为正向边流量,构成残余网络,在残余网络上找到的从s$\rightarrow$t的路径,就是一条可行流,并且,找到最大流的充要条件是它的对应残余网络没有增广路 阅读全文
posted @ 2021-02-04 11:16 Simex 阅读(69) 评论(0) 推荐(0) 编辑
摘要: Aimee 真不知道和dp有啥关系 两个关键值,区间和和区间最小值 那么直接左右扩展一个点能作为最小值的最大区间(反正是正整数) 然后算就行了 #include<iostream> #include<cstdio> #include<algorithm> using namespace std; t 阅读全文
posted @ 2021-02-04 08:41 Simex 阅读(99) 评论(0) 推荐(0) 编辑
摘要: Aimee 马拉车算法,以优秀复杂度求解回文子串 我认为的关键:减少重复计算 用r表示当前已知回文子串右边界,id表示其中心的位置 显然我们当下求解的i应该再id右边 如果这个i在r的左边,那么显然在id的中心中,因该有一个关于i的对称点,并且因为位置的的原因,左边点的回文是已经被算出来了的,那样可 阅读全文
posted @ 2021-02-02 17:13 Simex 阅读(34) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include using namespace std; int c[5]; int n,m; int a[10001]; int x; int dp[41][41][41][41]; int find(int i,int j,int k,in 阅读全文
posted @ 2021-02-02 11:14 Simex 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Aimee 想出状态转移的难度很小 很强的题解 #include<iostream> #include<cstdio> #include<cmath> #include<algorithm> #include<cstring> using namespace std; const int maxn= 阅读全文
posted @ 2021-02-02 10:18 Simex 阅读(58) 评论(0) 推荐(0) 编辑
摘要: Aimee 打着期望dp的名字推式子 这位大佬写的非常好 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> using namespace std; int t; int 阅读全文
posted @ 2021-02-01 23:09 Simex 阅读(47) 评论(0) 推荐(0) 编辑
摘要: Aimee 很显然的状压dp $f_{i,j}$表示在i这个集合,最后停在了j时的最小长度 转移就行了 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; int 阅读全文
posted @ 2021-02-01 20:05 Simex 阅读(61) 评论(0) 推荐(0) 编辑
摘要: Aimee 讨厌之处在于要求花费 花费可以视为上次花费+1 和次数相等 先考虑次数 \(f_i=\frac{n-i}{n}*f_{i+1}+\frac{i}{n}*f_i+1=f_{i+1}+\frac{n}{n-i}\) 那么期望呢 \(g_i=\frac{i}{n}*(g_i+f_i+1)+\f 阅读全文
posted @ 2021-02-01 18:42 Simex 阅读(68) 评论(0) 推荐(0) 编辑
摘要: Aimee 除了那个概率有点长以外没有什么难的 \(f_i=p*f_{i+1}+(1-p)*f_i+1=\frac{f_{i+1}+1}{p}\) 其中$p=\frac{2*(n-1)i}{n(n-1)}$ #include<iostream> #include<cstdio> #include<a 阅读全文
posted @ 2021-02-01 15:12 Simex 阅读(88) 评论(0) 推荐(0) 编辑
摘要: Aimee 转移方程很好想$dp_{i,0/1}$表示第i个选(1)或不选(0) 其中$dp_{i,0}=max(dp_{i-1,0},dp_{i-1,1})$ 而$dp_{i,1}=max(dp[j]+sum_i-sum_j),i-j<=k$ 都有$sum_i$,那就成了$dp_{i,1}=max 阅读全文
posted @ 2021-02-01 12:58 Simex 阅读(52) 评论(0) 推荐(0) 编辑
摘要: Aimee' 这个题目还是很简单的 \(dp_i=\frac{i}{n}*dp_i+1\) 移个项就行了 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; in 阅读全文
posted @ 2021-02-01 08:20 Simex 阅读(63) 评论(0) 推荐(0) 编辑
摘要: Aimee 做了一下午期望dp 终于一遍过zi 转移的方式很好想 但是瞬移怎么解决,既然瞬移是直接到头的话,并且保证出发点不相同 的话,那么并查集完成瞬移操作 #include<iostream> #include<cstdio> #include<algorithm> #include<cstri 阅读全文
posted @ 2021-01-31 19:19 Simex 阅读(49) 评论(0) 推荐(0) 编辑
摘要: Aimee 转态转移非常好想 状态压缩一下。然后倒着转移 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; double dp[1<<21]; int n; d 阅读全文
posted @ 2021-01-31 16:45 Simex 阅读(53) 评论(0) 推荐(0) 编辑
摘要: Aimee 很简单的期望dp 众所周知,期望一般倒着推,因为唯一已知的状态是$f_{r,c}$=0 定义 \(f_{ij}\) 表示到达i,j之后到达终点的期望 转移方程$f_{i,j}=f_{i+1,j}*p_{i,j,2}+f_{i,j+1}*p_{i,j,3}+f_{i,j}*f_{i,j}+ 阅读全文
posted @ 2021-01-31 16:35 Simex 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Aimee #很水的小题目 写这个不是因为我做完了题目 而是因为考完试了 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; int n; int t; int 阅读全文
posted @ 2021-01-27 19:55 Simex 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Aimee 思维难度没有 唯一的剪枝就是从0少的列开始搜索 记录下所有能放的点的坐标,按顺序搜索 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; struct 阅读全文
posted @ 2021-01-12 23:47 Simex 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Aimee 很水的题目 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; int mx[5]={0,1,-1,0,0}; int my[5]={0,0,0,-1 阅读全文
posted @ 2021-01-10 17:51 Simex 阅读(51) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 28 下一页