ural 1333 Genie Bomber 2
2014-03-22 21:19
387 查看
#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=0; i<t; i++) { scanf("%lf%lf%lf",&x[i],&y[i],&r[i]); } for(int i=0; i<t; i++) r[i]*=r[i]; int ans=0; for(double x1=0; x1<=1; x1+=0.001) { for(double y1=0; y1<=1; y1+=0.001) { bool flag=false; for(int j=0; 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 0; }
View Code
相关文章推荐
- 【解题报告】 URAL 1333 Genie Bomber 2 -- 利用类似统计的方法计算覆盖效率
- URAL 1333 Genie Bomber 2(正方形被圆覆盖的面积)
- ural 1333 化平面为点计算覆盖率
- URAL 1333
- ural 1049. Brave Balloonists math
- URAL1325-Dirt
- URAL 1277 浅谈无向图网络流约束建模方法
- URAL - 1004 Sightseeing Trip(最小环)
- URAL 2080 Wallet 分块求无修改的区间内不同数的个数
- ural1486 二分+二维哈希
- URAL - 2040 Palindromes and Super Abilities 2
- Ural 1519 Formula 1 (DP)
- XVII Open Cup named after E.V. Pankratiev. XXI Ural Championship G glassese of solutions
- Freedom of Choice URAL - 1517
- URAL 1004 Sightseeing Trip(floyd求最小环+路径输出)
- URAL1517Freedom of Choice(后缀数组)
- (ssl1333)地鼠的困境
- one from ural
- [URAL1519] Formula 1 [插头dp入门]
- Ural2004: Scientists from Spilkovo(德布鲁因序列&思维)