1595
来源:互联网 发布:扑家汉化组打备用域名 编辑:程序博客网 时间:2024/06/08 04:49
#include<iostream>#include<vector>#include<string>#include<type_traits>#include<sstream>#include<tuple>#include<bitset>#include<regex>#include<set>#include<queue>#include<map>using namespace std;bool compare(pair<int,int> a,pair<int,int> b){if (a.first == b.first) return a.second < b.second;return a.first < b.first;}int main(){int T;cin >> T;int N;while (T--){cin >> N;vector<pair<int, int>> point;set<pair<int, int>> search;double ave_x=0;for (int i = 0; i < N; i++){pair<int, int> temp;cin >> temp.first >> temp.second;ave_x += temp.first;point.push_back(temp);search.insert(temp);}sort(point.begin(),point.end(),compare);ave_x /= N;bool flag = true;for (int i = 0; i < N; i++){pair<int, int> temp = point[i];pair<int, int> temp1;temp1.second = temp.second;temp1.first = 2 * ave_x - temp.first;if (search.find(temp1) == search.end()){cout << "NO" << endl;flag = false;break;}}if (flag) cout << "YES" << endl;}//system("pause");return 0;}
阅读全文
0 0
- 1595
- 北大1595
- joj 1595
- hdu 1595
- HDU 1595
- poj 1595
- poj 1595
- 1595 - Symmetry
- POJ 1595
- uva 1595
- neuoj 1595
- POJ-1595
- POJ-1595
- uva 1595
- UVA 1595
- UVA 1595
- Uva 1595
- UVA 1595
- boost::function的用法(二)
- 剑指offer——两个合并排序的链表
- linux中netstat的使用
- 2017-07-04
- Pandas之Series、DataFrame和axis
- 1595
- BZOJ 2662: [BeiJing wc2012]冻结 分层图 dijkstra
- 设计模式(01) 单例模式(创建类模式)(下,懒汉模式和双重检查锁)
- Dealing with rollback segment corruption when you encounter Error encountered while recovering trans
- Android Studio下,gradle project sync failed 错误
- Netty Client重连实现
- MySQL基础语句以及简单优化
- springmvc 进行上传文件时 报错springmvc 进行上传文件时
- oracle创建数据库一直卡在85%不动