제출 #1211769

#제출 시각아이디문제언어결과실행 시간메모리
1211769michael12별들과 삼각형 (IZhO11_triangle)C++20
0 / 100
0 ms328 KiB
#include<bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define ll long long
using namespace std;
int main(){
    int tt;
    cin >> tt;
    map<int, int> mp, mp1;
    int x,y;
    int ans[tt], ans1[tt];
    for(int i = 0; i < tt; i++){
        
        cin  >> ans[i] >> ans1[i];
        mp[ans[i]]++;
        mp1[ans1[i]]++;
    }
    int s = 0;
    for(int i = 0; i < tt; i++){
      s += (mp[ans[i]] - 1) * (mp[ans1[i]] - 1);
    }
    cout << s;
    


}
#Verdict Execution timeMemoryGrader output
Fetching results...