Submission #1259863

#TimeUsernameProblemLanguageResultExecution timeMemory
1259863khaerulmamu별들과 삼각형 (IZhO11_triangle)C++20
0 / 100
1 ms328 KiB
#include <bits/stdc++.h>
using namespace std;
#define ll long long


int main (){
    int N;
    cin >> N;

    vector<pair<int,int>> t (N);
    for(int i=0; i<N; i++){
        cin >> t[i].first >> t[i].second;
    }

    ll ans=0;
    for(int i=0; i<N; i++){
        int x=0;
        int y=0;
        for(int j=0; j< N; j++){
            if(t[i].first==t[j].first && t[i].second == t[j].second)continue;
            if(t[i].first==t[j].first) y++;
            if(t[i].second==t[j].second) x++;
        }
        ans += min(x,y);
    }

    cout << ans <<endl;
    
}
#Verdict Execution timeMemoryGrader output
Fetching results...