# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1140503 | Nurislam | Star triangles (IZhO11_triangle) | C++20 | 344 ms | 5840 KiB |
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> x(n), y(n);
map<int, int> mpx, mpy;
for( int i = 0; i < n; i++ ) {
cin >> x[i] >> y[i];
mpx[x[i]]++;
mpy[y[i]]++;
}
int ans = 0;
for(int i = 0; i < n; i++){
ans += ( mpx[x[i]] - 1 ) * ( mpy[y[i]] - 1);
}
cout << ans << '\n';
};
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |