제출 #1307074

#제출 시각아이디문제언어결과실행 시간메모리
1307074dang_hai_longStar triangles (IZhO11_triangle)C++20
100 / 100
445 ms5836 KiB
#include <bits/stdc++.h>

using namespace std;

int main() {
	int n;
	cin >> n;
	map<int, int> row, col;
	vector <pair<int, int>> a(n);
	for (auto &x:a) {
		cin >> x.first >> x.second;
		row[x.first]++;
		col[x.second]++;
	}
	long long res = 0;
	for (auto &x:a) {
		res += (row[x.first] - 1) * (col[x.second] - 1);
	}
	cout << res << "\n";
	
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...