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
",ans);
    return 0;
}
原文地址:https://www.cnblogs.com/zufezzt/p/5810594.html