Submission #1110797

#TimeUsernameProblemLanguageResultExecution timeMemory
1110797HasanV11010238Star triangles (IZhO11_triangle)C++17
100 / 100
735 ms39148 KiB
#include <bits/stdc++.h> using namespace std; #define ld long double #define ll long long int main(){ 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<int, ll> mx, my; for (auto el : se){ mx[el[0]]++; my[el[1]]++; } ll ans = 0; for (auto el : se){ ans += (mx[el[0]] - 1) * (my[el[1]] - 1); } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...