| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2843 人关注过本帖
标题:求解这类题 没看懂
只看楼主 加入收藏
xmzyjr
Rank: 1
等 级:新手上路
帖 子:9
专家分:8
注 册:2015-11-21
结帖率:0
收藏
已结贴  问题点数:10 回复次数:5 
求解这类题 没看懂
问题描述:
As the increase of population, the living space for people is becoming smaller and smaller. In MagicStar the problem is much worse. Dr. Mathematica is trying to save land by clustering buildings and then we call the set of buildings MagicBuilding. Now we can treat the buildings as a square of size d, and the height doesn't matter. Buildings of d1,d2,d3....dn can be clustered into one MagicBuilding if they satisfy di != dj(i != j).
Given a series of buildings size , you need to calculate the minimal numbers of MagicBuildings that can be made. Note that one building can also be considered as a MagicBuilding.
Suppose there are five buildings : 1, 2, 2, 3, 3. We make three MagicBuildings (1,3), (2,3), (2) .And we can also make two MagicBuilding :(1,2,3), (2,3). There is at least two MagicBuildings obviously.
输入:
The first line of the input is a single number t, indicating the number of test cases.
Each test case starts by n (1≤n≤10^4) in a line indicating the number of buildings. Next n positive numbers (less than 2^31) will be the size of the buildings.
输出:
For each test case , output a number perline, meaning the minimal number of the MagicBuilding that can be made.
输入:
2
1
2
5
1 2 2 3 3
输出:
1
2
搜索更多相关主题的帖子: becoming increase problem living people 
2016-04-03 23:25
qq1023569223
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
来 自:湖南科技大学
等 级:贵宾
威 望:26
帖 子:2753
专家分:13404
注 册:2010-12-22
收藏
得分:4 
我也看不明白!!!

   唯实惟新 至诚致志
2016-04-04 00:16
mk_zhou
Rank: 2
来 自:历代兵家必争之地
等 级:论坛游民
威 望:1
帖 子:78
专家分:83
注 册:2015-6-30
收藏
得分:4 
你应该先翻译下再来求助

仰望星空,看看有没有馅饼落下
2016-04-04 01:58
zhulei1978
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:53
帖 子:1351
专家分:1200
注 册:2006-12-17
收藏
得分:4 
那个MagicBuildings是魔法屋的意思吗

其实我就是改变社会风气,提高少女素质,刺激电影市道,提高年轻人内涵,玉树临风,风度翩翩的整蛊专家,我名叫古晶,英文名叫JingKoo!
2016-04-04 10:33
xmzyjr
Rank: 1
等 级:新手上路
帖 子:9
专家分:8
注 册:2015-11-21
收藏
得分:0 
由于人口的增加,人们对生活空间变得越来越小。在MagicStar问题更糟。数学博士正试图通过聚类建筑节约土地,然后我们所说的一套建筑MagicBuilding的。现在我们可以把建筑物作为尺寸d的正方形,高度无关紧要。d1的建筑物,D2,D3.... DN可以,如果它们满足di!= dj(ⅰ!= j)条聚为一MagicBuilding。
鉴于一系列的建筑规模,你需要计算可以作出神奇建筑的最小的数字。注意,一个建筑物也可以被认为是一个MagicBuilding。
假设有五幢建筑:1,2,2,3,3,我们提出三点魔术建筑物(1,3),(2,3),(2)。而我们也可以提出两个MagicBuilding:(1,2, 3),(2,3)。有至少两个MagicBuildings明显。
2016-04-04 11:45
xmzyjr
Rank: 1
等 级:新手上路
帖 子:9
专家分:8
注 册:2015-11-21
收藏
得分:0 
输入的第一行是一个单一的号t,指示测试用例的数目。
每个测试情况下,由在指示建筑物的数目的n行(1≤n≤10^ 4)开始。下n的正数(小于2 ^ 31)将作为建筑物的大小。
2016-04-04 11:46
快速回复:求解这类题 没看懂
数据加载中...
 
   



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

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