Submission #884620

#TimeUsernameProblemLanguageResultExecution timeMemory
884620AndreyStar triangles (IZhO11_triangle)C++14
0 / 100
0 ms348 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[a]++; } 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...