# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
593297 | daisy2 | Star triangles (IZhO11_triangle) | C++14 | 352 ms | 5304 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<iostream>
#include<algorithm>
#include<unordered_map>
using namespace std;
int n,x[300005],y[300005];
unordered_map <long long,long long> row,col;
int main()
{
cin>>n;
for(int i=0;i<n;i++)
{
cin>>x[i]>>y[i];
if(!col.count(x[i]))
col[x[i]]=0;
if(!row.count(y[i]))
row[y[i]]=0;
col[x[i]]++;
row[y[i]]++;
}
long long br=0;
for(int i=0;i<n;i++)
{
br+=(row[y[i]]-1)*(col[x[i]]-1);
}
cout<<br<<endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |