| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 377 人关注过本帖
标题:用c\c++编写
只看楼主 加入收藏
小雪人
Rank: 1
等 级:新手上路
帖 子:5
专家分:3
注 册:2007-9-1
收藏
 问题点数:0 回复次数:1 
用c\c++编写
        The Coolest Search Engine


DescriptionThe Coolest Search Engine came out. It aggregates the ranks of all the well-known search engines and generate the coolest rank. How to decide a aggregated rank is the coolest acording to some ranks?Given a universe U, we just call an ordered sequence A containing all the elements in U as a list. And A(i) denote the rank of the ith element.Then we define SF distance between two lists. Formally, given two lists A and B, the SF distance between A and B is given byAnd the SF distance between A and some lists B1 ... Bm is given by Given some lists B1 ... Bm, A is the coolest aggregated rank if it has the least SF distance to B1 ... Bm.InputThe first line is the number of test cases c(1 ≤ c ≤ 100). The first line of each test case contains two integer n (1 ≤ n ≤ 100) and m(1 ≤ m ≤ 100) indicating the number of elements in U and the number of search engines. The following m lines each contains a sequence of n different integers, B(1) B(2) ... B(n)(0 ≤ B(i) ≤ n-1), indicating the rank result of one search engine.OutputFor each input test case, print the SF distance between the coolest aggregated rank and the given ranks.Sample Input2
3 2
0 1 2
0 2 1
3 2
0 1 2
2 1 0
Sample Output2
4
搜索更多相关主题的帖子: 编写 
2009-09-13 15:54
NoSoul
Rank: 9Rank: 9Rank: 9
来 自:沈阳化工大学
等 级:蜘蛛侠
帖 子:283
专家分:1010
注 册:2009-6-6
收藏
得分:0 
回复 楼主 小雪人
能翻译一下吗?(英文基础不好)

我想伸手拉近點,竟觸不到那邊,就欠一點點,但這一點點...卻好遠
2009-09-14 10:39
快速回复:用c\c++编写
数据加载中...
 
   



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

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