题目链接:http://acm.hdu.edu.cn/showproblem.php?

pid=5078

Osu!

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)

Total Submission(s): 180    Accepted Submission(s): 114

Special Judge

Problem Description
Osu! is a very popular music game. Basically, it is a game about clicking. Some points will appear on the screen at some time, and you have to click them at a correct time.






Now, you want to write an algorithm to estimate how diffecult a game is.



To simplify the things, in a game consisting of N points, point i will occur at time ti at place (xi, yi), and you should click it exactly at ti at (xi, yi). That means you should move your cursor
from point i to point i+1. This movement is called a jump, and the difficulty of a jump is just the distance between point i and point i+1 divided by the time between ti and ti+1. And the difficulty of a game is simply the difficulty
of the most difficult jump in the game.



Now, given a description of a game, please calculate its difficulty.
 
Input
The first line contains an integer T (T ≤ 10), denoting the number of the test cases.



For each test case, the first line contains an integer N (2 ≤ N ≤ 1000) denoting the number of the points in the game.  Then N lines follow, the i-th line consisting of 3 space-separated integers, ti(0 ≤ ti < ti+1 ≤ 106),
xi, and yi (0 ≤ xi, yi ≤ 106) as mentioned above.
 
Output
For each test case, output the answer in one line.



Your answer will be considered correct if and only if its absolute or relative error is less than 1e-9.
 
Sample Input
2
5
2 1 9
3 7 2
5 9 0
6 6 3
7 6 0
10
11 35 67
23 2 29
29 58 22
30 67 69
36 56 93
62 42 11
67 73 29
68 19 21
72 37 84
82 24 98
 
Sample Output
9.2195444573
54.5893762558
Hint
In memory of the best osu! player ever Cookiezi.
 
Source
 
Recommend
liuyiding   |   We have carefully selected several similar problems for you:  5081 

pid=5080" style="color:rgb(26,92,200); text-decoration:none">5080 

pid=5079" style="color:rgb(26,92,200); text-decoration:none">5079 5077 5076 

 

pid=5078" style="color:rgb(26,92,200); text-decoration:none">Statistic | Submit | 

problemid=5078" style="color:rgb(26,92,200); text-decoration:none">Discuss | 

pid=5078" style="color:rgb(26,92,200); text-decoration:none">Note

鞍山的签到题,记得把类型定义成long long 防止溢出即可了。

#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<map>
#include<set>
#include<vector>
#include<cstdlib>
using namespace std;
#define CLR(A) memset(A,0,sizeof(A))
typedef long long ll;
const int MAXN=1010;
ll x[MAXN],y[MAXN],t[MAXN];
int main(){
int T;
cin>>T;
while(T--){
int n;
cin>>n;
for(int i=0;i<n;i++) cin>>t[i]>>x[i]>>y[i];
double ans=0;
for(int i=1;i<n;i++){
double tmp=sqrt((x[i]-x[i-1])*(x[i]-x[i-1])+(y[i]-y[i-1])*(y[i]-y[i-1]))/(double)(t[i]-t[i-1]);
ans=max(ans,tmp);
}
printf("%.10lf\n",ans);
}
return 0;
}

hdu 5078 Osu! (2014 acm 亚洲区域赛鞍山 I)的更多相关文章

  1. 2014年acm亚洲区域赛·鞍山站

    今天北京赛站的比赛也结束了···看了一天的直播之后意识到鞍山站的比赛都过去了一个多月了···这一个月比较萎靡···整天都在睡觉写报告画工图中度过··· 鞍山比哈尔滨还是暖和很多的···就是山上有奇怪的 ...

  2. 2014年亚洲区域赛北京赛区现场赛A,D,H,I,K题解(hdu5112,5115,5119,5220,5122)

    转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud 下午在HDU上打了一下今年北京区域赛的重现,过了5题,看来单挑只能拿拿铜牌,呜呜. ...

  3. hdu 5071 Chat-----2014acm亚洲区域赛鞍山 B题

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5071 Chat Time Limit: 2000/1000 MS (Java/Others)    M ...

  4. 第39届ACM亚洲区域赛牡丹江赛区赛后总结

    2014年10月10日,周五,早晨匆匆忙忙的出了寝室,直奔复印社去打了两份模板,然后直接就去上课了.第三节课下课,直接跟老师讲了一声,就去实验室跟学长们汇合了.12点半,踏上了开往牡丹江的列车,我们那 ...

  5. 2015年ACM长春区域赛比赛感悟

    距离长春区域赛结束已经4天了,是时候整理一下这次比赛的点点滴滴了. 也是在比赛前一周才得到通知要我参加长春区域赛,当时也是既兴奋又感到有很大的压力,毕竟我的第一场比赛就是区域赛水平,还是很有挑战性的. ...

  6. 2015 ACM / ICPC 亚洲区域赛总结(长春站&北京站)

    队名:Unlimited Code Works(无尽编码)  队员:Wu.Wang.Zhou 先说一下队伍:Wu是大三学长:Wang高中noip省一:我最渣,去年来大学开始学的a+b,参加今年区域赛之 ...

  7. 2019~2020icpc亚洲区域赛徐州站H. Yuuki and a problem

    2019~2020icpc亚洲区域赛徐州站H. Yuuki and a problem 题意: 给定一个长度为\(n\)的序列,有两种操作: 1:单点修改. 2:查询区间\([L,R]\)范围内所有子 ...

  8. 2014ACM/ICPC亚洲区域赛牡丹江站汇总

    球队内线我也总水平,这所学校得到了前所未有的8地方,因为只有两个少年队.因此,我们13并且可以被分配到的地方,因为13和非常大的数目.据领队谁oj在之上a谁去让更多的冠军.我和tyh,sxk,doub ...

  9. ACM-ICPC 2016亚洲区域赛(沈阳站)游记(滚粗记)

    首发于QQ空间和知乎,我在这里也更一下.   前言 以前高中搞竞赛的时候,经常看到神犇出去比赛或者训练之后写游记什么的,感觉萌萌哒.但是由于太弱,就没什么心情好写.现在虽然还是很弱,但是抱着享受的心情 ...

随机推荐

  1. MD5加密(前端JS)

    var password = $('#password').val();//获取密码框的值 var passwordMD5 = md5(password);//调用MD5,传入密码,返回MD5加密后的 ...

  2. Spring知识整理

    Spring简介 Spring是一个轻量级的控制反转(IoC)和面向切面(AOP)的容器框架,用来管理和维护bean,其中的特点是IOC(控制反转) DI(依赖注入) AOP(面向切面) 容易和其他框 ...

  3. 一个简单的MVC框架的实现-基于注解的实现

    1.@Action注解声明 package com.togogo.webtoservice.annotations; import java.lang.annotation.Documented; i ...

  4. 常见的dom操作----原生JavaScript与jQuery

    1.创建元素 文本节点 JavaScript: document.createElement(),只接收一个参数,创建后需要手动将其添加到文档树中,例如: var newDiv = document. ...

  5. Maven2的配置文件settings.xml

    简介: 概览 当Maven运行过程中的各种配置,例如pom.xml,不想绑定到一个固定的project或者要分配给用户时,我们使用settings.xml中的settings元素来确定这些配置.这包含 ...

  6. activemq Linux下的编译

    1.首先下载源码 ,网址:http://www.apache.org/dyn/closer.lua/activemq/activemq-cpp/3.9.4/activemq-cpp-library-3 ...

  7. Spring 4 MVC example with Maven

    In this tutorial, we show you a Spring 4 MVC example, using Maven build tool. Technologies used : Sp ...

  8. 【scikit-learn 0.19 中文文档 】安装 scikit-learn | ApacheCN

    中文文档: http://sklearn.apachecn.org/cn/0.19.0/tutorial/basic/tutorial.html 英文文档: http://sklearn.apache ...

  9. Zabbix 3.0 从入门到精通(zabbix使用详解)

    第1章 zabbix监控 1.1 为什么要监控 在需要的时刻,提前提醒我们服务器出问题了 当出问题之后,可以找到问题的根源   网站/服务器 的可用性 1.1.1 网站可用性 在软件系统的高可靠性(也 ...

  10. 状态压缩 - LeetCode #464 Can I Win

    动态规划是一种top-down求解模式,关键在于分解和求解子问题,然后根据子问题的解不断向上递推,得出最终解 因此dp涉及到保存每个计算过的子问题的解,这样当遇到同样的子问题时就不用继续向下求解而直接 ...