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 ...
随机推荐
- iOS进阶读物
不知不觉作为 iOS 开发也有两年多的时间了,记得当初看到 OC 的语法时,愣是被吓了回去,隔了好久才重新耐下心去啃一啃.啃了一阵,觉得大概有了点概念,看到 Cocoa 那么多的 Class,又懵了, ...
- UVALive 4957 Fake scoreboard
题意就是有n个队伍和m个题目 给出了每个队伍解决的题目数量 每个题目也给出了被解决的次数 然后求一个方阵. N,Y表示每个队伍是否过了哪个题目. 要求字典序最小. 这题给人的第一反应就是网络流. 虽然 ...
- motan源码分析八:涉及到底层的客户端调用
之前我们分析了客户端调用服务端的源码,但是没有涉及到通讯层和序列化层,本文将之前讲过的内容做一次串联. 1.上层通过动态代理调用refer的call,每个refer又对应一个nettyclient,下 ...
- 【服务器运维】Windows Server 2008 R2 下配置证书服务器和HTTPS
前言 2017年1月1日起App Store上的所有App应用将强制开启ATS功能. 苹果的ATS(App Transport Security)对服务器硬性3点要求: ① ATS要求TLS1.2或者 ...
- [RxJS] Creation operators: fromEventPattern, fromEvent
Besides converting arrays and promises to Observables, we can also convert other structures to Obser ...
- Android实现计时与倒计时(限时抢购)的几种方法
在购物网站的促销活动中一般都有倒计时限制购物时间或者折扣的时间,这些都是如何实现的呢? 在一个安卓客户端项目中恰好遇到了类似的问题,一开始使用的是Timer与 TimerTask, 虽然此方法通用,但 ...
- AMD 规范以及如何将AMD转变为CommonJS
原文:http://villadora.me/2014/05/23/amd-define-and-how-to-translate-amd-to-commonjs/ CommonJS和AMD的争论已经 ...
- 5、第5节课CSS补充和html 标签讲解20150924
1. DIV 隐藏 A: 隐藏之后不占位置 display:none; B:隐藏之后占位置 visibility:hidden; 2.DIV 排序 z-index:2; 默认是1,如果想DIV在上 ...
- 秒味课堂Angular js笔记------$scope.$watch和$scope.$apply
$scope.$watch(watchFn , watchAction , deepWatch) 其中,watchFn是带有angular表达式或函数字符串: watchAction是一个函数或者表达 ...
- return;,return false,return true----------浅析
作为新手,一直没注意他们的区别,今天特意在网上搜了搜. 1: retuen; 无返回值,表示终止函数往下执行 2: return true; a.返回 bool值 真 b.提交表单 针对<but ...