Submission #972844

#TimeUsernameProblemLanguageResultExecution timeMemory
972844vjudge1Star triangles (IZhO11_triangle)C++17
100 / 100
393 ms13820 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ int N; cin >> N; vector<pair<int, int>>v(N); map<int, ll>cntX, cntY; for(auto &[x, y]: v){ cin >> x >> y; cntX[x]++; cntY[y]++; } ll ans = 0; for(auto &[x, y]: v){ ans += max(0LL, (cntX[x] - 1)*(cntY[y] - 1)); } cout << ans << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...