제출 #1140139

#제출 시각아이디문제언어결과실행 시간메모리
1140139ALTAKEXE별들과 삼각형 (IZhO11_triangle)C++20
100 / 100
338 ms5836 KiB
#include <bits/stdc++.h> #define ll long long #define ff first #define ss second #define pb push_back #define eb emplace_back #define inf INT_MAX #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define FAR(i, a, b) for (int i = (a); i >= (b); i--) #define all(x) x.begin(), x.end() const int MOD = 1e9 + 7; using namespace std; void solve() { int n, ans = 0; cin >> n; int a[n], b[n]; map<int, int> x, y; FOR(i, 0, n) { cin >> a[i] >> b[i]; x[a[i]]++; y[b[i]]++; } FOR(i, 0, n) ans += (x[a[i]] - 1) * (y[b[i]] - 1); cout << ans << endl; } int main() { int T = 1; // cin >> T; while (T--) { solve(); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...