60302023-10-27 21:11:40CzDaniCsodálatos Csillagképekcpp17Accepted 100/100153ms32196 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted4ms7976 KiB
subtask225/25
2Accepted4ms8256 KiB
3Accepted4ms8512 KiB
4Accepted4ms8432 KiB
5Accepted4ms8688 KiB
subtask340/40
6Accepted4ms8888 KiB
7Accepted4ms9044 KiB
8Accepted6ms9184 KiB
9Accepted6ms9316 KiB
10Accepted6ms9488 KiB
11Accepted6ms9600 KiB
subtask435/35
12Accepted29ms10140 KiB
13Accepted150ms19272 KiB
14Accepted72ms20504 KiB
15Accepted43ms14932 KiB
16Accepted63ms15872 KiB
17Accepted115ms24308 KiB
18Accepted41ms25192 KiB
19Accepted82ms20164 KiB
20Accepted149ms29404 KiB
21Accepted153ms32196 KiB