제출 #1133674

#제출 시각아이디문제언어결과실행 시간메모리
1133674MunkhturErdenebat별들과 삼각형 (IZhO11_triangle)C++20
100 / 100
405 ms9228 KiB
#include<bits/stdc++.h>
#include<string.h>
#include <algorithm>
#include <stdlib.h>
#define fr first
#define sc second
 #define ll long long
using namespace std;
    ll a,b,c,d,e,f,m,i,j,n,h,g,l,r,ka,p,q,k[500005],t[500005];
    map<ll,ll> maa,mii,mee;
    vector<ll> vis,vo,vi;
int main(){
    cin>>a;
    for(i=0 ; i<a ; i++){
        cin>>k[i]>>t[i];
        maa[k[i]]++;
        mee[t[i]]++;
    }
    h=0;
    for(i=0 ; i<a ; i++){
        h+=(maa[k[i]]-1)*(mee[t[i]]-1);
    }
    cout<<h<<endl;
}
#Verdict Execution timeMemoryGrader output
Fetching results...