世界真的很大
今天考试本来是水题欢乐AK赛,但是失败了
以为是写挂了其实是死路就错了。。
下午准备了一下课件,然后晚上继续复习图论
tarjan这一块儿强连通还是比较熟悉,但是两种双连通就不是很熟了
复习一波“桥”和“割点”的求法
向NOIP2017加油!
看题先:
description:
给你一个N个点和M条边的无向图,让你确定边的方向将图变成强连通。若无法确定某条边的方向使图变成强连通可以正反向输出这条边 以代表两条 有向边。
input:
The input consists of a number of cases. The first line of each case contains two integers n and m. The number of intersections is n (2 <= n <= 1000), and the number of streets is m. The next m lines contain the intersections incident to each of the m streets. The intersections are numbered from 1 to n, and each street is listed once. If the pair i j is present, j i will not be present. End of input is indicated by n = m = 0.
output:
For each case, print the case number (starting from 1) followed by a blank line. Next, print on separate lines each street as the pair i j to indicate that the street has been assigned t