Submission #1245594

#TimeUsernameProblemLanguageResultExecution timeMemory
1245594blackmonkey48Star triangles (IZhO11_triangle)C++20
100 / 100
225 ms5860 KiB
//======================================================================================================================================================================================================================================================================================================================= #include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define fi first #define se second #define pii pair<int,int> int main() { ios_base::sync_with_stdio(false);cin.tie(nullptr); int n; cin >> n; int x[n], y[n]; map<int,int> X,Y; for(int i=0;i<n;i++){ cin >> x[i] >> y [i]; X[x[i]]++; Y[y[i]]++; } ll ans=0; for(int i=0;i<n;i++){ ans+= (X[x[i]]-1) * (Y[y[i]]-1); } cout << ans << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...