# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1259863 | khaerulmamu | 별들과 삼각형 (IZhO11_triangle) | C++20 | 1 ms | 328 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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |