码迷,mamicode.com
首页 > 其他好文 > 详细

2019 徐州网络赛 center

时间:2019-09-12 23:31:56      阅读:97      评论:0      收藏:0      [点我收藏+]

标签:题解   define   const   iterator   eof   out   unsigned   最大   for   

题意:n个点,求最小加上几个点让所有点关于一个点(不需要是点集里面的点)中心对称

题解:双重循环枚举,把中点记录一下,结果是n-最大的中点

 1 #include <bits/stdc++.h>
 2 using namespace std;
 3 typedef long long ll;
 4 typedef unsigned long long ull;
 5 #define mem(s) memset(s, 0, sizeof(s))
 6 const int INF = 0x3f3f3f3f;
 7 const double eps = 1e-8;
 8 const int maxn = 1000+5;
 9 const int mod = 998244353;
10 pair<int,int>P[maxn],tmp;
11 map<pair<int,int>,int>mp;
12 int main() 
13 {
14     int n;
15     scanf("%d",&n);
16     for(int i=1;i<=n;i++){
17         scanf("%d%d",&P[i].first,&P[i].second);
18     }
19     for(int i=1;i<=n;i++){
20         for(int j=1;j<=n;j++){
21             mp[make_pair((P[i].first+P[j].first),(P[i].second+P[j].second))]++;
22         }
23     }
24     map<pair<int,int>,int>::iterator it;
25     int ans=0;
26     for(it=mp.begin();it!=mp.end();it++){
27         ans=max(it->second,ans);
28     }
29     cout<<n-ans<<endl;
30     return 0;
31 }

 

2019 徐州网络赛 center

标签:题解   define   const   iterator   eof   out   unsigned   最大   for   

原文地址:https://www.cnblogs.com/pangbi/p/11515395.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!