【Codeforces Round #430 (Div. 2) B】Gleb And Pizza
【链接】点击打开链接
【题意】
【题解】
【错的次数】
【反思】
【代码】
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <cstdlib>
#include <cmath>
using namespace std;
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
#define rep1(i,a,b) for (int i = a;i <= b;i++)
#define rep2(i,a,b) for (int i = a;i >= b;i--)
#define mp make_pair
#define pb emplace_back
#define fi first
#define se second
#define ld long double
#define ms(x,y) memset(x,y,sizeof x)
#define ri(x) scanf("%d",&x)
#define rl(x) scanf("%lld",&x)
#define rs(x) scanf("%s",x)
#define rf(x) scnaf("%lf",&x)
#define oi(x) printf("%d",x)
#define ol(x) printf("%lld",x)
#define oc putchar(' ')
#define os(x) printf(x)
#define all(x) x.begin(),x.end()
#define Open() freopen("F:\\rush.txt","r",stdin)
#define Close() ios::sync_with_stdio(0)
#define sz(x) ((int) x.size())
#define ld long double typedef pair<int,int> pii;
typedef pair<LL,LL> pll; //mt19937 myrand(time(0));
//int get_rand(int n){return myrand()%n + 1;}
const int dx[9] = {0,1,-1,0,0,-1,-1,1,1};
const int dy[9] = {0,0,0,-1,1,-1,1,-1,1};
const double pi = acos(-1.0);
const int N = 1e5; struct abc{
LL x,y,r;
}; LL R,D;
int n;
abc a[N+10]; LL sqr(LL x){
return x*x;
} int main(){
//Open();
//Close();
rl(R),rl(D);
ri(n);
int ans = 0;
rep1(i,1,n) {
LL x,y,r;
rl(x),rl(y),rl(r);
LL temp = sqr(x)+sqr(y);
long double temp1 = sqrt(temp)-r,temp2 = sqrt(temp)+r;
if ( (R-D) <= temp1 && temp2 <= R) ans++;
}
oi(ans);puts("");
return 0;
}
【Codeforces Round #430 (Div. 2) B】Gleb And Pizza的更多相关文章
- 【 Codeforces Round #430 (Div. 2) A 】 Kirill And The Game
[链接]点击打开链接 [题意] 水题 [题解] 枚举b从x..y看看k*i是不是在l..r之间就好. [错的次数] 0 [反思] 在这了写反思 [代码] #include <cstdio> ...
- 【Codeforces Round #430 (Div. 2) C】Ilya And The Tree
[链接]点击打开链接 [题意] 给你一棵n个点的树,每个点的美丽值定义为根节点到这个点的路径上的所有权值的gcd. 现在,假设对于每一个点,在计算美丽值的时候,你可以将某一个点的权值置为0的话. 问你 ...
- 【Codeforces Round #430 (Div. 2) D】Vitya and Strange Lesson
[链接]点击打开链接 [题意] 给出一个数组,每次操作将整个数组亦或一个数x,问得到的数组的结果中的mex.mex表示为自然数中第一个没有出现过的数. [题解] 异或的效果是可以累加的,所以不用每次都 ...
- 【Codeforces Round #432 (Div. 1) B】Arpa and a list of numbers
[链接]h在这里写链接 [题意] 定义bad list是一个非空的.最大公约数为1的序列.给定一个序列,有两种操作:花费x将一个元素删除.花费y将一个元素加1,问你将这个序列变为good list所需 ...
- 【Codeforces Round #430 (Div. 2) A C D三个题】
·不论难度,A,C,D自己都有收获! [A. Kirill And The Game] ·全是英文题,述大意: 给出两组区间端点:l,r,x,y和一个k.(都是正整数,保证区间不为空),询问是否 ...
- 【Codeforces Round #420 (Div. 2) C】Okabe and Boxes
[题目链接]:http://codeforces.com/contest/821/problem/C [题意] 给你2*n个操作; 包括把1..n中的某一个数压入栈顶,以及把栈顶元素弹出; 保证压入和 ...
- 【Codeforces Round #420 (Div. 2) B】Okabe and Banana Trees
[题目链接]:http://codeforces.com/contest/821/problem/B [题意] 当(x,y)这个坐标中,x和y都为整数的时候; 这个坐标上会有x+y根香蕉; 然后给你一 ...
- 【Codeforces Round #420 (Div. 2) A】Okabe and Future Gadget Laboratory
[题目链接]:http://codeforces.com/contest/821/problem/A [题意] 给你一个n*n的数组; 然后问你,是不是每个位置(x,y); 都能找到一个同一行的元素q ...
- 【Codeforces Round #423 (Div. 2) C】String Reconstruction
[Link]:http://codeforces.com/contest/828/problem/C [Description] 让你猜一个字符串原来是什么; 你知道这个字符串的n个子串; 且知道第i ...
随机推荐
- Windows中的Tree命令
Windows中的Tree命令你会用吗? - 步行者的专栏 - CSDN博客 https://blog.csdn.net/hantiannan/article/details/7663893 (ven ...
- CF #578 Div2
// 比赛链接:https://codeforces.com/contest/1200 A - Hotelier 题意: 有一家旅馆有10间房,编号0~9,从左到右顺序排列.旅馆有左右两扇门,每次新来 ...
- MYSQL错误代码和消息
服务器错误信息来自下述源文件: · 错误消息信息列在share/errmsg.txt文件中.“%d”和“%s”分别代表编号和字符串,显示时,它们将被消息值取代. · 错 ...
- 如何撤销Git操作?
本文不再更新,可能存在内容过时的情况,实时更新请移步我的新博客:如何撤销Git操作?: Git 版本管理时,往往需要撤销某些操作. 本文介绍几种最主要的情况,给出详细的解释.更多的命令可以参考< ...
- JavaWeb工程中url地址的写法
两种url地址: 1. "/"给服务器使用, 代表web工程根路径(webroot)2. "/"给浏览器使用, 代表tomcat 目录下的webapps文件夹 ...
- Linux跨PC拷贝之SCP
命令:scp 不同的Linux之间copy文件常用有3种方法: 第一种就是ftp,也就是其中一台Linux安装ftp Server,这样可以另外一台使用ftp的client程序来进行文件的copy. ...
- new运算符与malloc函数(还需要修改)
细说new与malloc的10点区别 C++ 自由存储区是否等价于堆? 浅谈new/delete和malloc/free的用法与区别 new和malloc都是在对上开辟内存,但尽量使用new. 使用m ...
- E: 无法获得锁 /var/lib/apt/lists/lock - open (11: 资源暂时不可用) E: 无法对目录 /var/lib/apt/lists/ 加锁 问题解决方法
使用Ubuntu16.04安装软件执行apt-get update时出现如下错误: E: 无法获得锁 /var/lib/apt/lists/lock - open (11: 资源暂时不可用) E: 无 ...
- js身份证号码验证(小程序版)
参考知乎专栏文章https://zhuanlan.zhihu.com/p/22949023 <view class='bgw'> <form> ...... <view ...
- JSON操作总结(转自陈新汉)
JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式,采用完全独立于语言的文本格式,是理想的数据交换格式.同时,JSON是 JavaScript 原生格式,这意 ...