| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1356675 | nathlol2 | Star triangles (IZhO11_triangle) | C++20 | 63 ms | 7824 KiB |
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 3e5 + 5;
int n, ans, x[N], y[N];
unordered_map<int, int> xc, yc;
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n;
for(int i = 1;i<=n;i++) cin >> x[i] >> y[i], xc[x[i]]++, yc[y[i]]++;
for(int i = 1;i<=n;i++){
ans += (xc[x[i]] - 1) * (yc[y[i]] - 1);
}
cout << ans;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
