摘要:
Problem IFRIENDSThere is a town with N citizens. It is known that some pairs of people are friends. According to the famous saying that “The friends of my friends are my friends, too” it follows that if A and B are friends and B and C are friends then A and C are friends, too.Your task is to count h 阅读全文
posted @ 2012-12-07 19:21
cainiaozr
阅读(214)
评论(0)
推荐(0)
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2012-12-07 17:53
cainiaozr
阅读(2)
评论(0)
推荐(0)
摘要:
UVA OJ 12289One-Two-ThreeDecember 6, 2012One-Two-ThreeYour little brother has just learnt to write one, two and three, in English. He has written a lot of those words in a paper, your task is to recognize them. Note that your little brother is only a child, so he may make small mistakes: for each wo 阅读全文
posted @ 2012-12-07 17:51
cainiaozr
阅读(137)
评论(0)
推荐(0)
摘要:
DFS( G)1. for each vertex u in V(G)2. do color[u]=WHITE3. pi[u]=NIL4. time=05. for each vertex u in V(G)6. do if color[u]=WHITE7. then DFS-VISIT(u)DFS-VISIT(u)1. color[u]=GRAY2. time++;3. d[u]=time;4. Stack S;5. S.push(u);6. while( !S.empty())7. w=S.top();8. bool bl=t... 阅读全文
posted @ 2012-12-07 17:46
cainiaozr
阅读(122)
评论(0)
推荐(0)
浙公网安备 33010602011771号