# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1240309 | themoon | Star triangles (IZhO11_triangle) | C++20 | 382 ms | 9236 KiB |
#include <bits/stdc++.h>
#define int long long
#define bismillah ios_base::sync_with_stdio(false);
using namespace std;
signed main() {
bismillah;
int n;
cin >> n;
map<int, int> X, Y;
int x[n+5], y[n+5];
for(int i = 1; i <= n; i++){
cin >> x[i] >> y[i];
X[x[i]]++;
Y[y[i]]++;
}
int ans = 0;
for(int i = 1; i <= n; i++){
ans += (X[x[i]] - 1) * (Y[y[i]] - 1);
}
cout << ans <<endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |