728x90
반응형
SMALL
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(vector<int> sides) {
int answer = 0;
sort(sides.begin(),sides.end());
//만들수 있 1, 없 2
return sides[2]<sides[0]+sides[1] ? 1:2;
}
728x90
반응형
LIST
'C++' 카테고리의 다른 글
| [프로그래머스] 점의 위치 구하기 (0) | 2025.09.04 |
|---|---|
| [프로그래머스] 배열 자르기 (0) | 2025.09.03 |
| [프로그래머스] 머쓱이보다 키 큰 사람 (0) | 2025.09.03 |
| [프로그래머스] 자릿수 더하기 (0) | 2025.09.03 |
| [프로그래머스] 최댓값 만들기 (0) | 2025.09.03 |
댓글