Submission #572243

#TimeUsernameProblemLanguageResultExecution timeMemory
572243SSRSStar triangles (IZhO11_triangle)C++14
100 / 100
486 ms12188 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; vector<int> X(N), Y(N); for (int i = 0; i < N; i++){ cin >> X[i] >> Y[i]; } map<int, int> mpX, mpY; for (int i = 0; i < N; i++){ mpX[X[i]]++; mpY[Y[i]]++; } long long ans = 0; for (int i = 0; i < N; i++){ ans += (long long) (mpX[X[i]] - 1) * (mpY[Y[i]] - 1); } cout << ans << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...