上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 18 下一页
摘要: 题意:第一行给定变量,第二行给定给定约束,每个约束包含两个变量, x y表示x>ch) ……#includeusing namespace std;#define inf 0x3f3f3f3f#define ll long longconst int maxn=200... 阅读全文
posted @ 2018-08-06 21:45 MCQ 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 题意:一笔画画出圣诞老人的房子,并按字典序输出。思路:从1点DFS遍历图(八条边需要9画)#includeusing namespace std;#define inf 0x3f3f3f3f#define ll long longconst int maxn=2000... 阅读全文
posted @ 2018-08-06 15:35 MCQ 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 题意:从一个素数变到另一个素数,中途只能改变一个位上的数而且改变后还是素数。方法:先打素数表,再BFS#include#include#include#include#include#include#include#include#include#include#in... 阅读全文
posted @ 2018-08-06 14:32 MCQ 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 算法思想:在一个有向图中,我们一定可以找到这样一个合理顺序,使得我们只需要按照这个顺序进行dfs遍历,那么每一次的dfs就可以使我们得到一个scc。合理顺序参考https://www.cnblogs.com/nullzx/p/6437926.html经过简单的分析我们... 阅读全文
posted @ 2018-08-05 13:31 MCQ 阅读(235) 评论(0) 推荐(0) 编辑
摘要: #include #include #include int mp[100][100];int visit[100];void dfs(int x,int n){ int i; visit[x]=1; for(i=1;i<=n;i++) { ... 阅读全文
posted @ 2018-08-05 13:08 MCQ 阅读(1771) 评论(0) 推荐(0) 编辑
摘要: 算法:dfn【u】为dfs遍历中u是第几个被访问到的。low【u】为该dfs u可以到达的访问时间最早的祖先的深度。首先,对图进行一次dfs遍历,可以得到每个点的dfn和low。考察所有点u和它在dfs树中的儿子节点s1,s2……sk。(1)如果对于某个si,满足lo... 阅读全文
posted @ 2018-08-04 21:36 MCQ 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 题意给你n个包含’(‘与’)’的字符串,可以将这些字符串任意排序,求所有排序中,子序列是正规括号序列的最大长度。题解参考大佬https://blog.csdn.net/ACTerminate/article/details/81171799首先我们对所有的字符串找到通... 阅读全文
posted @ 2018-07-31 20:27 MCQ 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 6-7 在一个数组中实现两个堆栈(20 分)本题要求在一个数组中实现两个堆栈。函数接口定义:Stack CreateStack( int MaxSize );bool Push( Stack S, ElementType X, int Tag );ElementTyp... 阅读全文
posted @ 2018-07-29 19:56 MCQ 阅读(1176) 评论(0) 推荐(0) 编辑
摘要: 6-5 链式表操作集(20 分)本题要求实现链式表的操作集。函数接口定义:Position Find( List L, ElementType X );List Insert( List L, ElementType X, Position P );List Dele... 阅读全文
posted @ 2018-07-28 22:00 MCQ 阅读(655) 评论(0) 推荐(0) 编辑
摘要: 6-2 顺序表操作集(20 分)本题要求实现顺序表的操作集。函数接口定义:List MakeEmpty(); Position Find( List L, ElementType X );bool Insert( List L, ElementType X, Pos... 阅读全文
posted @ 2018-07-27 10:47 MCQ 阅读(374) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 18 下一页