Submission #887994

#TimeUsernameProblemLanguageResultExecution timeMemory
887994Hovhannes1234Star triangles (IZhO11_triangle)C++17
0 / 100
0 ms348 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; map <int, int> mp; for(int i=1; i<=n; i++){ int x,y; cin>>x>>y; mp[x]++; } long long ans=0; for(auto it : mp){ if(it.second>1){ ans+=(it.second*it.second-1)/2 * (n-it.second); } } cout<<ans<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...