제출 #1133337

#제출 시각아이디문제언어결과실행 시간메모리
1133337michael12별들과 삼각형 (IZhO11_triangle)C++20
100 / 100
606 ms32700 KiB
#include<iostream>
#include<vector>
#include<map>
#include<set>
using namespace std;
int main(){
    int a,b,c,d,e,x,y;
    cin>>a;
    set<vector<int>> s;
    map<long long int, long long int> mp,mp1;
    for(long long int i=1; i<=a; i++){
        
        
      
        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) * (mp1[el[1]] - 1);
       }
    
    cout<<ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...