# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1133334 | michael12 | Star triangles (IZhO11_triangle) | C++20 | 0 ms | 328 KiB |
#include<iostream>
#include<vector>
#include<map>
#include<set>
using namespace std;
int main(){
long long int a,b,c,d,e;
cin>>a;
set<vector<long long int>> s;
map<long long int, long long int> mp,mp1;
for(int i=1; i<=a; i++){
long long x,y;
cin>>x>>y;
s.insert({x,y});
}
for(auto el : s){
mp[el[0]]++;
mp1[el[1]]++;
}
long long int ans=0;
for(auto el : s){
ans+=(mp[el[0]] - 1) * (mp[el[1]] - 1);
}
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |