본문 바로가기

programmers90

[Programmers] (깊이/너비 우선 탐색(DFS/BFS)) Lv 2. 게임 맵 최단거리 https://school.programmers.co.kr/learn/courses/30/lessons/1844 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include using namespace std; /*void dfs(int x, int y, int acc, vector&maps) { maps[x][y] = acc; for (size_t i = 0; i = maps.size() ||.. 2023. 7. 11.
[Programmers] (Summer/Winter Coding(~2018)) Lv 2. 방문 길이 https://school.programmers.co.kr/learn/courses/30/lessons/49994 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include using namespace std; #define POS 5 bool move(int& x, int& y, int moveX, int moveY) { if (x + moveX POS || y + moveY POS) return false; x += moveX; y += .. 2023. 7. 10.
[Programmers] (스택/큐) Lv 2. 주식가격 https://school.programmers.co.kr/learn/courses/30/lessons/42584 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include using namespace std; vector solution(vector prices) { vector answer; for (int idx = 0; idx < prices.size(); idx++) { int cnt = 0; for(int idx_a = idx + 1 ; idx_a < prices.size() ; idx_a++) { cnt++.. 2023. 7. 9.
[Programmers] Lv 2. 땅따먹기 https://school.programmers.co.kr/learn/courses/30/lessons/12913 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr int solution(vector land) { int answer = 0; for(int i = 0; i < land.size()-1 ; i++){ land[i+1][0] += max(land[i][1],max(land[i][2],land[i][3])); land[i+1][1] += max(land[i][0],max(land[i][2],land[i][3])); land[i+1][2] += ma.. 2023. 7. 9.
[Programmers] (2019 KAKAO BLIND RECRUITMENT) Lv 2. 오픈채팅방 https://school.programmers.co.kr/learn/courses/30/lessons/42888 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include #include #include using namespace std; vector solution(vector record) { vector answer; unordered_map m; list li; stringstream ss; for (const auto& data : record) { ss.str(data); string command, us.. 2023. 7. 9.
[Programmers] (2022 KAKAO BLIND RECRUITMENT) Lv 2. 주차 요금 계산 https://school.programmers.co.kr/learn/courses/30/lessons/92341 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include #include #include using namespace std; int time_diff(string in, string out) { int h1 = stoi(in.substr(0, 2)); int m1 = stoi(in.substr(3, 2)); int h2 = stoi(out.substr(0, 2)); int m2 = stoi(out.sub.. 2023. 7. 7.
[Programmers] (힙(Heap)) Lv 2. 더 맵게 https://school.programmers.co.kr/learn/courses/30/lessons/42626 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include using namespace std; int solution(vector scoville, int K) { int answer = 0; priority_queue q; for (const auto& e : scoville) q.push(e); int first, second, result; while (true) { if (q.top() >= K) .. 2023. 7. 4.
[Programmers] (2018 KAKAO BLIND RECRUITMENT) Lv 2. [3차] n진수 게임 https://school.programmers.co.kr/learn/courses/30/lessons/17687 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include using namespace std; string to_bit(int num, const int& bit) { string ans = ""; string hex[] = { "A", "B", "C", "D", "E", "F" }; while (num > 0) { const auto& val = num % bit; ans += (val >= 10) ? .. 2023. 7. 3.
[Programmers] (2018 KAKAO BLIND RECRUITMENT) Lv 2. [3차] 압축 https://school.programmers.co.kr/learn/courses/30/lessons/17684 코딩테스트 연습 - [3차] 압축 TOBEORNOTTOBEORTOBEORNOT [20, 15, 2, 5, 15, 18, 14, 15, 20, 27, 29, 31, 36, 30, 32, 34] school.programmers.co.kr #include #include #include using namespace std; #define ALPHABET 64 vector solution(string msg) { vector answer; unordered_map m; for (size_t i = 0; i < msg.size();) { int j = 2; while (m.count(msg.subs.. 2023. 7. 3.
[Programmers] (2022 KAKAO BLIND RECRUITMENT) Lv 2. k진수에서 소수 개수 구하기 https://school.programmers.co.kr/learn/courses/30/lessons/92335 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr #include #include #include using namespace std; bool IsPrime(long param) { for (int i = 2; i 1); } int solution(int n, int k) { int answer = 0; string str = ""; while (n) { int temp = n % k; if (temp) str = to_string(temp) .. 2023. 6. 26.