ural 1333 Genie Bomber 2
#include <cstdio>
#include <cstring>
#include <algorithm>
#define maxn 200
using namespace std; double x[maxn],y[maxn],r[maxn]; double sqr(double x)
{
return x*x;
} int main()
{
int t;
scanf("%d",&t);
for(int i=; i<t; i++)
{
scanf("%lf%lf%lf",&x[i],&y[i],&r[i]);
}
for(int i=; i<t; i++) r[i]*=r[i];
int ans=;
for(double x1=; x1<=; x1+=0.001)
{
for(double y1=; y1<=; y1+=0.001)
{
bool flag=false;
for(int j=; j<t; j++)
{
if(sqr(x1-x[j])+sqr(y1-y[j])<=r[j])
{
flag=true;
break;
}
}
if(flag) ans++;
}
}
printf("%.0lf",(double)ans/10000.0);
return ;
}
ural 1333 Genie Bomber 2的更多相关文章
- ural 1333 化平面为点计算覆盖率
题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1333 #include<cstdio> #include<cstrin ...
- (准备写)URAL1824 Ifrit Bomber 题解
http://acm.timus.ru/problem.aspx?space=1&num=1824 1824. Ifrit Bomber Time limit: 0.5 second Memo ...
- CSU 1333 Funny Car Racing (最短路)
题目链接: http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1333 解题报告:一个图里面有n个点和m条单向边,注意是单向边,然后每条路开a秒关闭b秒 ...
- 后缀数组 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 ...
随机推荐
- 终于有人把O2O、C2C、B2B、B2C的区别讲透了
一.O2O.C2C.B2B.B2C的区别在哪里? o2o 是 online to offline 分为四种运营模式 1.online to offline 是线上交易到线下消费体验 2.offline ...
- Web —— java web 项目开发 笔记
1.tomcat 配置虚拟路径:Tomcat下配置虚拟路径管理web项目 发布路径配置( 即虚拟目录配置 ) 配置虚拟路径的4种方法 2.
- 一不小心写了个bootstrap风格下拉控件 JqueryUI + bootstrap
受够了EasyUI的封闭,Bootstrap虽然华丽但是功能太渣,闲着无聊写个下拉控件玩玩吧,不喜勿喷哈... 第一步:先设计下我的下拉控件的样子 1.既然是bootstrap风格的,我想应该是这样的 ...
- Windows消息传递机制具体解释
林炳文Evankaka原创作品.转载请注明出处http://blog.csdn.net/evankaka Windows是一个消息(Message)驱动系统.Windows的消息提供了应用程序之间.应 ...
- 具体解释VB中连接access数据库的几种方法
在VB中,连接ACCESS数据库的方法主要有以下三种 使用ADO对象,通过编写代码訪问数据库 Connection 对象 ODBC数据源 使用ADO Data 控件高速创建数据库连接 有三种连接方法 ...
- <微软的软件测试之道>读书笔记3
一.自动化的标准步骤: 1.环境初始化,并检查环境是否处于正确的状态,能否开始测试 2.执行步骤 3.判断结果,并将结果保存到其它地方以供检查分析 4.环境清理,清理本用例产生的垃圾(临时文件.环境变 ...
- 使用单例模式实现自己的HttpClient工具类
引子 在Android开发中我们经常会用到网络连接功能与服务器进行数据的交互,为此Android的SDK提供了Apache的HttpClient 来方便我们使用各种Http服务.你可以把HttpCli ...
- Chapter 7. Dependency Management Basics 依赖管理基础
This chapter introduces some of the basics of dependency management in Gradle. 7.1. What is dependen ...
- hdu 1175
#include <iostream> #include <string> #include <stdio.h> using namespace std; int ...
- PL/SQL中的变量案例解析
1.标量: ag1: declare v_ename emp.ename%type;--自己称为单变量 begin select ename into v_ename from emp where e ...