zoukankan      html  css  js  c++  java
  • hdu 5078 2014鞍山现场赛 水题

    http://acm.hdu.edu.cn/showproblem.php?pid=5078

    现场最水的一道题 连排序都不用,由于说了ti<ti+1

    //#pragma comment(linker, "/STACK:102400000,102400000")
    #include <cstdio>
    #include <cstring>
    #include <algorithm>
    #include <string>
    #include <iostream>
    #include <iomanip>
    #include <cmath>
    #include <map>
    #include <set>
    #include <queue>
    using namespace std;
    
    #define ls(rt) rt*2
    #define rs(rt) rt*2+1
    #define ll long long
    #define ull unsigned long long
    #define rep(i,s,e) for(int i=s;i<e;i++)
    #define repe(i,s,e) for(int i=s;i<=e;i++)
    #define CL(a,b) memset(a,b,sizeof(a))
    #define IN(s) freopen(s,"r",stdin)
    #define OUT(s) freopen(s,"w",stdout)
    const ll ll_INF = ((ull)(-1))>>1;
    const double EPS = 1e-8;
    const double pi = acos(-1.0);
    const int INF = 100000000;
    
    const int MAXN = 1000+20;
    
    double t[MAXN],x[MAXN],y[MAXN];
    struct Node {
        double t,x,y;
    }a[MAXN];
    
    bool cmp(Node a, Node b){
        return a.t<b.t;
    }
    
    int main()
    {
        int ncase,n;
        scanf("%d",&ncase);
        while(ncase--)
        {
            scanf("%d",&n);
            double ans=0.0;
            for(int i=0;i<n;i++)
            {
                scanf("%lf%lf%lf",&a[i].t,&a[i].x,&a[i].y);
            }
            
            for(int i=0;i<n-1;i++)
                ans=max(ans,sqrt( (a[i].x-a[i+1].x)*(a[i].x-a[i+1].x)+(a[i].y-a[i+1].y)*(a[i].y-a[i+1].y) )/(a[i+1].t-a[i].t));
            printf("%.10lf
    ",ans);
        }
        return 0;
    }
    


  • 相关阅读:
    【洛谷习题】公路修建
    priority_queue用法简记
    【洛谷习题】无线通讯网
    【SCOI2005】繁忙的都市
    第四周 3.20-3.26
    第三周 3.13-3.19
    第二周 3.6-3.12
    第一周 2.28-3.5
    第六周 2.21-2.27
    2018湘潭邀请赛 AFK题解 其他待补...
  • 原文地址:https://www.cnblogs.com/claireyuancy/p/7096491.html
Copyright © 2011-2022 走看看