HDU 5762Teacher Bo
Teacher Bo
Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 133 Accepted Submission(s): 84
If there exists such tetrad,print "YES",else print "NO".
In each test case,the first line contains two intergers, N, M, means the number of points and the range of the coordinates.(N,M≤105).
Next N lines, the i-th line shows the coordinate of the i-th point.(Xi,Yi)(0≤Xi,Yi≤M).
/* ***********************************************
Author :guanjun
Created Time :2016/7/26 15:10:50
File Name :p311.cpp
************************************************ */
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <iomanip>
#include <list>
#include <deque>
#include <stack>
#define ull unsigned long long
#define ll long long
#define mod 90001
#define INF 0x3f3f3f3f
#define maxn 100010
#define cle(a) memset(a,0,sizeof(a))
const ull inf = 1LL << ;
const double eps=1e-;
using namespace std;
priority_queue<int,vector<int>,greater<int> >pq;
struct Node{
int x,y;
};
struct cmp{
bool operator()(Node a,Node b){
if(a.x==b.x) return a.y> b.y;
return a.x>b.x;
}
}; bool cmp(int a,int b){
return a>b;
}
int n,m;
int x[maxn];
int y[maxn];
map<int,int>mp;
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
#endif
//freopen("out.txt","w",stdout);
int t;
cin>>t;
while(t--){
cin>>n>>m;
mp.clear();
for(int i=;i<=n;i++){
scanf("%d%d",&x[i],&y[i]);
}
int mark=;
for(int i=;i<=n;i++){
for(int j=i+;j<=n;j++){
int z=abs(x[i]-x[j])+abs(y[i]-y[j]);
if(!mp[z]){
mp[z]=;
}
else{
mark=;
break;
}
}
if(mark)break;
}
if(mark)puts("YES");
else puts("NO");
}
return ;
}
HDU 5762Teacher Bo的更多相关文章
- HDU 5753Permutation Bo
Permutation Bo Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) ...
- HDU 5752Sqrt Bo
Sqrt Bo Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total S ...
- hdu Swipe Bo(bfs+状态压缩)错了多次的题
Swipe Bo Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total S ...
- HDU 5752 Sqrt Bo (数论)
Sqrt Bo 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5752 Description Let's define the function f ...
- HDU 5753 Permutation Bo (推导 or 打表找规律)
Permutation Bo 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5753 Description There are two sequen ...
- HDU 5762 Teacher Bo (暴力)
Teacher Bo 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5762 Description Teacher BoBo is a geogra ...
- HDU 5754 Life Winner Bo (博弈)
Life Winner Bo 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5754 Description Bo is a "Life W ...
- HDU 5752 Sqrt Bo【枚举,大水题】
Sqrt Bo Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total S ...
- hdu 5761 Rower Bo 物理题
Rower Bo 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5761 Description There is a river on the Ca ...
随机推荐
- ios打电话发短信接口
电话.短信是手机的基础功能,iOS中提供了接口,让我们调用.这篇文章简单的介绍一下iOS的打电话.发短信在程序中怎么调用. 1.打电话 [[UIApplication sharedApplicatio ...
- jquery中ajax原生代码的分析模仿
function ajax(obj){ var defaults = { url: "#", data: {}, type: ...
- centos下安装redis(记录其中踩坑的过程)
一.先下载到redis-3.0.4.tar.gz包(本文以3.0.4版本为例) 我将这个包放在/opt目录下,在/opt下并解压这个包 tar -zxvf redis-.tar.gz 然后进入redi ...
- 怎样提高DB2存储过程性能
高性能的SQL过程是数据库开发人员所追求的,我将不断把学到的,或在实际开发中用到的一些提高SQL过程性能的技巧整理出来,温故而知新. 1,在只使用一条语句即可做到时避免使用多条语句 让我们从一个简单的 ...
- 用PHP写一个最简单的解释器Part4(写一个最简单的脚本语言)
好吧!我承认我想标题党了.大家对解释器的吸引,绝对没有自己动手写一个脚本语言更有吸引力.不过如果看到标题过来的,可能也是 我承认,之前收藏的减肥视频,我都是这样对待他们的. 不过我还是相信很多程序猿o ...
- html css笔记 -度一
"""浏览器 shell 内核外表 内心 IE tridentFirefox Geckogoogle chrome webkit/blinksafari webkitop ...
- python 列表(二)
列表的其他操作 count 用于统计列表中某个元素出现的次数 Eg: extend 把一个列表添加到另一个列表里面 Index 输出元素的位置即根据内容索引位置 Reverse 把列表元素的位置倒过 ...
- 第二十二节:scrapy爬虫识别验证码(一)类库安装
一.安装tesserocr 1.首先下载tesseract:https://digi.bib.uni-mannheim.de/tesseract/ ,我下载的是tesseract-ocr-setup- ...
- Vue如何mock数据模拟Ajax请求
我们在做一个项目时前期可能没有后端提供接口模拟数据,那么作为前端就需要自己写json文件模拟数据加载.网上往往参考的都是不全面的,比如get请求没问题但是post请求就报错了.在Vue中只需要vue- ...
- web前端开发——css
一.css介绍 1.css是什么? Cascading Style Sheets缩写,层叠样式表.样式定义如何显示HTML元素,样式通常又会存在于样式表中. 2.为什么需要css? 使HTML页面变得 ...