标题:C语言新人求助两道题。。没什么思路
只看楼主
LeslieCh
Rank: 1
等 级:新手上路
帖 子:33
专家分:0
注 册:2013-11-27
结帖率:77.78%
已结贴  问题点数:30 回复次数:14 
C语言新人求助两道题。。没什么思路
2441: Time Stop
Time Limit: 1 Sec  Memory Limit: 64 MB
Submit: 3511  Solved: 1075

Description
Faceless Void(JBL) is a hero in dota game. His ult is Time Stop. It makes a space(a circle of radius R) that all units in it will stop. The question is wether can JBL choose a position to release Time Stop cause all enemy units stop.


Input
The first line is integer T(T <= 50), the number of test cases.The first line fo each test case is two integers n(0 < n <= 100), R(0 <= R <= 10000), the number enemy units and the Radius of Time Stop.Then n lines, each line contains two integer x and y (-1000 <= x,y <= 1000), means the position of a enemy unit.
Output
For each case output Yes if JBL can stop all enemy units, otherwise print No.Pay attention to the output format.
Sample Input
2
5 1
0 0
0 1
1 0
1 1
2 2
5 2
0 0
0 1
1 0
1 1
2 2

Sample Output
Case #1: No
Case #2: Yes
HINT



2442: Requiem of Souls
Time Limit: 1 Sec  Memory Limit: 64 MB
Submit: 2478  Solved: 1018

Description
Nevermore is a terrible monster. When he kill a life, he will absorb its soul to improve his strength.And his ult called Requiem of Souls, is very fierce and cruel. Evil spirit will be summoned to attack nearby enemy units.The damage is related to the distance to nevermore.


To simplify the problem we assume that all enemy unit are on the x-axis. The damage is A - D, A is the initial damage, D is the distance to nevermore.Nevermore can choose anywhere to release his ult as he has a blink dagger. Your task is to call the minimum initial damage A Nevermore need to kill all enemy units by release Requiem of Souls once.(If a unit's HP less than or equal to zero, it will die.)
Input
The first line is integer T(T <= 20), the number of test cases.The first line of each case contains a integer n (0 < n <= 10^5), the number of enemy units.Then n lines, each line contains two integer a, b(0 < a, b < 10^8), a is the enemy unit's location, b is the enemy unit's HP.
Output
For each case, output the minimum initial damage in the sample output format.
Sample Input
3
1
1 1
2
1 1
2 1
2
1 1
2 2

Sample Output
Case #1: 1.00
Case #2: 1.50
Case #3: 2.00


HINT

这两题要怎么做。。?求教
搜索更多相关主题的帖子: position question release Memory number 
2013-12-06 16:48
LeslieCh
Rank: 1
等 级:新手上路
帖 子:33
专家分:0
注 册:2013-11-27
得分:0 
.
2013-12-06 17:08
pangshch
Rank: 10Rank: 10Rank: 10
等 级:青峰侠
威 望:2
帖 子:443
专家分:1966
注 册:2013-4-9
得分:0 
DOTA都出来了???
让我不禁想起:
DOTA毁一生,
网游穷三代;
天天上自习,
必成高富帅.
2013-12-06 17:22
pangshch
Rank: 10Rank: 10Rank: 10
等 级:青峰侠
威 望:2
帖 子:443
专家分:1966
注 册:2013-4-9
得分:0 
第一题的输出是不是错了?
第二次输入
5 2
0 0
0 1
1 0
1 1
2 2
结果应该是NO!
你的怎么是YES!????
2013-12-06 17:38
pangshch
Rank: 10Rank: 10Rank: 10
等 级:青峰侠
威 望:2
帖 子:443
专家分:1966
注 册:2013-4-9
得分:0 
还有影魔!!!!!!!!!
2013-12-06 17:41
pangshch
Rank: 10Rank: 10Rank: 10
等 级:青峰侠
威 望:2
帖 子:443
专家分:1966
注 册:2013-4-9
得分:0 

还有跳刀!!!!!!!!!!!!!!!!
2013-12-06 17:46
so_love
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:蒙面侠
威 望:7
帖 子:812
专家分:4151
注 册:2013-11-25
得分:0 

一花一世界、一叶一追寻、片片花叶落、情系何人身。
2013-12-06 17:53
clownsmail
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2013-12-7
得分:0 

怀念 ,一种坚强 !
2013-12-07 14:15
韶志
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
来 自:斗气大陆
等 级:贵宾
威 望:44
帖 子:2223
专家分:13592
注 册:2013-3-22
得分:0 
看不懂鸟语啊...

三十年河东,三十年河西,莫欺少年穷!
2013-12-07 14:37
pangshch
Rank: 10Rank: 10Rank: 10
等 级:青峰侠
威 望:2
帖 子:443
专家分:1966
注 册:2013-4-9
得分:15 
第一题就是求输入的各个点是不是可以放在同一个半径为r的圆内。
我想的算法是:
分别求各个点之间的距离。(所有的点和第一个点的距离, 再后面的点和第二个点的距离。再第三个。。。)
用各个距离除2, 再与半径r比较,
有一个大于r,就说明不在圆范围内,结果为NO
都小于r,结果为YES;
算法应该是对的, 只是可能不是最好的。
算法实现不难,你自己试试。

第二题我还没看懂伤害和距离的关系。。。。
2013-12-07 15:09



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-424798-1-1.html




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

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