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 ...
随机推荐
- GMU
NEXT | 不错过任何一个新产品 百度开源 Mobile UI 组件库,提供 Web app.Pad 端简单易用的 UI 组件 发表评论
- WIndows系统下mysql-noinstall安装配置
环境: Windowsmysql-noinstall-5.0.37-win32.zip 一.下载MySQL http://www.mysql.com/downloads 二.安装过程 1.解压缩mys ...
- oracle锁表解决方法
SQL> select session_id from v$locked_object; SESSION_ID----------142 SQL> SELECT sid, serial#, ...
- Java学习路线图·影响一代又一代程序员的经典书籍!(转)
转自:http://www.douban.com/group/topic/50353428/ 基础篇 ·Java核心技术 卷1 基础知识(原书第9版)最新版·中文版 第13届Jolt生产效率大奖获奖图 ...
- View inflate方法和LayoutInflater inflate方法的区别详解
原创文章,转载请注明出处:http://www.cnblogs.com/baipengzhan/p/6257510.html 我们在Android开发中,对于将布局填充成View对象,最常用的两种办法 ...
- 安卓kernel自主唤醒系统方法—设置alarm
我们知道alarm一般是上层设置后.kernel驱动里面将set time写入alarm寄存器,到达时间后trigger,殊不知kernel里面也能够自主设置alarm. 尤其是系统在休眠时驱动nee ...
- Android 自定义View (一)
转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/24252901 很多的Android入门程序猿来说对于Android自定义View ...
- myqltransactionRollbackexception deadlock found when trying to get lock
linux 下远程连接mysq 命令: mysql -h "1.0.0.1" -u username -p 1 获 取锁等待情况 可以通过检查 table_locks_waited ...
- Linux设备驱动中的阻塞和非阻塞I/O
[基本概念] 1.阻塞 阻塞操作是指在执行设备操作时,托不能获得资源,则挂起进程直到满足操作所需的条件后再进行操作.被挂起的进程进入休眠状态(不占用cpu资源),从调度器的运行队列转移到等待队列,直到 ...
- Android 带你玩转实现游戏2048 其实2048只是个普通的控件(转)
1.概述 博主本想踏入游戏开放行业,无奈水太深,不会游泳:于是乎,只能继续开发应用,但是原生Android也能开发游戏么,2048.像素鸟.别踩什么来着:今天给大家带来一篇2048的开发篇,别怕不分上 ...