# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
86987 | abil | Star triangles (IZhO11_triangle) | C++14 | 711 ms | 38916 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.
/**
Solution by Abil
**/
#include <bits/stdc++.h>
using namespace std;
const int N = 300000 + 12;
int x[N],y[N];
map<int,int > mpx,mpy;
int main()
{
int n;
cin >> n;
for(int i = 1;i <= n; i++){
cin >> x[i] >> y[i];
mpx[x[i]]++;
mpy[y[i]]++;
}
int ans = 0;
for(int i = 1; i <= n; i++){
ans += ((mpx[x[i]] - 1) * (mpy[y[i]] - 1));
}
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |