【模拟】Codeforces 706A Beru-taxi
2016-08-13 21:44
113 查看
题目链接:
http://codeforces.com/problemset/problem/706/A
题目大意:
家的坐标在sx,sy,有n辆车,每辆车坐标xi,yi,速度vi,问最快的一辆车什么时候到家。
题目思路:
【模拟】
签到题。
View Code
http://codeforces.com/problemset/problem/706/A
题目大意:
家的坐标在sx,sy,有n辆车,每辆车坐标xi,yi,速度vi,问最快的一辆车什么时候到家。
题目思路:
【模拟】
签到题。
// //by coolxxx // #include<iostream> #include<algorithm> #include<string> #include<iomanip> #include<memory.h> #include<time.h> #include<stdio.h> #include<stdlib.h> #include<string.h> //#include<stdbool.h> #include<math.h> #define min(a,b) ((a)<(b)?(a):(b)) #define max(a,b) ((a)>(b)?(a):(b)) #define abs(a) ((a)>0?(a):(-(a))) #define lowbit(a) (a&(-a)) #define sqr(a) ((a)*(a)) #define swap(a,b) ((a)^=(b),(b)^=(a),(a)^=(b)) #define eps (1e-8) #define J 10000000 #define MAX 0x7f7f7f7f #define PI 3.1415926535897 #define N 4 using namespace std; typedef long long LL; int cas,cass; int n,m,lll,ans; int sx,sy; double t,s; int main() { #ifndef ONLINE_JUDGE // freopen("1.txt","r",stdin); // freopen("2.txt","w",stdout); #endif int i,j,x,y,v; // for(scanf("%d",&cas);cas;cas--) // for(scanf("%d",&cas),cass=1;cass<=cas;cass++) // while(~scanf("%s",s)) while(~scanf("%d%d",&sx,&sy)) { t=MAX; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d%d%d",&x,&y,&v); s=(double)sqrt(sqr(x-sx)+sqr(y-sy))/v; t=min(t,s); } printf("%lf\n",t); } return 0; } /* // // */
View Code
相关文章推荐
- 【模拟】Codeforces 706A Beru-taxi
- CodeForces 158 B. Taxi(模拟)
- CodeForces 158 B. Taxi(模拟)
- codeforces 158B Taxi (贪心)
- 【模拟】Codeforces 691B s-palindrome
- CodeForces 25BPhone numbers(简单的字符串模拟题目)
- CodeForces 731B-Coupons and Discounts(贪心 模拟)
- CodeForces 676 B. Pyramid of Glasses(模拟)
- Codeforces--629B--Far Relative’s Problem(模拟)
- CodeForces - 250C - Movie Critics - (模拟)
- codeforces 74B Train 贪心 简单模拟
- Codeforces 651A Joysticks(模拟)
- Codeforces 523C&D C.Name Quest【贪心】、D.Statistics of Recompressing Videos【模拟】
- codeforces-#471A. MUH and Sticks(模拟)
- 模拟·CodeForces - 864C ·Bus
- Codeforces 546C Soldier and Cards【模拟】【期末考试全突击啊T T 】
- CodeForces 611B New Year and Old Property(模拟)
- Codeforces 697A. Pineapple Incident (模拟)
- CodeForces - 630M Turn (模拟&技巧) 水
- Codeforces Good Bye 2016 D 模拟搜索?