博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
hdu 5078 Osu!(鞍山现场赛)
阅读量:6242 次
发布时间:2019-06-22

本文共 2136 字,大约阅读时间需要 7 分钟。

Osu!

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 20    Accepted Submission(s): 15
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 t
i at place (x
i, y
i), and you should click it exactly at t
i at (x
i, y
i). 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 t
i and t
i+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, t
i(0 ≤ t
i < t
i+1 ≤ 10
6), x
i, and y
i (0 ≤ x
i, y
i ≤ 10
6) 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.
 

求最大难度,难度为相邻两点的距离除以时间差。

代码:

#include 
#include
#include
#include
using namespace std;double a[10000];double b[10000];int ti[10000];double dis(int i,int j){ return sqrt((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j]));}int main(){ int t,n; scanf("%d",&t); while(t--) { scanf("%d",&n); double ans=0; for(int i=0;i

转载地址:http://fhsia.baihongyu.com/

你可能感兴趣的文章
解析JavaScript"模拟事件"的注意要点
查看>>
HashMap剖析之内部结构
查看>>
被七牛云OSS对象存储测试域名回收后正确数据迁移姿势!
查看>>
简单基于spring的redis配置(单机和集群模式)
查看>>
关于 top 工具的 6 个替代方案
查看>>
第十七天-企业应用架构模式-会话状态模式
查看>>
智能直播审核方案:视频云智能业务截帧策略
查看>>
以太坊Truffle框架构建Dapp
查看>>
闭包,sync使用细节
查看>>
Vue+thinkJs博客网站(一)之vue多页面应用的webpack3配置
查看>>
PHP面试题
查看>>
拖拽上传功能的实现及原理
查看>>
Spring校验@RequestParams和@PathVariables参数
查看>>
移动端H5页面阻止图片和文字被选中
查看>>
聊聊flink TaskManager的memory大小设置
查看>>
怎么将微博图片中的水印去掉
查看>>
[实践系列]Babel原理
查看>>
浅谈SLAM的回环检测技术
查看>>
GraphQL 在 koa 框架中的实践
查看>>
网站内部页面如何正确的微调
查看>>