摘要: #include using namespace std; int pre[1010]; bool t[1010];//t 用于标记独立块的根结点 int find(int x)//查找根节点 { int r=x; while(pre[r]!=r) r=pre[r];//返回根节点 r int i=x,j; while(pre[i... 阅读全文
posted @ 2019-01-25 23:37 DWVictor 阅读(239) 评论(0) 推荐(0) 编辑
摘要: int T[maxn],a[maxn]; void build(int rt,int l,int r){ if(l == r){ T[rt] = a[l]; return; } int mid = l+r >> 1; build(rt<<1,l,mid); build(rt<<1|1,mid+1,r 阅读全文
posted @ 2019-01-25 21:20 DWVictor 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 一、概念 从n个不同元素中任取m(m≤n)个元素,按照一定的顺序排列起来,叫做从n个不同元素中取出m个元素的一个排列。当m=n时所有的排列情况叫全排列。如果这组数有n个,那么全排列数为n!个。 比如a,b,c的全排列一共有3!= 6 种 分别是{a, b, c}、{a, c, b}、{b, a, c 阅读全文
posted @ 2019-01-25 16:59 DWVictor 阅读(1336) 评论(0) 推荐(1) 编辑
该文被密码保护。 阅读全文
posted @ 2019-01-25 16:50 DWVictor 阅读(8) 评论(0) 推荐(0) 编辑