# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1272005 | uranhishig | Star triangles (IZhO11_triangle) | C++20 | 389 ms | 5828 KiB |
#include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define ff first
#define ss second
signed main() {
int n;
cin >> n;
map<int, int> x, y;
pair<int, int> p[n];
for (int i = 0; i < n; i++) {
cin >> p[i].ff >> p[i].ss;
x[p[i].ff]++;
y[p[i].ss]++;
}
int ans = 0;
for (int i = 0; i < n; i++) {
ans += (x[p[i].ff] - 1) * (y[p[i].ss] - 1);
}
cout << ans << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |