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