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 ...
随机推荐
- java equals与==区别
java中的数据类型,可分为两类: 1.基本数据类型,也称原始数据类型.byte,short,char,int,long,float,double,boolean 他们之间的比较,应用双等号(== ...
- (九)jQuery中的动画(载)
原文链接:http://blog.csdn.net/zfy865628361/article/details/50358367 首先,用jQuery做动画效果要求在标准模式下,否则可能会引起动画抖动. ...
- type-c UCSI和UcmCx.sys文件
简介:https://docs.microsoft.com/zh-cn/windows-hardware/drivers/usbcon/ucsi UCSI:USB Type-C Connector S ...
- 模式匹配之surf----特征点检测学习_2(surf算法)
在上篇博客特征点检测学习_1(sift算法) 中简单介绍了经典的sift算法,sift算法比较稳定,检测到的特征点也比较多,其最大的确定是计算复杂度较高.后面有不少学者对其进行了改进,其中比较出名的就 ...
- PHP进阶知识
关于PHP程序员技术职业生涯规划:http://rango.swoole.com/ Micro Service Framework For PHP:https://github.com/pinguo/ ...
- yum 安装apache php 使php支持memcached扩展
在公司上新项目的时候,无论生产环境还是测试环境,都会让运维安装php 环境(lamp/lnmp),并让php支持memcached 的扩展.这里搭建php环境其实主要就是搭建apache 和php.m ...
- python 基础 7.2 时间格式的相互转换
#/usr/bin/python #coding=utf-8 #@Time :2017/11/9 8:55 #@Auther :liuzhenchuan #@File :时间格式的相互转换.p ...
- 五个知识体系之-SQL语句大全
一.基础 1.说明:创建数据库CREATE DATABASE database-name 2.说明:删除数据库drop database dbname3.说明:备份sql server--- 创建 备 ...
- EasyNVR H5无插件摄像机直播解决方案前端解析之:监控实时直播的四分屏的前端展示
完成运行效果图: 一.四分屏展示样式布局 1.通过html.css等来进行样式排版 根据需求的四分屏的样式:来合理的划分出四个大块,分别用于放置四个播放器: 以四等分结构为例进行前端的排版: html ...
- Hibernate的配置文件 Hibernate.cfg.xml与xxx.hbm.xml
1.hibernate.cfg.xml配置如下: (数据库连接配置) <?xml version="1.0" encoding="UTF-8"?>& ...