-
Notifications
You must be signed in to change notification settings - Fork 2
/
AprB.cpp
66 lines (57 loc) · 974 Bytes
/
AprB.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include<iostream>
#include<fstream>
#include<string>
#include<sstream>
#include<cstring>
#include<algorithm>
#include<map>
#include<vector>
using namespace std;
//ifstream inf("ti.in");
//ofstream ouf("ti.out");
const int maxlongint=2147483647;
class D
{
public:
long long x,y;
bool operator <(const D w) const
{
if (x!=w.x)
return x<w.x;
else
return y<w.y;
}
};
int i,j,k,n,m,zz,zu,mm;
bool f[1050];
map<D,int> hash;
D dian[1005];
int main()
{
cin>>zu;
for (zz=1;zz<=zu;zz++)
{
cin>>n;
hash.clear();
for (i=1;i<=n;i++)
{
cin>>dian[i].x>>dian[i].y;
hash[dian[i]]=i;
}
mm=0;
for (i=1;i<=n;i++)
{
int ttx=dian[i].x*2,tty=dian[i].y*2;
for (j=1;j<=n;j++)
{
if ((i==j)||(!(dian[j]<dian[i])))
continue;
D tt;
tt.x=ttx-dian[j].x;tt.y=tty-dian[j].y;
if (hash.count(tt))
mm++;
}
}
cout<<mm<<endl;
}
}