#include <bits/stdc++.h>
using namespace std;
signed main()
{
int n;
cin >> n;
int x[100000], y[100000];
map<int, int> mp1, mp2;
for(int i = 0; i < n; i++)
{
cin >> x[i] >> y[i];
mp1[x[i]]++;
mp2[y[i]]++;
}
int k = 0;
for(int i = 0; i < n; i++)
{
k += (mp1[x[i]] - 1) * (mp2[y[i]] - 1);
}
cout << k;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
1104 KB |
Output is correct |
2 |
Correct |
1 ms |
1104 KB |
Output is correct |
3 |
Correct |
1 ms |
1104 KB |
Output is correct |
4 |
Correct |
1 ms |
1104 KB |
Output is correct |
5 |
Correct |
1 ms |
1104 KB |
Output is correct |
6 |
Correct |
1 ms |
1104 KB |
Output is correct |
7 |
Correct |
2 ms |
1104 KB |
Output is correct |
8 |
Correct |
2 ms |
1104 KB |
Output is correct |
9 |
Correct |
2 ms |
1104 KB |
Output is correct |
10 |
Correct |
2 ms |
1104 KB |
Output is correct |
11 |
Correct |
2 ms |
1104 KB |
Output is correct |
12 |
Correct |
8 ms |
1660 KB |
Output is correct |
13 |
Correct |
9 ms |
1616 KB |
Output is correct |
14 |
Correct |
12 ms |
2128 KB |
Output is correct |
15 |
Correct |
132 ms |
4012 KB |
Output is correct |
16 |
Runtime error |
104 ms |
8124 KB |
Execution killed with signal 11 |
17 |
Halted |
0 ms |
0 KB |
- |