# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
5879 | kriii | Star triangles (IZhO11_triangle) | C++98 | 532 ms | 7644 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 <stdio.h>
#include <map>
using namespace std;
map<int, long long> X,Y;
int x[300003],y[300003];
int main()
{
int N;
scanf ("%d",&N);
for (int i=0;i<N;i++){
scanf ("%d %d",&x[i],&y[i]);
X[x[i]]++; Y[y[i]]++;
}
long long ans = 0;
for (int i=0;i<N;i++) ans += (X[x[i]] - 1) * (Y[y[i]] - 1);
printf ("%lld\n",ans);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |