제출 #1126206

#제출 시각아이디문제언어결과실행 시간메모리
1126206qrn별들과 삼각형 (IZhO11_triangle)C++17
100 / 100
551 ms32720 KiB
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #define intt long long #define pb push_back #define endl "\n" #define ALL(x) x.begin(), x.end() void solve() { int n, x, y; cin >> n; set<vector<int>> se; for (int i = 0; i < n; i++){ cin >> x >> y; se.insert({x, y}); } map<intt, intt> mx, my; for (auto mpmppmpmp : se){ mx[mpmppmpmp[0]]++; my[mpmppmpmp[1]]++; } intt ans = 0; for (auto mpmppmpmp : se){ ans += (mx[mpmppmpmp[0]] - 1) * (my[mpmppmpmp[1]] - 1); } cout << ans << endl; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); intt tst = 1; // cin >> tst while (tst--) { solve(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...