首页 技术 正文
技术 2022年11月7日
0 收藏 622 点赞 889 浏览 1705 个字

Clear All of Them I

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 122768/62768 K (Java/Others)
Total Submission(s): 1455    Accepted Submission(s): 484

Problem DescriptionAcmers have been the Earth Protector against the evil enemy for a long time, now it’s your turn to protect our home.
  There are 2 * n enemies in the map. Your task is to clear all of them with your super laser gun at the fixed position (x, y).
  For
each laser shot, your laser beam can reflect 1 times (must be 1 times),
which means it can kill 2 enemies at one time. And the energy this shot
costs is the total length of the laser path.
  For example, if you
are at (0, 0), and use one laser shot kills the 2 enemies in the order
of (3, 4), (6, 0), then the energy this shot costs is 5.0 + 5.0 = 10.
00.
  Since there are 2 * n enemies, you have to shot n times to
clear all of them. For each shot, it is you that select two existed
enemies and decide the reflect order.
  Now, telling you your
position and the 2n enemies’ position, to save the energy, can you tell
me how much energy you need at least to clear all of them?
  Note that:
   > Each enemy can only be attacked once.
   > All the positions will be unique.
   > You must attack 2 different enemies in one shot.
   > You can’t change your position. InputThe first line contains a single positive integer T( T <= 100 ), indicates the number of test cases.
For each case:
  There are 2 integers x and y in the first line, which means your position.
  The second line is an integer n(1 <= n <= 10), denote there are 2n enemies.
  Then there following 2n lines, each line have 2 integers denote the position of an enemy.
  
  All the position integers are between -1000 and 1000. OutputFor
each test case: output the case number as shown and then print a
decimal v, which is the energy you need at least to clear all of them
(round to 2 decimal places). Sample Input2

0 0
1
6 0
3 0

0 0
2
1 0
2 1
-1 0
-2 0

 Sample OutputCase #1: 6.00
Case #2: 4.41 Source 2011 Multi-University Training Contest 9 – Host by BJTU   网上给这道题的定义为状压DP优化,但我实在看不出哪儿有优化的意义,然后,我就TLE了。

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,489
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,904
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,737
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,489
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,128
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,290