题目链接: poj2762 题意: 给出一幅单向图.问这张图是否满足   随意两点ab 都能 从a到达b 或  从b到达a 题解思路: 推断一幅图是否满足弱连通 首先想到的是将图中的 强连通分量(能互相到达的顶点集)  进行缩点 然后再依据原有边 又一次建图 假设缩点后的图是一条单链(回路,通路都能够)   则一定满足弱连通 推断是否是一条单链 能够依据建图过程中得到 入度 出度 数组进行推断 某点的入度 或 出度假设大于1则一定不是单链 另外单链仅仅能有一条  不能有多个点入度=0 代码: #…
判断图是否单连通,先用强连通分图处理,再拓扑排序,需注意: 符合要求的不一定是链拓扑排序列结果唯一,即在队列中的元素始终只有一个 #include<cstdio> #include<iostream> #include<cstdlib> #include<cstring> #include<string> #include<algorithm> #include<map> #include<queue> #in…
这道题要判断一张有向图是否是单连通图,即图中是否任意两点u和v都存在u到v或v到u的路径. 方法是,找出图中所有强连通分量,强连通分量上的点肯定也是满足单连通性的,然后对强连通分量进行缩点,缩点后就变成DAG. 现在问题就变成,如何判断DAG是否是单连通图——用拓扑排序——如果拓扑排序过程中出现1个以上入度为0的点那就不是单连通图,因为有2个入度0的点,那这两个点肯定都无法到达对方. 另外,注意题目没说给的图是连通的!.. #include<cstdio> #include<cstrin…
转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud     Going from u to v or from v to u? Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 14778   Accepted: 3911 Description In order to make their sons brave, Jiajia and Wind take t…
Going from u to v or from v to u? Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 13040   Accepted: 3383 Description In order to make their sons brave, Jiajia and Wind take them to a big cave. The cave has n rooms, and one-way corridors…
Description In order to make their sons brave, Jiajia and Wind take them to a big cave. The cave has n rooms, and one-way corridors connecting some rooms. Each time, Wind choose two rooms x and y, and ask one of their little sons go from one to the o…
v$database: 视图结构: SQL> desc v$database; Name                                      Null?    Type ----------------------------------------- -------- ------------------------------------------------------------------------- DBID                         …
     Going from u to v or from v to u? Time Limit: 2000MS   Memory Limit: 65536K       Description In order to make their sons brave, Jiajia and Wind take them to a big cave. The cave has n rooms, and one-way corridors connecting some rooms. Each tim…
SQL> select username,user,segtype,segfile#,segblk#,extents,segrfno# from v$sort_usage; SEGFILE#代表的是绝对文件号(AFN),对应x$kcctf表中的TFAFN(temp file absolute file number). SQL> select indx,tfnum,tfafn,tfcsz from x$kcctf; TFCSZ 是创建临时文件的块数 查看临时文件的绝对文件号 select tf…
Going from u to v or from v to u? Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 17089   Accepted: 4590 Description In order to make their sons brave, Jiajia and Wind take them to a big cave. The cave has n rooms, and one-way corridors…