Algorithm/프로그래머스139 [프로그래머스]스택/큐 : 탑 (level 2) (c++) https://programmers.co.kr/learn/courses/30/lessons/42588 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 #include #include #include using namespace std; vector solution(vector heights) { // 스택: 자기보다 더 작은 탑을 아직 찾지 못한 탑 idx stack s; vector answer(height.. 2020. 4. 29. [프로그래머스]스택/큐 : 기능개발 (level 2) (c++) https://programmers.co.kr/learn/courses/30/lessons/42586 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 방법 1: 문제에 주어진 그대로 구현. queue 사용 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 #include #include #include using namespace std; vector solution(vector pr.. 2020. 4. 29. [프로그래머스]스택/큐 : 프린터 (level 2) (c++) https://programmers.co.kr/learn/courses/30/lessons/42587 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 방법 1: algorithm 라이브러리 사용X 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 #include #include #include using namespace std; .. 2020. 4. 28. [프로그래머스]스택/큐 : 주식가격 (level 2) (c++) https://programmers.co.kr/learn/courses/30/lessons/42584 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 방법 1: O(N^2) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 #include #include using namespace std; vector solution(vector prices) { // 주어진 벡터 길이의 answer 벡터 생성 vector answer(prices.size()); // prices 뒤에서.. 2020. 4. 28. 이전 1 ··· 20 21 22 23 24 25 26 ··· 35 다음