6030 | 2023-10-27 21:11:40 | CzDani | Csodálatos Csillagképek | cpp17 | Accepted 100/100 | 153ms | 32196 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
struct cord {
int x, y;
};
vector<cord> c(200012);
int col[200015], row[200012];
signed main() {
int n; cin >> n;
for (int i = 0; i < n; i++) {
cin >> c[i].x >> c[i].y;
row[c[i].x]++;
col[c[i].y]++;
}
int ans = 0;
for (int i = 0; i < n; i++) {
ans += (row[c[i].x]-1) * (col[c[i].y]-1);
}
cout << ans << '\n';
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 4ms | 7976 KiB | ||||
subtask2 | 25/25 | ||||||
2 | Accepted | 4ms | 8256 KiB | ||||
3 | Accepted | 4ms | 8512 KiB | ||||
4 | Accepted | 4ms | 8432 KiB | ||||
5 | Accepted | 4ms | 8688 KiB | ||||
subtask3 | 40/40 | ||||||
6 | Accepted | 4ms | 8888 KiB | ||||
7 | Accepted | 4ms | 9044 KiB | ||||
8 | Accepted | 6ms | 9184 KiB | ||||
9 | Accepted | 6ms | 9316 KiB | ||||
10 | Accepted | 6ms | 9488 KiB | ||||
11 | Accepted | 6ms | 9600 KiB | ||||
subtask4 | 35/35 | ||||||
12 | Accepted | 29ms | 10140 KiB | ||||
13 | Accepted | 150ms | 19272 KiB | ||||
14 | Accepted | 72ms | 20504 KiB | ||||
15 | Accepted | 43ms | 14932 KiB | ||||
16 | Accepted | 63ms | 15872 KiB | ||||
17 | Accepted | 115ms | 24308 KiB | ||||
18 | Accepted | 41ms | 25192 KiB | ||||
19 | Accepted | 82ms | 20164 KiB | ||||
20 | Accepted | 149ms | 29404 KiB | ||||
21 | Accepted | 153ms | 32196 KiB |