본문 바로가기

프로그래머스99

[프로그래머스]2020 카카오 인턴십 : 수식 최대화 (level 2) (c++) https://programmers.co.kr/learn/courses/30/lessons/67257 코딩테스트 연습 - 수식 최대화 IT 벤처 회사를 운영하고 있는 라이언은 매년 사내 해커톤 대회를 개최하여 우승자에게 상금을 지급하고 있습니다. 이번 대회에서는 우승자에게 지급되는 상금을 이전 대회와는 다르게 다음과 � programmers.co.kr #include #include #include #include #include using namespace std; void classify_nums_ops(string &exp, vector &nums, vector &ops) { long long num = 0; for (int i = 0; i < exp.size(); ++i) { // 현재 문자가 숫.. 2020. 7. 7.
[프로그래머스]2020 카카오 인턴십 : 키패드 누르기 (level 1) (c++) https://programmers.co.kr/learn/courses/30/lessons/67256 코딩테스트 연습 - 키패드 누르기 [1, 3, 4, 5, 8, 2, 1, 4, 5, 9, 5] "right" "LRLLLRLLRRL" [7, 0, 8, 2, 8, 3, 1, 5, 7, 6, 2] "left" "LRLLRRLLLRR" [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] "right" "LLRLLRLLRL" programmers.co.kr #include #include #include #include using namespace std; struct pos { int x, y; }; // 0 ~ 9 까지의 숫자 위치 매기기 void set_pos(unordered_map &m) { in.. 2020. 7. 7.
[프로그래머스]2020 KAKAO BLIND RECRUITMENT : 문자열 압축 (level 2)(c++) https://programmers.co.kr/learn/courses/30/lessons/60057 코딩테스트 연습 - 문자열 압축 데이터 처리 전문가가 되고 싶은 어피치는 문자열을 압축하는 방법에 대해 공부를 하고 있습니다. 최근에 대량의 데이터 처리를 위한 간단한 비손실 압축 방법에 대해 공부를 하고 있는데, 문자 programmers.co.kr #include #include #include using namespace std; void concat_string(string &full, string &part, int cnt) { // 중복이 2이상이면 숫자+문자 덧붙이기 if (cnt > 1) { full += to_string(cnt); } // 중복없으면 문자만 덧붙이기 full += par.. 2020. 7. 6.
[프로그래머스]연습문제 : 멀리 뛰기 (level 3)(c++) https://programmers.co.kr/learn/courses/30/lessons/12914 코딩테스트 연습 - 멀리 뛰기 효진이는 멀리 뛰기를 연습하고 있습니다. 효진이는 한번에 1칸, 또는 2칸을 뛸 수 있습니다. 칸이 총 4개 있을 때, 효진이는 (1칸, 1칸, 1칸, 1칸) (1칸, 2칸, 1칸) (1칸, 1칸, 2칸) (2칸, 1칸, 1칸) (2칸, 2�� programmers.co.kr DP #include #include using namespace std; long long solution(int n) { const long long MOD = 1234567; // cnts[i] : i번째 칸에 도달하는 방법의 수 vector cnts(n + 1); cnts[0] = cnts[1].. 2020. 7. 6.