武大OJ 612. Catch the sheep
Description
Input
The input consists of several test cases.
The first line consists of one integer T (T <= 30), meaning the number of test cases.
For each test cases:
The first line consists of integer n (n<=10).
In the next n lines, the i-th line consists of four real number, xi, yi, ri, ui, describing the motion of each sheep (|xi|, |yi| <= 100, 0<=ri<=100, 0<ui<1). (xi, yi) means the coordinate of the center of the circle, ri means the radius of the circle, and ui means the speed of the sheep i.
You should know Anny always started in (0,0). And the sheep always started in (xi+ri, yi).
Output
For each test case, output one line with one real number with 6 decimal places meaning the minimum time Anny could leave without any space.
Sample Input
1
1
11 0 1 0.31415926535897932384626433832795
Sample Output
10.000000 本题的难点是根据当前坐标和时间求与第i只羊的最短交汇时间,转移的耗时显然是满足二分性质的,知道当前位置,当前时刻,下一只羊的信息就能够通过二分求得耗时
状态压缩Dp,dp[status][i]表示抓了status状态表示的羊最后抓的羊的编号为i
其实用爆搜应该也可以
时间复杂度:武大OJ 612. Catch the sheep的更多相关文章
- 武大OJ 574. K-th smallest
Description Give you a number S of length n,you can choose a position and remove the number on it.Af ...
- 武大OJ 622. Symmetrical
Description Cyy likes something symmetrical, and Han Move likes something circular. Han Mov ...
- 武大OJ 613. Count in Sama’s triangle
Description Today, the math teacher taught Alice Hui Yang’s triangle. However, the teacher came up w ...
- 武大OJ 706.Farm
Farmer John has a farm. Betsy, a famous cow, loves running in farmer John's land. The noise she made ...
- Hibernate技术
Hibernate中3个重要的类: 配置类(configuration) 负责管理Hibernate的配置信息,包含数据库连接URL.数据库用户.数据库密麻麻.数据库驱动等. 会话工厂类(Sessio ...
- c# 自定义解析JSON字符串数据
解析json字符串有很多方式, 1 : 在网上下载json解析的dll类库并添加引用, 调用相关方法; 2 : 使用自带类库JavaScriptSerializer的序列号和反序列化; 对于以上两个方 ...
- [C#] 逆袭——自制日刷千题的AC自动机攻克HDU OJ
前言 做过杭电.浙大或是北大等ACM题库的人一定对“刷题”不陌生,以杭电OJ为例:首先打开首页(http://acm.hdu.edu.cn/),然后登陆,接着找到“Online Exercise”下的 ...
- BZOJ 3595: [Scoi2014]方伯伯的Oj SBT+可持久化Treap
3595: [Scoi2014]方伯伯的Oj Time Limit: 6 Sec Memory Limit: 256 MBSubmit: 102 Solved: 54[Submit][Status ...
- Funny Sheep(思维)
Problem 1606 - Funny Sheep Time Limit: 1000MS Memory Limit: 65536KB Total Submit: 612 Accepted ...
随机推荐
- 贪心/思维题 UVA 11292 The Dragon of Loowater
题目传送门 /* 题意:n个头,m个士兵,问能否砍掉n个头 贪心/思维题:两个数组升序排序,用最弱的士兵砍掉当前的头 */ #include <cstdio> #include <c ...
- ACM_走楼梯Ⅱ
走楼梯Ⅱ Time Limit: 2000/1000ms (Java/Others) Problem Description: 有一楼梯共N+1级,刚开始时你在第一级,若每次能走M级(1<=M& ...
- new mysqli_ and 旧mysql
旧的php处理语法: 1. <select name="s" onChange="redirec()"> <option selected&g ...
- Storm概念学习系列之storm的优化
不多说,直接上干货!
- [转]从数据到代码——基于T4的代码生成方式
本文转自:http://www.cnblogs.com/artech/archive/2010/10/23/1859529.html 在之前写一篇文章<从数据到代码>(上篇.下篇)中,我通 ...
- 图标文件ico制作以及使用说明
今天说一个图标文件——ico.我们在pc端浏览网页的时候网页栏那块都会显示一个本网站特有的图片,就是我们说的ico了.示例:<link href="image/favicon.ico& ...
- WordPress主题reBorn最新破解版发布
今天上班的时候,没事浏览网页! 突然之间发现了这么一个标题,顿时让我产生了兴趣. 标题:WordPress主题reBorn最新破解版发布 不知道什么原因,现在原网址打不开了,可能是作者怕骚扰吧. 其实 ...
- Python之数据聚合与分组运算
Python之数据聚合与分组运算 1. 关系型数据库方便对数据进行连接.过滤.转换和聚合. 2. Hadley Wickham创建了用于表示分组运算术语"split-apply-combin ...
- Python+selenium学习(一) 打开Firefox浏览器,IE浏览器和Chrome浏览器
from selenium import webdriver # open Firefox #driver=webdriver.Firefox() # Open IE #driver=webdrive ...
- Beta冲刺提交-星期四
这个作业属于哪个课程 软件工程 这个作业要求在哪里 <作业要求的链接> 团队名称 唱跳RAP编程 这个作业的目标 1.进行每日例会,每个成员汇报自己今天完成 的工作,PM安排明天的 ...