HDU 5078 osu!

Source: Internet
Author: User

Title Link: Hdu 5078 osu!


Surface:


osu!Time limit:2000/1000 MS (java/others) Memory limit:262144/262144 K (java/others)
Total submission (s): 1058 Accepted Submission (s): 550
Special Judge


Problem descriptionosu! is a very popular music game. Basically, it's a game about clicking. Some points would appear on the screens at Some time, and you had to click them at a correct time.


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

To simplify the things, in a game consisting of N points, point I'll occur at time Ti @ place (xi, Yi), and you should Click it exactly at Ti at (xi, Yi). That's means you should move your the cursor from point I to point i+1. This movement are called a jump, and the difficulty of a jump are 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 very difficult jump in the game.

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

For each test case, the first line contains a 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≤x I, yi≤106) as mentioned above.
Outputfor each test case, output the answer in one line.

Your answer would be considered correct if and only if it absolute or relative error is less than 1e-9.
Sample Input
252 1 93 7 25 9 06 6 37 6 01011 35 6723 2 2929 58 2230 67 6936 56 9362 42 1167 73 2968 19 2172 37 8482 24 98

Sample Output
9.219544457354.5893762558Hintin memory of the best osu! Player ever cookiezi.

Source2014 Asia Anshan Regional Contest

Test instructions: To seek the maximum value, began to think greedy, direct violence is good.


Code:

#include <iostream> #include <iomanip> #include <cmath>using namespace std;long long int Squared_dis ( Long long int x1,long long int y3,long long int x2,long long int y2) {return (X1-X2) * (X1-X2) + (y3-y2) * (Y3-Y2);} Long Long int store_x[1005],store_y[1005],t[1005];int main () {int Tt,n;cin>>tt;while (tt--) {double maxx=0;  cin>>n;  Double tmp;  for (int i=0;i<n;i++)  {      cin>>t[i]>>store_x[i]>>store_y[i];    }    for (int i=0;i<n-1;i++)    {for    (int j=i+1;j<n;j++)    {    if (T[i]!=t[j])    tmp=sqrt (1.0* Squared_dis (Store_x[i],store_y[i],store_x[j],store_y[j])/abs (T[i]-t[j]);    if (Tmp>maxx)    maxx=tmp;     }    }    


HDU 5078 osu!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.