제출 #1136138

#제출 시각아이디문제언어결과실행 시간메모리
1136138yoshi별들과 삼각형 (IZhO11_triangle)C++20
100 / 100
272 ms9236 KiB
#include<bits/stdc++.h>
#define ll long long
using namespace std;
void uwu(){
    ll n;
    cin>>n;
    ll x[n],y[n];
    map<ll,ll> a,b;
    for(ll i=0; i<n; i++){
        cin>>x[i]>>y[i];
        a[x[i]]++;
        b[y[i]]++;
    }
    ll ans=0;
    for(ll i=0; i<n; i++){
        ans+=(a[x[i]]-1)*(b[y[i]]-1);
    }
    cout<<ans<<"\n";
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll t=1;
    //cin>>t;
    while(t--){
        uwu();
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...