# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
887994 | Hovhannes1234 | Star triangles (IZhO11_triangle) | C++17 | 0 ms | 348 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |