# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1125896 | nuutsnoynton | Star triangles (IZhO11_triangle) | C++20 | 469 ms | 9216 KiB |
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
map < ll , ll > X, Y;
ll x[300005], y[300005];
int main() {
ll n, m, r, i, j, ans, t;
cin >> n;
for (i= 1; i<= n; i ++) {
cin >> x[i] >> y[i];
X[x[i]] ++;
Y[y[i]] ++;
}
ans =0;
for (i = 1; i <= n; i ++) {
r = (X[x[i]] - 1) * (Y[y[i]] - 1);
ans += r;
}
cout << ans << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |