• 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;
    }
  • 相关阅读:
    高可用、高并发浅析
    正则表达式笔记
    linux下通过脚本切换当前工作目录
    nginx学习笔记
    二进制安全
    负载均衡相关
    有用的shell命令
    TCP服务器/客户端代码示例
    UDP服务器/客户端代码示例
    GCC链接的几个注意点
  • 原文地址:https://www.cnblogs.com/moonbay/p/2605141.html
Copyright © 2020-2023  润新知