제출 #1326658

#제출 시각아이디문제언어결과실행 시간메모리
1326658kawhiet별들과 삼각형 (IZhO11_triangle)C++20
0 / 100
1 ms332 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    map<int, int> m;
    for (int i = 0; i < n; i++) {
        int x, y;
        cin >> x >> y;
        m[x]++;
    }
    long long ans = 0;
    for (auto [_, cnt] : m) {
        ans += 1LL * cnt * (cnt - 1) / 2 * (n - cnt);
    }
    cout << ans << '\n';
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...