Gleb And Pizza CodeForces - 842B
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的更多相关文章
- Codeforces 842B Gleb And Pizza【几何,水】
B. Gleb And Pizza time limit per test:2 seconds memory limit per test:256 megabytes input:standard i ...
- Codeforces Round #430 B. Gleb And Pizza
Gleb ordered pizza home. When the courier delivered the pizza, he was very upset, because several pi ...
- C - Ordering Pizza CodeForces - 867C 贪心 经典
C - Ordering Pizza CodeForces - 867C C - Ordering Pizza 这个是最难的,一个贪心,很经典,但是我不会,早训结束看了题解才知道怎么贪心的. 这个是先 ...
- 【Codeforces Round #430 (Div. 2) B】Gleb And Pizza
[链接]点击打开链接 [题意] 在这里写题意 [题解] 根据圆心到原点的距离这个东西判断一下圆在不在那个环里面就好 [错的次数] 0 [反思] 在这了写反思 [代码] #include <cst ...
- 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.直接暴力判断即 ...
- Codeforces Round #430 (Div. 2)
A. Kirill And The Game time limit per test 2 seconds memory limit per test 256 megabytes input stand ...
- ACM 第十五天
计算几何基础 练习题 C - Wasted Time Mr. Scrooge, a very busy man, decided to count the time he wastes on all ...
- codeforces 895A Pizza Separation 枚举
codeforces 895A Pizza Separation 题目大意: 分成两大部分,使得这两部分的差值最小(注意是圆形,首尾相连) 思路: 分割出来的部分是连续的,开二倍枚举. 注意不要看成0 ...
- CodeForces:#448 div2 a Pizza Separation
传送门:http://codeforces.com/contest/895/problem/A A. Pizza Separation time limit per test1 second memo ...
随机推荐
- Python REST
Django REST framework 1. 什么是REST REST与技术无关,代表的是一种软件架构风格,REST是Representational State Transfer的简称,中文翻译 ...
- WPF在在设计模式,使用动态样式
1.问题分析 WPF有时候要用到主题样式,比如颜色主题(红色.黄色之类的)通常是key相同,而value不同,比如会这么写: Background="{DynamicResource Bac ...
- Java面试题—中级(中)
什么是线程死锁?死锁如何产生?如何避免线程死锁? 死锁的介绍: 线程死锁是指由于两个或者多个线程互相持有对方所需要的资源,导致这些线程处于等待状态,无法前往执行.当线程进入对象的synchro ...
- HBase表创建、删除、清空
HBase shell窗口进入 执行命令hbase shell HBase表的创建 # 语法:create <table>, {NAME => <family>, VER ...
- 输出一个对象,会默认执行toString()方法
今天在看编程思想时看到enum知识点时发现了这个小问题(可能我基础太差了) 如图 然后就一步一步的跟进源码发现了其中的奥秘,首先进入println()方法如下图 看图执行了valueOf()方法进行s ...
- string[] 清理重复+反转显示
string[] listUrl = String.Join(",", list.Replace("\r\n", ",").Split(', ...
- 深入解析浏览器的幕后工作原理(三) 呈现树和 DOM 树的关系
呈现树和 DOM 树的关系 呈现器是和 DOM 元素相对应的,但并非一一对应.非可视化的 DOM 元素不会插入呈现树中,例如"head"元素.如果元素的 display 属性值为& ...
- 0316-关于js 注意事项
js:脚本语言,控制网页的行为(特效,表单验证) /* 这是多行注释 *///这是单行注释 js问题及注意事项: JavaScript 对大小写是敏感的 多写注释.提示性文字要说明白 定义变量时最好加 ...
- C++中 return,break,continue的用法
引用:https://blog.csdn.net/smf0504/article/details/51315835 https://blog.csdn.net/ting_junhui/article/ ...
- ES6(let.contest命令)
1.作用域概念? 1.全局作用域 2.函数作用域 3.块级作用域(ES6新增) 2.如何使用let和const? 1.代码: 运行结果为1.将let改为var,发现结果不变. 代码: 发现报错!!!( ...