单选题

#include <bits/stdc++.h>us...

发布于 2022-03-03 14:08:19

#include <bits/stdc++.h>
using namespace std
int main() {
int n
scanf("%d", &n)
map <int, int> xs
map <int, int> ys
map < pair <int, int>, int > zs
long long ans = 0
for (int i = 0 i < n i++) {
int x, y
scanf("%d %d", &x, &y)
ans += (xs[x]++)
ans += (ys[y]++)
ans -= (zs[make_pair(x, y)]++)
}
cout << ans << endl
return 0
}


输入:
6
0 0
0 1
0 2
-1 1
0 1
1 1
则上述程序输出为( )

登录后免费查看答案
关注者
0
被浏览
11
知识点
面圈网VIP题库

面圈网VIP题库全新上线,海量真题题库资源。 90大类考试,超10万份考试真题开放下载啦

去下载看看