Pagini recente » Cod sursa (job #2462893) | Cod sursa (job #2755824) | Cod sursa (job #3224159) | Cod sursa (job #2496394) | Cod sursa (job #2755832)
#include <bits/stdc++.h>
#define MAXX 1000005
using namespace std;
int main()
{
ifstream f("patrate3.in");
ofstream g("patrate3.out");
set<pair<int,int>> points;
int n;
f>>n;
double x,y;
for(int i=0;i<n;i++)
{
f>>x>>y;
points.insert(make_pair(round(x*10000),round(y*10000)));
}
int nr=0;
int a,b,aa,bb;
for(auto i=points.begin();i!=points.end();i++)
for(auto j=points.begin();j!=points.end();j++)
{
if(i!=j)
{
a=i->second-j->second+j->first;
aa=j->first-i->first+j->second;
b=i->second-j->second+i->first;
bb=j->first-i->first+i->second;
if(points.find({a,b})!=points.end()&&points.find({aa,bb})!=points.end())
nr++;
}
}
g<<nr/4;
return 0;
}