Submission #1092042

# Submission time Handle Problem Language Result Execution time Memory
1092042 2024-09-23T02:42:40 Z juicy Star triangles (IZhO11_triangle) C++17
100 / 100
250 ms 5716 KB
#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif

int main() {
  ios::sync_with_stdio(false); cin.tie(nullptr);

  int n; cin >> n;
  vector<int> x(n), y(n);
  map<int, int> a, b;
  for (int i = 0; i < n; ++i) {
    cin >> x[i] >> y[i];
    ++a[x[i]], ++b[y[i]];
  }
  int res = 0;
  for (int i = 0; i < n; ++i) {
    res += (a[x[i]] - 1) * (b[y[i]] - 1);
  }
  cout << res;
  return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 5 ms 860 KB Output is correct
13 Correct 4 ms 860 KB Output is correct
14 Correct 7 ms 1352 KB Output is correct
15 Correct 83 ms 4176 KB Output is correct
16 Correct 91 ms 4176 KB Output is correct
17 Correct 83 ms 4056 KB Output is correct
18 Correct 83 ms 3924 KB Output is correct
19 Correct 233 ms 5456 KB Output is correct
20 Correct 168 ms 4948 KB Output is correct
21 Correct 250 ms 5716 KB Output is correct
22 Correct 246 ms 5712 KB Output is correct