2014 Asia AnShan Regional Contest --- HDU 5078 Osu!

简介: Osu! Problem's Link:   http://acm.hdu.edu.cn/showproblem.php?pid=5078   Mean:  略。 analyse: 签到题,直接扫一遍就得答案,但是现场赛的时候也是卡了好久,估计队友也是被爆int坑了吧。

 Osu!

Problem's Link:   http://acm.hdu.edu.cn/showproblem.php?pid=5078


 

Mean: 

略。

analyse:

签到题,直接扫一遍就得答案,但是现场赛的时候也是卡了好久,估计队友也是被爆int坑了吧。

Time complexity: O(n)

 

Source code: 

 

//  Memory   Time
//  1347K     0MS
//   by : Snarl_jsb
//   2014-11-15-10.58
#include<algorithm>
#include<iomanip>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<string>
#include<climits>
#include<cmath>
#define N 1000010
#define LL long long
using namespace std;
LL val[1005][3];
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
//    freopen("C:\\Users\\ASUS\\Desktop\\cin.cpp","r",stdin);
//    freopen("C:\\Users\\ASUS\\Desktop\\cout.cpp","w",stdout);
    int t,n;
    cin>>t;
    while(t--){
        cin>>n;
        double res=-1e9;
        for(int i=0;i<n;++i){
            cin>>val[i][0]>>val[i][1]>>val[i][2];
            if(i) res=max(res,sqrt((val[i][1]-val[i-1][1])*(val[i][1]-val[i-1][1])+(val[i][2]-val[i-1][2])*(val[i][2]-val[i-1][2]))/(val[i][0]-val[i-1][0]));
        }
        cout<<setprecision(10)<<res<<endl;
    }
    return 0;
}
/*

*/

  

 

目录
相关文章
|
7月前
Strange fuction(HDU--2899)
Strange fuction(HDU--2899)
2021 ICPC Asia Regionals Online Contest (II) Problem G. Limit
2021 ICPC Asia Regionals Online Contest (II) Problem G. Limit
|
机器学习/深度学习 人工智能
The Preliminary Contest for ICPC China Nanchang National Invitational I题 Max answer
The Preliminary Contest for ICPC China Nanchang National Invitational I题 Max answer
95 0
The Preliminary Contest for ICPC China Nanchang National Invitational A题 PERFECT NUMBER PROBLEM
The Preliminary Contest for ICPC China Nanchang National Invitational A题 PERFECT NUMBER PROBLEM
72 0
The Preliminary Contest for ICPC China Nanchang National Invitational H题 Coloring Game
The Preliminary Contest for ICPC China Nanchang National Invitational H题 Coloring Game
91 0
|
机器学习/深度学习
The Preliminary Contest for ICPC China Nanchang National Invitational J题 Distance on the tree
The Preliminary Contest for ICPC China Nanchang National Invitational J题 Distance on the tree
94 0
|
机器学习/深度学习 BI
2020-2021 ACM-ICPC, Asia Seoul Regional Contest L. Two Buildings (决策单调性 分治)
2020-2021 ACM-ICPC, Asia Seoul Regional Contest L. Two Buildings (决策单调性 分治)
135 0
2020-2021 ACM-ICPC, Asia Seoul Regional Contest L. Two Buildings (决策单调性 分治)
ZOJ - Summer 2018 - Contest 1 by SBconscious - Problems - 1001: Saber
ZOJ - Summer 2018 - Contest 1 by SBconscious - Problems - 1001: Saber
97 0
|
Java
HDU - 2018 Multi-University Training Contest 2 - 1010: Swaps and Inversions
HDU - 2018 Multi-University Training Contest 2 - 1010: Swaps and Inversions
113 0
2012 ACM/ICPC Asia Regional Tianjin Online-Faulty Odometer
题意:有个特殊汽车的行程表,每逢数字3和8会跳过直接到4和9,给你一个行程表的示数,求汽车实际走的路程。
133 0