hdu 1593找规律题

其实这题我不会,看了解题报告才做出来。

突破点就是0068要找与elnil同角速度的同心圆。在同心圆上,2人的角速度是一样的;而在同心圆内,0068的角速度一直大于elnil的角速度,所以0068可以与elnil在大圆的一条直径上并且使距离达到最大程度。一旦0068到达同心圆上,便直线前进,以保证最快到岸,而此时elnil要走的距离依然是PI*R;

/*

 * hdu1593/win.cpp

 * Created on: 2012-7-23

 * Author    : ben

 */

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <cmath>

#include <ctime>

#include <iostream>

#include <algorithm>

#include <queue>

#include <set>

#include <map>

#include <stack>

#include <string>

#include <vector>

#include <deque>

#include <list>

#include <functional>

#include <numeric>

#include <cctype>

using namespace std;

const double pi = acos(-1);



int main() {

#ifndef ONLINE_JUDGE

    freopen("data.in", "r", stdin);

#endif

    double r, v1, v2;

    while(scanf("%lf%lf%lf", &r, &v1, &v2) == 3) {

        if(pi * r / v2 > (v2 - v1) * r / v1 / v2) {

            puts("Yes");

        }else {

            puts("No");

        }

    }

    return 0;

}

你可能感兴趣的:(HDU)