#include <string>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int solution(vector<vector<int>> sizes) {
int max_w = 0;
int max_h = 0;
for(int i=0; i<sizes.size(); i++){
for(int j=0; j<sizes[0].size(); j++){
sort(sizes[i].begin(),sizes[i].end(), greater<int>());
}
cout<<sizes[i][0]<<" "<<sizes[i][1]<<"\n";
if(max_w<sizes[i][0]){
max_w = sizes[i][0];
}
if(max_h<sizes[i][1]){
max_h = sizes[i][1];
}
}
cout <<"max_w:"<<max_w <<" max_h:"<<max_h;
return max_w*max_h;
}
'코딩테스트 대비' 카테고리의 다른 글
백준 정렬 문제집 (0) | 2022.10.25 |
---|---|
[프로그래머스 c++] 같은 숫자는 싫어 (1) | 2022.08.22 |
[프로그래머스 c++] 구명보트 (0) | 2022.08.22 |
[c++] 소수점 자릿수 출력하기 / [Softeer] 성적평균 문제 풀이 (0) | 2022.06.10 |
평범한 배낭 문제 (0) | 2022.05.12 |