1576 | 2022-11-27 01:02:02 | TomaSajt | Csodálatos Csillagképek | cpp14 | Accepted 100/100 | 386ms | 30860 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;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1844 KiB | ||||
subtask2 | 25/25 | ||||||
2 | Accepted | 2ms | 2028 KiB | ||||
3 | Accepted | 2ms | 2220 KiB | ||||
4 | Accepted | 2ms | 2392 KiB | ||||
5 | Accepted | 2ms | 2420 KiB | ||||
subtask3 | 40/40 | ||||||
6 | Accepted | 3ms | 2844 KiB | ||||
7 | Accepted | 3ms | 2692 KiB | ||||
8 | Accepted | 2ms | 2772 KiB | ||||
9 | Accepted | 3ms | 3236 KiB | ||||
10 | Accepted | 3ms | 3316 KiB | ||||
11 | Accepted | 3ms | 3608 KiB | ||||
subtask4 | 35/35 | ||||||
12 | Accepted | 18ms | 4212 KiB | ||||
13 | Accepted | 386ms | 29864 KiB | ||||
14 | Accepted | 150ms | 18888 KiB | ||||
15 | Accepted | 28ms | 5260 KiB | ||||
16 | Accepted | 39ms | 5604 KiB | ||||
17 | Accepted | 263ms | 25912 KiB | ||||
18 | Accepted | 74ms | 12936 KiB | ||||
19 | Accepted | 52ms | 6616 KiB | ||||
20 | Accepted | 356ms | 29876 KiB | ||||
21 | Accepted | 372ms | 30860 KiB |