#include <bits/stdc++.h>
using namespace std;
map<long long,long long> bruh;
map<long long,long long> idk;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long n,a,b,ans = 0;
cin >> n;
vector<pair<long long,long long>> haha(n);
for(long long i = 0; i < n; i++) {
cin >> a >> b;
haha[i] = {a,b};
bruh[a]++;
idk[a]++;
}
for(long long i = 0; i < n; i++) {
a = haha[i].first;
b = haha[i].second;
ans+=(bruh[a]-1)*(idk[b]-1);
}
cout << ans;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |