# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
887995 | Hovhannes1234 | Star triangles (IZhO11_triangle) | C++17 | 1 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 <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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |