# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
888252 | kokoue | Star triangles (IZhO11_triangle) | C++14 | 239 ms | 10064 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
struct point
{
int x,y;
};
point p[300000];
//int x[100000],y[100000];
map<int,int> y,x;
int n;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cin>>n;
for(int i=0;i<n;i++)
{
cin>>p[i].x>>p[i].y;
x[p[i].x]++;
y[p[i].y]++;
}
int ans=0;
for(int i=0;i<n;i++)
{
ans+=(x[p[i].x]-1)*(y[p[i].y]-1);
}
cout<<ans<<"\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |