제출 #1202303

#제출 시각아이디문제언어결과실행 시간메모리
1202303PlayVoltz별들과 삼각형 (IZhO11_triangle)C++20
100 / 100
273 ms9220 KiB
#include <cstdio>
#include <stdio.h>
#include <stdbool.h>
#include <iostream>
#include <map>
#include <vector>
#include <climits>
#include <stack>
#include <string>
#include <queue>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <cmath>
#include <cctype>
#include <bitset>
#include <iomanip>
#include <cstring>
#include <numeric>
#include <cassert>
using namespace std;

#define int long long
#define pii pair<int, int>
#define mp make_pair
#define pb push_back
#define fi first
#define se second

int32_t main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n, ans=0;
	cin>>n;
	vector<pii> vect(n);
	map<int, int> x, y;
	for (int i=0; i<n; ++i)cin>>vect[i].fi>>vect[i].se, ++x[vect[i].fi], ++y[vect[i].se];
	for (int i=0; i<n; ++i)ans+=(x[vect[i].fi]-1)*(y[vect[i].se]-1);
	cout<<ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...