제출 #1307073

#제출 시각아이디문제언어결과실행 시간메모리
1307073dang_hai_long별들과 삼각형 (IZhO11_triangle)C++20
0 / 100
1 ms572 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; map<int, int> row, col; vector <pair<int, int>> a(n); for (auto &x:a) { cin >> x.first >> x.second; row[x.first]++; col[x.second]++; } int res = 0; for (auto &x:a) { res += (row[x.first] - 1) * (row[x.second] - 1); } cout << res << "\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...