Submission #889462

# Submission time Handle Problem Language Result Execution time Memory
889462 2023-12-19T19:04:40 Z Kakarot Star triangles (IZhO11_triangle) C++
0 / 100
1 ms 348 KB
#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;
}
# Verdict Execution time Memory 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 -