CodeForces - 842B

 #include<bits/stdc++.h>
using namespace std; int main() {
int r,d,t;
double temp,x,y,z;
while(~scanf("%d %d",&r,&d)) {
scanf("%d",&t);
int ans = ;
for(int i = ; i < t; i++) {
scanf("%lf %lf %lf",&x,&y,&z);
temp = sqrt(x*x + y*y) - z ;
if (temp >= (r-d) && temp + z + z <= r ) ans++;
}
cout<<ans<<endl;
}
return ;
}

Gleb And Pizza CodeForces - 842B的更多相关文章

  1. Codeforces 842B Gleb And Pizza【几何,水】

    B. Gleb And Pizza time limit per test:2 seconds memory limit per test:256 megabytes input:standard i ...

  2. Codeforces Round #430 B. Gleb And Pizza

    Gleb ordered pizza home. When the courier delivered the pizza, he was very upset, because several pi ...

  3. C - Ordering Pizza CodeForces - 867C 贪心 经典

    C - Ordering Pizza CodeForces - 867C C - Ordering Pizza 这个是最难的,一个贪心,很经典,但是我不会,早训结束看了题解才知道怎么贪心的. 这个是先 ...

  4. 【Codeforces Round #430 (Div. 2) B】Gleb And Pizza

    [链接]点击打开链接 [题意] 在这里写题意 [题解] 根据圆心到原点的距离这个东西判断一下圆在不在那个环里面就好 [错的次数] 0 [反思] 在这了写反思 [代码] #include <cst ...

  5. Codeforces Round #430 (Div. 2) 【A、B、C、D题】

    [感谢牛老板对D题的指点OTZ] codeforces 842 A. Kirill And The Game[暴力] 给定a的范围[l,r],b的范围[x,y],问是否存在a/b等于k.直接暴力判断即 ...

  6. Codeforces Round #430 (Div. 2)

    A. Kirill And The Game time limit per test 2 seconds memory limit per test 256 megabytes input stand ...

  7. ACM 第十五天

    计算几何基础 练习题 C - Wasted Time Mr. Scrooge, a very busy man, decided to count the time he wastes on all ...

  8. codeforces 895A Pizza Separation 枚举

    codeforces 895A Pizza Separation 题目大意: 分成两大部分,使得这两部分的差值最小(注意是圆形,首尾相连) 思路: 分割出来的部分是连续的,开二倍枚举. 注意不要看成0 ...

  9. CodeForces:#448 div2 a Pizza Separation

    传送门:http://codeforces.com/contest/895/problem/A A. Pizza Separation time limit per test1 second memo ...

随机推荐

  1. 给定了经纬度的一张my_latlng表,和一个my_grid表,怎么实现my_latlng表回mygrid中的id?

    场景: 假设我们拥有一个拥有了一系列经纬度的表my_latlng(lat string,lng string)表,还有一张给定的栅格表my_grid(gridid bigint,centerlng d ...

  2. 解决VS2017编译后的EXE文件不能在其他电脑上运行的问题

    笔者昨天写了个超简单画图程序,很是激动啊,立马给同学分享了自己写的程序,结果发现无法运行 错误是这样的 解决方法如下: 1.将Debug改为Release 2.进入[项目]-[**属性] 3.[C/C ...

  3. 深度学习中Xavier初始化

    "Xavier"初始化方法是一种很有效的神经网络初始化方法,方法来源于2010年的一篇论文<Understanding the difficulty of training ...

  4. 单例模式详解及java常用类

    [单例模式]      确保某一个类,只能产生一个实例. 设计思路: ====将构造函数私有化,确保类外部,不能使用new关键字自行创建对象. ====在类内部实例化一个对象,并通过静态方法返回. ( ...

  5. 学习React系列(五)——使性能最优

    提高性能可分为两方面: 一.配置层面 二.代码层面 本文只从代码层面考虑: 一.避免重复渲染 这里要说一句: 当shouldComponentUpdate返回false的时候不触发render函数也就 ...

  6. Linux下的MySQL5.7.14启动方法

    启动MySQL服务: systemctl start mysql 启动MySQL服务(安全方式): mysqld_safe --user=mysql & 登录MySQL(有密码): mysql ...

  7. 在Unity3D中利用 RenderTexture 实现游戏内截图

    using System.Collections; using System.Collections.Generic; using System.IO; using UnityEngine; publ ...

  8. JS 变量类型互相转换

    转载自:http://zhaizhiyuan.blog.163.com/blog/static/1897672632009093147268/ Java中几种常用的数据类型之间转换方法:  1. sh ...

  9. Linux(四)使用Xshell5远程登录

    Xshell5和Xftp5的安装包 链接:https://pan.baidu.com/s/1q3-ch75TW3lvC3KX25klNQ 密码:m31n 说明: 公司开发的时候,具体情况是这样的: 1 ...

  10. 洛谷P2221 [HAOI2012]高速公路

    线段树 #include<cstdio> #include<cstdlib> #include<algorithm> #include<cstring> ...