#include<bits/stdc++.h>
using namespace std;
long long a,b,c,d,e,pas;
pair <long long, long long> p[300009];
map <long long, long long> x,y;
int main(){
ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
cin>>a;
for(b=1; b<=a; b++){
cin>>p[b].first>>p[b].second;
x[p[b].first]++;
y[p[b].second]++;
}
for(b=1; b<=a; b++){
pas+=(x[p[b].first]-1)*(y[p[b].second]-1);
}
cout<<pas;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Correct |
2 ms |
376 KB |
Output is correct |
5 |
Correct |
2 ms |
376 KB |
Output is correct |
6 |
Correct |
2 ms |
376 KB |
Output is correct |
7 |
Correct |
2 ms |
508 KB |
Output is correct |
8 |
Correct |
2 ms |
376 KB |
Output is correct |
9 |
Correct |
6 ms |
376 KB |
Output is correct |
10 |
Correct |
3 ms |
392 KB |
Output is correct |
11 |
Correct |
15 ms |
376 KB |
Output is correct |
12 |
Correct |
10 ms |
1272 KB |
Output is correct |
13 |
Correct |
11 ms |
1276 KB |
Output is correct |
14 |
Correct |
16 ms |
1784 KB |
Output is correct |
15 |
Correct |
176 ms |
8028 KB |
Output is correct |
16 |
Correct |
189 ms |
8440 KB |
Output is correct |
17 |
Correct |
172 ms |
7928 KB |
Output is correct |
18 |
Correct |
195 ms |
8056 KB |
Output is correct |
19 |
Correct |
552 ms |
14824 KB |
Output is correct |
20 |
Correct |
391 ms |
11972 KB |
Output is correct |
21 |
Correct |
558 ms |
15588 KB |
Output is correct |
22 |
Correct |
554 ms |
15680 KB |
Output is correct |