codeforces 706A A. Beru-taxi(水题)
题目链接:
题意:
问那个taxi到他的时间最短,水题;
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <bits/stdc++.h>
#include <stack>
#include <map> using namespace std; #define For(i,j,n) for(int i=j;i<=n;i++)
#define mst(ss,b) memset(ss,b,sizeof(ss)); typedef long long LL; template<class T> void read(T&num) {
char CH; bool F=false;
for(CH=getchar();CH<'0'||CH>'9';F= CH=='-',CH=getchar());
for(num=0;CH>='0'&&CH<='9';num=num*10+CH-'0',CH=getchar());
F && (num=-num);
}
int stk[70], tp;
template<class T> inline void print(T p) {
if(!p) { puts("0"); return; }
while(p) stk[++ tp] = p%10, p/=10;
while(tp) putchar(stk[tp--] + '0');
putchar('\n');
} const LL mod=1e9+7;
const double PI=acos(-1.0);
const int inf=1e18;
const int N=1e5+10;
const int maxn=5e3+4;
const double eps=1e-12; int n;
double a,b,x[maxn],y[maxn];
double getdis(double fx,double fy,double fa,double fb)
{
return sqrt((fx-fa)*(fx-fa)+(fb-fy)*(fb-fy));
}
int main()
{
scanf("%lf%lf",&a,&b);
read(n);
double ans=inf,v;
For(i,1,n)
{
scanf("%lf%lf%lf",&x[i],&y[i],&v);
ans=min(ans,getdis(a,b,x[i],y[i])/v);
}
printf("%.10lf\n",ans);
return 0;
}
codeforces 706A A. Beru-taxi(水题)的更多相关文章
- codeforces 577B B. Modulo Sum(水题)
题目链接: B. Modulo Sum time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
- Codeforces Round #367 (Div. 2)---水题 | dp | 01字典树
A.Beru-taxi 水题:有一个人站在(sx,sy)的位置,有n辆出租车,正向这个人匀速赶来,每个出租车的位置是(xi, yi) 速度是 Vi;求人最少需要等的时间: 单间循环即可: #inclu ...
- codeforces 696A Lorenzo Von Matterhorn 水题
这题一眼看就是水题,map随便计 然后我之所以发这个题解,是因为我用了log2()这个函数判断在哪一层 我只能说我真是太傻逼了,这个函数以前听人说有精度问题,还慢,为了图快用的,没想到被坑惨了,以后尽 ...
- CodeForces 589I Lottery (暴力,水题)
题意:给定 n 和 k,然后是 n 个数,表示1-k的一个值,问你修改最少的数,使得所有的1-k的数目都等于n/k. 析:水题,只要用每个数减去n/k,然后取模,加起来除以2,就ok了. 代码如下: ...
- Codeforces Gym 100286G Giant Screen 水题
Problem G.Giant ScreenTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/con ...
- codeforces 710A A. King Moves(水题)
题目链接: A. King Moves 题意: 给出king的位置,问有几个可移动的位置; 思路: 水题,没有思路; AC代码: #include <iostream> #include ...
- codeforces 659A A. Round House(水题)
题目链接: A. Round House time limit per test 1 second memory limit per test 256 megabytes input standard ...
- CodeForces 489B BerSU Ball (水题 双指针)
B. BerSU Ball time limit per test 1 second memory limit per test 256 megabytes input standard input ...
- codeforces 702A A. Maximum Increase(水题)
题目链接: A. Maximum Increase time limit per test 1 second memory limit per test 256 megabytes input sta ...
- Codeforces gym 100685 C. Cinderella 水题
C. CinderellaTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100685/problem/C ...
随机推荐
- .net mvc项目 ajax
经常在后台用一般处理程序(.ashx)来处理前台的ajax请求 using System; using System.Collections.Generic; using System.IO; usi ...
- [BLE--Link Layer]物理信道
简述 有线通信,是用电缆直接连接.然后分距离的长短.有些会须要载入波,信号也可能会经过不同的调制方式调制. 无线通信也是一样,仅仅是信号的传输是通过射频了,通过在某一频段.对无线信道进行调制,将数据发 ...
- Web Service之Soap请求响应内容中文编码解密
java模拟Soap请求测试Web Service接口,发现Web Service响应内容中的中文竟然是编码格式.比如: 中文:退保成功 Soap中文编码:退保成功 我仔细分析后发现,退编码实际上 ...
- 调用android系统相机拍照并保存
[java] view plaincopyprint? <span style="font-size:18px;">package com.demo; import j ...
- ORACLE schedule job设置
--创建job begin DBMS_SCHEDULER.CREATE_JOB ( job_name => 'APICALL_LOG_INTERFACE_JOB', job_type => ...
- ubuntu16.04--在标题栏显示网速
有时感觉网络失去响应,就通过Ubuntu 14.04自带的系统监视器程序来查看当前网速,但是这样很不方便,遂打算让网速显示在标题栏,那样就随时可直观的看到.一番搜索尝试后,成功实现!同时也实现了CPU ...
- Vim 打开文件同时定位到某一行
在linux下,当后台某一行报警出错后,想用vim打开文件同时定位到某一行, Vim +某一行 filename 即可.
- 查看SELinux状态并关闭SELinux
SELinux(Security-Enhanced Linux)是Linux上最杰出的新安全子系统.在linux内核级别上提供了一个灵活的强制访问控制系统(MAC),这个强制访问控制系统是建立在自由访 ...
- 实模式切换到保护模式,为什么要开启A20地址线(系统升级产生的兼容性问题)
[-1]写在前面: 以下部分内容总结于 http://blog.csdn.net/ruyanhai/article/details/7181842 complementary: 兼容性是指运行在前期C ...
- Gradle 介绍
介绍:Gradle是一种构建工具,它抛弃了基于XML的构建脚本,取而代之的是采用一种基于Groovy的内部领域特定语言.Gradle的设计理念是,所有有用的特性都由Gradle插件提供,一个Gradl ...