제출 #884621

#제출 시각아이디문제언어결과실행 시간메모리
884621AndreyStar triangles (IZhO11_triangle)C++14
100 / 100
623 ms34388 KiB
#include <bits/stdc++.h> using namespace std; map<long long,long long> bruh; map<long long,long long> idk; map<pair<long long,long long>,long long> yay; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); long long n,a,b,ans = 0; cin >> n; vector<pair<long long,long long>> haha(n); for(long long i = 0; i < n; i++) { cin >> a >> b; haha[i] = {a,b}; yay[{a,b}]++; bruh[a]++; idk[b]++; } for(long long i = 0; i < n; i++) { a = haha[i].first; b = haha[i].second; long long c = yay[{a,b}]; ans+=(bruh[a]-c)*(idk[b]-c); } cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...