2019 徐州网络赛 center

题意: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 }

 

posted @ 2019-09-12 22:08  古比  阅读(236)  评论(0编辑  收藏  举报