15762022-11-27 01:02:02TomaSajtCsodálatos Csillagképekcpp14Accepted 100/100386ms30860 KiB
#include <bits/stdc++.h>
#define speed ios::sync_with_stdio(0);cin.tie(0)
using namespace std;

int main() {
    speed;
    int n;
    cin >> n;
    map<int, int> xc, yc;
    vector<pair<int, int>> pts(n);
    for (auto& [x, y] : pts) {
        cin >> x >> y;
        xc[x]++;
        yc[y]++;
    }
    long long res = 0;
    for (auto& [x, y] : pts) {
        res += (xc[x] - 1ll) * (yc[y] - 1);
    }
    cout << res;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1844 KiB
subtask225/25
2Accepted2ms2028 KiB
3Accepted2ms2220 KiB
4Accepted2ms2392 KiB
5Accepted2ms2420 KiB
subtask340/40
6Accepted3ms2844 KiB
7Accepted3ms2692 KiB
8Accepted2ms2772 KiB
9Accepted3ms3236 KiB
10Accepted3ms3316 KiB
11Accepted3ms3608 KiB
subtask435/35
12Accepted18ms4212 KiB
13Accepted386ms29864 KiB
14Accepted150ms18888 KiB
15Accepted28ms5260 KiB
16Accepted39ms5604 KiB
17Accepted263ms25912 KiB
18Accepted74ms12936 KiB
19Accepted52ms6616 KiB
20Accepted356ms29876 KiB
21Accepted372ms30860 KiB