Submission #887995

#TimeUsernameProblemLanguageResultExecution timeMemory
887995Hovhannes1234Star triangles (IZhO11_triangle)C++17
0 / 100
1 ms348 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; map <long long, long long> mp; for(int i=1; i<=n; i++){ long long x,y; cin>>x>>y; mp[y]++; } 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...