#include <bits/stdc++.h>
#define ii unordered_map<int,int>
#define vi vector<int>
#define vii vector<pair<int,int>>
using namespace std;
void setIO() {
cin.tie(0)->sync_with_stdio(0);
}
void solve() {
int n,ans = 0;
cin >> n;
ii fx,fy;
vi X(n),Y(n);
for(int i = 0;i < n;++i) {
cin >> X[i] >> Y[i];
++fx[X[i]];
++fy[Y[i]];
}
for(int i = 0;i < n;++i)
ans += (fx[X[i]] == 2 && fy[Y[i]] == 2);
cout << ans;
}
int main() {
setIO();
solve();
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |