Submission #920294

#TimeUsernameProblemLanguageResultExecution timeMemory
920294hasuhasuiroStar triangles (IZhO11_triangle)C++17
100 / 100
348 ms12368 KiB
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector X(N, 0), Y(N, 0); 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]]++; for(int i = 0; i < N; i++) mpy[Y[i]]++; long long ans(0); for(int i = 0; i < N; i++) ans += ((long long)(mpx[X[i]]-1) * (long long)(mpy[Y[i]]-1)); cout << ans << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...