Submission #552665

#TimeUsernameProblemLanguageResultExecution timeMemory
552665KN200711Star triangles (IZhO11_triangle)C++14
100 / 100
546 ms12232 KiB
# include <bits/stdc++.h> # define ll long long using namespace std; int main() { 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; ans = 0ll; for(int i=0;i<N;i++) { ans += (ll) (x[X[i]]-1ll) * (ll) (y[Y[i]] - 1ll); } cout<<ans<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...