上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 35 下一页
摘要: 题:https://ac.nowcoder.com/acm/contest/5666/A 题意:给定字符串,依题意求出每个后缀串的B数组,然后进行字典序排序 分析:直接通过1~n串的B数组,我们无法根据当前的B数组来推出其他后缀的B数组,如果可以则直接后缀数组即可; 通过观察,我们可以设立一个R[i 阅读全文
posted @ 2020-07-16 21:12 starve_to_death 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 题:https://ac.nowcoder.com/acm/contest/5666/I 题意:挑选边,让点的度数满足d数组,1<=du[i]<=2 分析:di为1时就是普通的一般图匹配,而考虑di为2的情况,将度为2的点拆成2个点,同时将边也当作点来拆成2个点,连u-e,u‘-e,e-e’,v-e 阅读全文
posted @ 2020-07-16 11:34 starve_to_death 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 题:https://ac.nowcoder.com/acm/contest/5667/I 题意:最初的区间为[1,n],给定可供选择且有代价的区间变换限制,求最小代价选择让初始区间不变为l==r或输出-1表示不能达到 分析: 把[l,r]区间转化为网格图上的(l,r),区间变化则为网格图上边的容量; 阅读全文
posted @ 2020-07-15 23:40 starve_to_death 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 对偶图学习:https://blog.csdn.net/MaxMercer/article/details/77976666 https://blog.csdn.net/MaxMercer/article/details/77977447 题:https://www.luogu.com.cn/pro 阅读全文
posted @ 2020-07-15 20:25 starve_to_death 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 题:https://ac.nowcoder.com/acm/contest/5667/H 题意:给定空的容器multiset:MS,有q个操作,操作一为向MS中加入x,操作二为在MS删除x,操作三为询问在MS是否存在a,b与x能形成一个不退化的三角形。 分析:对于询问操作,有俩种情况,情况一是x作为 阅读全文
posted @ 2020-07-15 13:46 starve_to_death 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 题:https://ac.nowcoder.com/acm/contest/5667/A 题意:给定n个串,主要求每个串和n个中的每一个串的最大相同公共前后缀的长度,然后计算题目给式子 分析:对于n个串的后缀,我们考虑用哈希值来代表,最多共有1e6个值(sum(|si|)),预处理这部分,用map记 阅读全文
posted @ 2020-07-15 00:29 starve_to_death 阅读(232) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; #define pb push_back typedef long long ll; typedef unsigned long long ull; const int M=1e5+5; const int P 阅读全文
posted @ 2020-07-14 23:51 starve_to_death 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 题:https://ac.nowcoder.com/acm/contest/5667/G 题意:给定n个数的数组A,m个数的数组B,问在A中有多少个子数组满足Si>=Bi 分析:我们可以考虑记录合法子数组以数组A中的一个位置代表一个合法子数组(因为长度固定为m); 设bitset 的ans和tmp, 阅读全文
posted @ 2020-07-14 16:07 starve_to_death 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 题:https://ac.nowcoder.com/acm/contest/5667/J 题意:要求构造出序列P,让初始排列A={1,2,3,4....n}依照P序列跳转k次后得到给定排列。 分析:简单分析可发现,若存在合法情况的话,跳转的过程肯定在若干个简单环上; 我们可以简单模拟,设每个环大小为 阅读全文
posted @ 2020-07-14 14:19 starve_to_death 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 题:https://ac.nowcoder.com/acm/contest/5667/C 题意:选最少数量的“链”来覆盖整颗树,使树的每条边都至少被覆盖一次 分析:关键是理解证明过程: : #include<bits/stdc++.h> using namespace std; #define pb 阅读全文
posted @ 2020-07-14 14:07 starve_to_death 阅读(326) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 35 下一页