프로그래머스 6

프로그래머스 - 이중우선순위큐 [C/C++]

https://programmers.co.kr/learn/courses/30/lessons/42628 코딩테스트 연습 - 이중우선순위큐 programmers.co.kr 코드 #include #include #include using namespace std; priority_queue maxHeap, minDeleteHeap; priority_queue minHeap, maxDeleteHeap; vector solution(vector operations) { for (auto& iter: operations) { if (iter[0] == 'I') { string s(iter.begin() + 2, iter.end()); maxHeap.push(stoi(s)); minHeap.push(stoi(s));..

프로그래머스 2022.06.20

프로그래머스 - 등굣길 [C/C++]

https://programmers.co.kr/learn/courses/30/lessons/42898 코딩테스트 연습 - 등굣길 계속되는 폭우로 일부 지역이 물에 잠겼습니다. 물에 잠기지 않은 지역을 통해 학교를 가려고 합니다. 집에서 학교까지 가는 길은 m x n 크기의 격자모양으로 나타낼 수 있습니다. 아래 그림은 m = programmers.co.kr 코드 #include #include using namespace std; int M, N; long long dp[101][101]; int map[101][101]; int dy[2] = {0, 1}; int dx[2] = {1, 0}; long long dfs (int y, int x) { if (y == M and x == N) return 1..

프로그래머스 2022.06.20

프로그래머스 - 완주하지 못한 선수 [C/C++]

https://programmers.co.kr/learn/courses/30/lessons/42576 코딩테스트 연습 - 완주하지 못한 선수 수많은 마라톤 선수들이 마라톤에 참여하였습니다. 단 한 명의 선수를 제외하고는 모든 선수가 마라톤을 완주하였습니다. 마라톤에 참여한 선수들의 이름이 담긴 배열 participant와 완주한 선수 programmers.co.kr 코드 #include #include #include using namespace std; string solution(vector participant, vector completion) { string answer = ""; map m; for (auto& iter: participant) if (m.find(iter) != m.end()..

프로그래머스 2022.06.18