제출 #1129223

#제출 시각아이디문제언어결과실행 시간메모리
1129223mnbvcxz123별들과 삼각형 (IZhO11_triangle)C++20
100 / 100
417 ms9216 KiB
#include<bits/stdc++.h> using namespace std; using ll = long long; map < ll , ll > X, Y; ll x[300005], y[300005]; int main() { ll n, m, r, i, j, ans, t; cin >> n; for (i= 1; i<= n; i ++) { cin >> x[i] >> y[i]; X[x[i]] ++; Y[y[i]] ++; } ans =0; for (i = 1; i <= n; i ++) { r = (X[x[i]] - 1) * (Y[y[i]] - 1); ans += r; } cout << ans << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...