https://school.programmers.co.kr/learn/courses/30/lessons/42746
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
cpp
닫기#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;
string solution(vector<int> numbers) {
//24.10.17
string answer;
sort(numbers.begin(), numbers.end(), [&](const auto& lhs, const auto& rhs) {
return to_string(lhs) + to_string(rhs) > to_string(rhs) + to_string(lhs);
});
for (const auto& n : numbers) answer += to_string(n);
return answer < "1" ? "0" : answer;
}
[level 2] Title: 가장 큰 수, Time: 491.59 ms, Memory: 7.32 MB -BaekjoonHub · developeSHG/Algorithm-Baekjoon_Programmers@756
developeSHG committed Oct 16, 2024
github.com
댓글