CodeForces 706A Beru-taxi

简单题。

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<iostream>
using namespace std;
typedef long long LL;
const double pi=acos(-1.0),eps=1e-8;
void File()
{
    freopen("D:\\in.txt","r",stdin);
    freopen("D:\\out.txt","w",stdout);
}

int x,y,n;

int main()
{
    scanf("%d%d",&x,&y);
    scanf("%d",&n);
    double ans=99999999;
    for(int i=1;i<=n;i++)
    {
        int tx,ty,v;
        scanf("%d%d%d",&tx,&ty,&v);
        double t=sqrt((tx-x)*(tx-x)+(ty-y)*(ty-y))/v;
        ans=min(ans,t);
    }
    printf("%.6lf\n",ans);
    return 0;
}

 

posted @ 2016-08-26 15:36  Fighting_Heart  阅读(154)  评论(0编辑  收藏  举报