# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
37258 | Yusup01 | Star triangles (IZhO11_triangle) | C++14 | 679 ms | 10960 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;
long long x[300009],y[300009],jog;
int n;
map<long long,int> X,Y;
int main()
{
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
// freopen("triangle.in","r",stdin);
// freopen("triangle.out","w",stdout);
cin>>n;
for(int i=1;i<=n;i++){cin>>x[i]>>y[i]; X[x[i]]++; Y[y[i]]++;}
for(int i=1;i<=n;i++)
{
jog+=(X[x[i]]-1)*(Y[y[i]]-1);
}
cout<<jog;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |