hdu 5762(鸽笼原理)
来源:互联网 发布:域名购买后要做什么 编辑:程序博客网 时间:2024/06/05 04:35
#include <iostream>#include <cstdio>#include <cstring>#include <cmath>using namespace std;#define N 200020#define LL long longint n, x[N], y[N];bool vis[N];int m;int main() { int cas; scanf("%d", &cas); while(cas--) { scanf("%d%d", &n, &m); for(int i = 1; i <= n; ++i) { scanf("%d%d", &x[i], &y[i]); } if(n > 700) { puts("YES"); continue; } memset(vis, 0, sizeof vis); bool f = 0; for(int i = 1; i <= n; ++i) { for(int j = i + 1; j <= n; ++j) { int d = abs(x[i] - x[j]) + abs(y[i] - y[j]); if(vis[d]) { f = 1; break; } vis[d] = 1; } } if(f) puts("YES"); else puts("NO"); } return 0;}
0 0
- hdu 5762(鸽笼原理)
- HDU 6003 Problem Buyer(鸽笼原理)
- POJ 2356 POJ 3370 HDU 1205 鸽笼原理
- p2356_鸽笼原理!cool!
- 【鸽笼原理】ZOJ 2955
- poj3370 鸽笼原理
- 鸽笼原理及其应用
- 从鸽笼原理到拉姆塞数
- 鸽笼原理应用举例
- hdu5762 鸽笼原理
- 数论 鸽笼原理
- poj 3844 (鸽笼原理)
- poj3370Halloween treats(鸽笼原理)
- poj2356Find a multiple(鸽笼原理)
- 【鸽笼原理】HDU1205吃糖果
- HDU 1664 Different Digits (数论 -- 鸽笼原理 + BFS搜索 + 余数判重)
- hdu 1007 Quoit Design 平面上的最近点对 分治法+鸽笼原理
- 抽屉原理(又名:鸽笼原理)
- Android瀑布流照片墙实现,体验不规则排列的美感
- hdu 5781 2016多校5
- Message事实更新UI
- flidder抓包配置
- LeetCode 378. Kth Smallest Element in a Sorted Matrix
- hdu 5762(鸽笼原理)
- [2.0] 函数式编程初探
- SPOJ 4491 PGCD - Primes in GCD Table(莫比乌斯反演)
- kali2.0 U盘安装无法挂载安装光盘
- Qt操作Excel文件 QtXlsxWriter的配置使用说明
- NativeActivity的胶水层android_native_app_glue详解和使用
- HDU 5781 ATM Mechine (概率dp)(求最优策略期望)
- linux环境下mysql的使用
- 我的csdn博客之旅开启啦!