본문 바로가기
728x90
반응형

programmers14

[Programmers] 하노이의 탑 (C++) https://school.programmers.co.kr/learn/courses/30/lessons/12946 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr하노이 타워한쪽에 쌓인 원판들을 한 장씩 기둥에서 기둥으로 옮겨 최종적으로는 다른 기둥에 옮기는 것입니다.단, 작은 원판 위에 큰 원판을 쌓을 수는 없습니다.마우스로 드래그하여 원판을 옮겨 보세요.하노이 타워 이야기인도에 범천의 탑이라는 것이 있다고 합니다.인도의 신인 범천이 우주 창조시에 만든 것이라는 말이 전해져 내려옵니다.거기에는 세 개의 다이어몬드 기둥과 중심에 구멍이 있는 64장의 순금 원판이 있습니다.원판은 모두 크기가 다르며 작은 쪽.. 2025. 4. 8.
[Programmers] 문자열 내림차순으로 배치하기 (C++) https://school.programmers.co.kr/learn/courses/30/lessons/12917 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr#include #include #include using namespace std;bool IsGreater(char left, char right) { return left > right;}string solution(string s) { string answer = ""; vector sArr; sArr.reserve(s.length()); for (int i = 0; i 2025. 4. 8.
[Programmers] 명예의 전당(1) (c++) https://school.programmers.co.kr/learn/courses/30/lessons/138477 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr #include #include #include using namespace std;vector solution(int k, vector score) { vector answer; vector top; for (int i = 0; i 0) { if (top.size() 2025. 4. 8.
[Programmers] 같은 숫자는 싫어 (c++) https://school.programmers.co.kr/learn/courses/30/lessons/12906 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr방법 1#include #include using namespace std;vector solution(vector arr){ vector answer; for (int i = 0; i 방법 2 . unique를 통한 해결#include #include #include using namespace std;vector solution(vector arr){ arr.erase(unique(arr.begin(), arr.end()), .. 2025. 4. 3.
[Programmers] 완주하지 못한 선수 (C++) https://school.programmers.co.kr/learn/courses/30/lessons/42576 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr정렬을 한 후 같은 인덱스의 값이 다르면 return, for 문을 빠져나왔다면 참가자의 마지막 값을 return.#include #include #include using namespace std;string solution(vector participant, vector completion) { sort(participant.begin(), participant.end()); sort(completion.begin(), comple.. 2025. 4. 3.
[Programmers] 약수의 개수와 덧셈(C++) https://school.programmers.co.kr/learn/courses/30/lessons/77884 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krhttps://jjomnoon-diary.tistory.com/55 [Programmers] 약수의 합(c++)https://school.programmers.co.kr/learn/courses/30/lessons/12928 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr약수는 나눈 나머지가 0jjomnoon-diary.tistory.com위의 .. 2025. 4. 3.
728x90
반응형