# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
4874 | ainta | Star triangles (IZhO11_triangle) | C++98 | 476 ms | 6588 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<algorithm>
#include<map>
using namespace std;
map<int, int>Map1, Map2;
int n, w[300010][2], i;
long long R;
int main()
{
scanf("%d", &n);
for (i = 0; i < n; i++){
scanf("%d%d", &w[i][0], &w[i][1]);
Map1[w[i][0]]++, Map2[w[i][1]]++;
}
for (i = 0; i < n; i++){
R = R +(long long)(Map1[w[i][0]] - 1)*(Map2[w[i][1]] - 1);
}
printf("%lld\n", R);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |