zoukankan      html  css  js  c++  java
  • ural 1572 Yekaterinozavodsk Great Well

     1 #include <cstdio>
     2 #include <cstring>
     3 #include <cmath>
     4 #include <algorithm>
     5 #define maxn 1000
     6 using namespace std;
     7 
     8 int main()
     9 {
    10     int f,n,t,f1;
    11     double size,size1;
    12     scanf("%d%lf",&f,&size);
    13     scanf("%d",&n);
    14     t=n;
    15     int ans=0;
    16     while(t--)
    17     {
    18         scanf("%d%lf",&f1,&size1);
    19         if(f==1)
    20         {
    21             if(f1==1)
    22             {
    23                 if(size1<=size) ans++;
    24             }
    25             else if(f1==2)
    26             {
    27                 if(size*2>=size1) ans++;
    28             }
    29             else if(f1==3)
    30             {
    31                 if(size*2>=(sqrt(3.0)/2.0)*size1) ans++;
    32             }
    33         }
    34         else if(f==2)
    35         {
    36             if(f1==1)
    37             {
    38                 if(size*sqrt(2.0)>=size1*2) ans++;
    39             }
    40             else if(f1==2)
    41             {
    42                 if(size*sqrt(2.0)>=size1) ans++;
    43             }
    44             else if(f1==3)
    45             {
    46                 if(size*sqrt(2.0)>=size1*(sqrt(3.0)/2.0)) ans++;
    47             }
    48         }
    49         else if(f==3)
    50         {
    51             if(f1==1)
    52             {
    53                 if(size>=2*size1) ans++;
    54             }
    55             else if(f1==2)
    56             {
    57                 if(size>=size1) ans++;
    58             }
    59             else if(f1==3)
    60             {
    61                 if(size>=(sqrt(3.0)/2.0)*size1) ans++;
    62             }
    63         }
    64 
    65     }printf("%d
    ",ans);
    66     return 0;
    67 }
    View Code
  • 相关阅读:
    Android访问数据库(SQL Server 和 MySQL)
    Andriod开发环境搭建
    SQL 学习记录
    安装双系统 win7 + ubuntu 15.04
    SQL资料
    电脑使用
    python_L7
    ONE
    网页性能优化
    js的继承
  • 原文地址:https://www.cnblogs.com/fanminghui/p/3605934.html
Copyright © 2011-2022 走看看