/** @BY_KUTBILIM **/
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define ll long long
int main(){
ios_base::sync_with_stdio(false);
cin.tie();
int n;
cin >> n;
int x[n], y[n];
map<int,int> ox, oy;
for(int i = 0; i < n; i++){
cin >> x[i] >> y[i];
ox[x[i]]++;
oy[y[i]]++;
}
ll ans = 0;
for(int i = 0; i < n; i++){
ans += 1LL * (ox[x[i]] - 1) * (oy[y[i]] - 1);
}
cout << ans << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
1 ms |
364 KB |
Output is correct |
7 |
Correct |
1 ms |
364 KB |
Output is correct |
8 |
Correct |
1 ms |
364 KB |
Output is correct |
9 |
Correct |
1 ms |
364 KB |
Output is correct |
10 |
Correct |
1 ms |
364 KB |
Output is correct |
11 |
Correct |
1 ms |
364 KB |
Output is correct |
12 |
Correct |
7 ms |
1004 KB |
Output is correct |
13 |
Correct |
7 ms |
1132 KB |
Output is correct |
14 |
Correct |
13 ms |
1388 KB |
Output is correct |
15 |
Correct |
122 ms |
4460 KB |
Output is correct |
16 |
Correct |
135 ms |
4588 KB |
Output is correct |
17 |
Correct |
121 ms |
4460 KB |
Output is correct |
18 |
Correct |
119 ms |
4460 KB |
Output is correct |
19 |
Correct |
344 ms |
5996 KB |
Output is correct |
20 |
Correct |
245 ms |
5356 KB |
Output is correct |
21 |
Correct |
369 ms |
6124 KB |
Output is correct |
22 |
Correct |
375 ms |
6252 KB |
Output is correct |