# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
975621 | vjudge1 | 별들과 삼각형 (IZhO11_triangle) | C++17 | 426 ms | 8088 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
signed main() {
int n;
cin >> n;
map<int, vector<int>> xx;
map<int, ll> yy;
for (int i = 0; i< n; i++) {
int x, y;
cin >> x >> y;
xx[x].push_back(y);
yy[y]++;
}
ll ans = 0;
for (auto [x, v] : xx) {
for (int y : v) {
ans += (yy[y] - 1LL) * (ll) (v.size() - 1LL);
}
}
cout << ans << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |