雕刻时光

just do it……nothing impossible
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年12月1日

摘要: http://poj.org/problem?id=3272由于数据顶点5000,边50000所以用静态链表出度为0有多个,入度为0的点有一个用f[i]表示i到出度为0的点 的边 有几条g[j]表示j到入度为0的点 的边 有几条两次dfs一条边的起点qi,终点end结果Max=max(f[qi]*g[end])注意点:重边有效View Code #include<stdio.h>#include<iostream>#include<string.h>using namespace std;const int N=5009;struct data{ int x 阅读全文

posted @ 2011-12-01 22:02 huhuuu 阅读(305) 评论(2) 推荐(0) 编辑