# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
974848 | vjudge1 | Star triangles (IZhO11_triangle) | C++98 | 400 ms | 12292 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;
int n;
int x[300000+5],y[300000+5];
map<int,int> cntX,cntY;
int main(){
cin>>n;
for (int i = 0; i < n; i++)
{
int tempX,tempY;
cin>>tempX>>tempY;
x[i]=tempX;
y[i]=tempY;
cntX[tempX]++;
cntY[tempY]++;
}
long long ans=0;
for (int i = 0; i < n; i++)
{
ans+=1ll*(cntX[x[i]]-1)*(cntY[y[i]]-1);
}
cout<<ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |