#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
则上述程序输出为( )
6
0 0
0 1
0 2
-1 1
0 1
1 1
则上述程序输出为( )
正确答案: C 你的答案: 空 (错误)
9
10
11
12一直没看明白,日了,MARK一下https://www.nowcoder.com/test/question/done?tid=26691823&qid=305091#summary