ural 1572 Yekaterinozavodsk Great Well
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#define maxn 1000
using namespace std; int main()
{
int f,n,t,f1;
double size,size1;
scanf("%d%lf",&f,&size);
scanf("%d",&n);
t=n;
int ans=;
while(t--)
{
scanf("%d%lf",&f1,&size1);
if(f==)
{
if(f1==)
{
if(size1<=size) ans++;
}
else if(f1==)
{
if(size*>=size1) ans++;
}
else if(f1==)
{
if(size*>=(sqrt(3.0)/2.0)*size1) ans++;
}
}
else if(f==)
{
if(f1==)
{
if(size*sqrt(2.0)>=size1*) ans++;
}
else if(f1==)
{
if(size*sqrt(2.0)>=size1) ans++;
}
else if(f1==)
{
if(size*sqrt(2.0)>=size1*(sqrt(3.0)/2.0)) ans++;
}
}
else if(f==)
{
if(f1==)
{
if(size>=*size1) ans++;
}
else if(f1==)
{
if(size>=size1) ans++;
}
else if(f1==)
{
if(size>=(sqrt(3.0)/2.0)*size1) ans++;
}
} }printf("%d\n",ans);
return ;
}
ural 1572 Yekaterinozavodsk Great Well的更多相关文章
- 后缀数组 POJ 3974 Palindrome && URAL 1297 Palindrome
题目链接 题意:求给定的字符串的最长回文子串 分析:做法是构造一个新的字符串是原字符串+反转后的原字符串(这样方便求两边回文的后缀的最长前缀),即newS = S + '$' + revS,枚举回文串 ...
- ural 2071. Juice Cocktails
2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and ...
- ural 2073. Log Files
2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best pro ...
- ural 2070. Interesting Numbers
2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate int ...
- ural 2069. Hard Rock
2069. Hard Rock Time limit: 1.0 secondMemory limit: 64 MB Ilya is a frontman of the most famous rock ...
- ural 2068. Game of Nuts
2068. Game of Nuts Time limit: 1.0 secondMemory limit: 64 MB The war for Westeros is still in proces ...
- ural 2067. Friends and Berries
2067. Friends and Berries Time limit: 2.0 secondMemory limit: 64 MB There is a group of n children. ...
- ural 2066. Simple Expression
2066. Simple Expression Time limit: 1.0 secondMemory limit: 64 MB You probably know that Alex is a v ...
- ural 2065. Different Sums
2065. Different Sums Time limit: 1.0 secondMemory limit: 64 MB Alex is a very serious mathematician ...
随机推荐
- 关于Android API的理解
举个例子: 比如程序中用到了android.content.ClipboardManager这个类, 而该类是在API 11才添加到 “库”. (原谅我,不理解Google API 文档里的 adde ...
- Selenium webdriver 查找元素
1.简单查找 By ID: WebElement element=driver.findElement(By.id("userId")); By Name:WebElement e ...
- Java中Timer的用法--转载之网络
用法很简单,new一个timer,然后写一个timertask的子类即可. import java.util.Timer; import java.util.TimerTask; public cla ...
- Android Studio常用插件
ButterKnife 这个开源库可以让我们从大量的findViewById()和setonclicktListener()解放出来,其对性能的影响微乎其微(查看过Butter Knife的源码,其自 ...
- Java基础知识强化93:算一下你来到这个世界多少天的案例
1. 分析: (1)键盘录入你的出生年月日 (2)把该字符串转换为一个日期 (3)通过该日期得到一个毫秒值 (4)获取当前时间的毫秒值 (5)用(4)-(3)得到一个毫秒值 (6)把E的毫秒值转换为天 ...
- Java基础知识强化75:正则表达式之分割功能(字符串中的数字排序案例)
1. 案例分析: 我有如下一个字符串:"91 27 46 38 50" 写代码实现最终输出结果是:"27 38 46 50 91" 分析: (1)定义一个 ...
- 富文本 Htmll类 html标签
HTML类可解析的标签 在手机上显示从网络端获取的数据有两种方式,一种是WebView,另一种是TextView,WebView大家都知道,功能强大但不灵活,下面主要说下TextView. 通过查看a ...
- Config配置文件读写
config文件读写操作(文字说明附加在程序中) App.config文件 <?xml version="1.0" encoding="utf-8" ?& ...
- JavaScript基础(二)
一.外部引用语法<script src="script.js"></script> 二.在页面中的位置 1.我们可以将JavaScript代码放在html文 ...
- Phonegap 版本minSdkVersion为8的时候的自动更新与升级
清单文件中: <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8"/> ...