# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
18635 | mindol | Star triangles (IZhO11_triangle) | C++14 | 203 ms | 7036 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<cstdio>
#include<unordered_map>
using namespace std;
unordered_map<int,int> X,Y;
int x[300001],y[300001];
int main()
{
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++)
scanf("%d %d",&x[i],&y[i]), X[x[i]]++, Y[y[i]]++;
long long ans=0;
for(int i=1;i<=n;i++)
ans+=(X[x[i]]-1ll)*(Y[y[i]]-1);
printf("%lld",ans);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |