| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 562 人关注过本帖
标题:acm的题!做做看下!
只看楼主 加入收藏
lianxinkai
Rank: 1
等 级:新手上路
帖 子:41
专家分:0
注 册:2006-3-3
收藏
 问题点数:0 回复次数:0 
acm的题!做做看下!

Travel
Time Limit : 1 seconds Memory Limit : 10MB

Tracy is employed to be a tour guide in a beautiful small town. The small town has n scenic spots; some of them are connected by paths. You can reach any spots from any spots. Tracy’s tourists are quite choosy: they didn’t want to be same with others. That means, every tourist wants his or her route to have a unique path compared with others. A route is made by paths from one spot to another, starts from one spot and return to the same spot without using the same path twice. So Tracy wants to know how many satisfied route this town has at most so that she can determine how many tourist she can take in. Can you help her?

Input:

The input file contains several test cases. For each test case:

The first line contains two numbers n(1<=n<=100000), m(1<=m<=n*(n-1)/2), standing for the number of spots and the number of paths. Then the following m lines: Each of the following m lines contains 2 number x, y(1<=x,y<=n), means there is a two-way path between spot x and spot y.

The size of the input file will be less than 2M.

Output:

only one number, the number of different route.

Sample Input:

5 7
1 2
1 3
1 4
2 4
2 3
3 4
5 4
Sample Output:

3

搜索更多相关主题的帖子: acm spots route Limit town 
2006-10-21 13:49
快速回复:acm的题!做做看下!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024565 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved