hdu 5078 Osu! (2014 acm 亚洲区域赛鞍山 I)
题目链接: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

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.
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.
Your answer will be considered correct if and only if its absolute or relative error is less than 1e-9.
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
9.2195444573
54.5893762558HintIn memory of the best osu! player ever Cookiezi.
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 5076pid=5078" style="color:rgb(26,92,200); text-decoration:none">Statistic 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)的更多相关文章
- 2014年acm亚洲区域赛·鞍山站
今天北京赛站的比赛也结束了···看了一天的直播之后意识到鞍山站的比赛都过去了一个多月了···这一个月比较萎靡···整天都在睡觉写报告画工图中度过··· 鞍山比哈尔滨还是暖和很多的···就是山上有奇怪的 ...
- 2014年亚洲区域赛北京赛区现场赛A,D,H,I,K题解(hdu5112,5115,5119,5220,5122)
转载请注明出处: http://www.cnblogs.com/fraud/ ——by fraud 下午在HDU上打了一下今年北京区域赛的重现,过了5题,看来单挑只能拿拿铜牌,呜呜. ...
- hdu 5071 Chat-----2014acm亚洲区域赛鞍山 B题
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5071 Chat Time Limit: 2000/1000 MS (Java/Others) M ...
- 第39届ACM亚洲区域赛牡丹江赛区赛后总结
2014年10月10日,周五,早晨匆匆忙忙的出了寝室,直奔复印社去打了两份模板,然后直接就去上课了.第三节课下课,直接跟老师讲了一声,就去实验室跟学长们汇合了.12点半,踏上了开往牡丹江的列车,我们那 ...
- 2015年ACM长春区域赛比赛感悟
距离长春区域赛结束已经4天了,是时候整理一下这次比赛的点点滴滴了. 也是在比赛前一周才得到通知要我参加长春区域赛,当时也是既兴奋又感到有很大的压力,毕竟我的第一场比赛就是区域赛水平,还是很有挑战性的. ...
- 2015 ACM / ICPC 亚洲区域赛总结(长春站&北京站)
队名:Unlimited Code Works(无尽编码) 队员:Wu.Wang.Zhou 先说一下队伍:Wu是大三学长:Wang高中noip省一:我最渣,去年来大学开始学的a+b,参加今年区域赛之 ...
- 2019~2020icpc亚洲区域赛徐州站H. Yuuki and a problem
2019~2020icpc亚洲区域赛徐州站H. Yuuki and a problem 题意: 给定一个长度为\(n\)的序列,有两种操作: 1:单点修改. 2:查询区间\([L,R]\)范围内所有子 ...
- 2014ACM/ICPC亚洲区域赛牡丹江站汇总
球队内线我也总水平,这所学校得到了前所未有的8地方,因为只有两个少年队.因此,我们13并且可以被分配到的地方,因为13和非常大的数目.据领队谁oj在之上a谁去让更多的冠军.我和tyh,sxk,doub ...
- ACM-ICPC 2016亚洲区域赛(沈阳站)游记(滚粗记)
首发于QQ空间和知乎,我在这里也更一下. 前言 以前高中搞竞赛的时候,经常看到神犇出去比赛或者训练之后写游记什么的,感觉萌萌哒.但是由于太弱,就没什么心情好写.现在虽然还是很弱,但是抱着享受的心情 ...
随机推荐
- Windows系统下python3中安装pyMysql
python2和python3是不兼容的,在py2中,链接数据库使用的是mysqldb,但在py3中是不能用的. 解决办法就是在py3中数据库使用的模块是pyMysql. 在dos窗口中安装第三方库会 ...
- Excel 生成SQL
'"&A21&"' Excel 中要做字符串连接 "& + 单元格地址 + &", 如果单纯做测试在某个单元格中测试输出内容 ...
- mysql +keeplive
下载tar包 ./configure --prefix=/usr/local/keepalived --with-kernel-dir=/usr/src/kernels/2.6.32-431.el6. ...
- 使用springboot完成密码的加密解密
现今对于大多数公司来说,信息安全工作尤为重要,就像京东,阿里巴巴这样的大公司来说,信息安全是最为重要的一个话题,举个简单的例子: 就像这样的密码公开化,很容易造成一定的信息的泄露.所以今天我们要讲的就 ...
- 面向亿万级用户的QQ一般做什么?——兴趣部落的 Web 同构直出分享
欢迎大家前往腾讯云社区,获取更多腾讯海量技术实践干货哦~ 作者:李强,腾讯web开发工程师商业转载请联系腾讯WeTest获得授权,非商业转载请注明出处.原文链接:http://wetest.qq.co ...
- mysql多个TimeStamp设置(转)
原文地址:http://www.cnblogs.com/yjf512/archive/2012/11/02/2751058.html timestamp设置默认值是Default CURRENT_TI ...
- YII2调试 通过日志记录将变量保存到文件
$log = new \yii\log\FileTarget(); $content=var_export($menu,"true");//将数组或对象转换字符串格式 $con ...
- Redis 图形化监控方案 RedisLive 介绍
作为一款开源的 Redis 图形化监控工具,RedisLive 提供对 Redis 实例的内存使用情况,接收的客户端命令,接收的请求数量以及键进行监控.RedisLive 的工作原理基于 Redis ...
- better-scroll 实现tab栏目滑动当前高亮始终在可视区
https://ustbhuangyi.github.io/better-scroll/doc/zh-hans/#better-scroll better-scroll文档地址 如图 ,是我们要实现的 ...
- 在VirtualBox 虚拟机中安装CentOS7 64位实验基础系统
1.将CentOS-7-x86_64-Minimal ISO加载入虚拟机,选择安装CentOS 7 2.启动欢迎画面,保持默认,选择 继续 3.安装参数设置 3-1.设置时区以便同步时间,将时区更改为 ...