250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- BFS
- sw expert
- 알고리즘
- the midnight library
- D4
- 백준
- nightroutine
- 삼성
- MySQL
- sw expert academy
- dfs
- PyQt
- 프로그래머스
- 코딩테스트
- swexpertacademy
- 원서읽자
- SQL
- 직무면접
- 원서읽기
- 알고리즘 문제
- 쉬운 알고리즘 문제
- 코테 준비
- 완전탐색
- readingbook
- English
- STUDYENGLISH
- englishbook
- 코테
- 원서
- 코테 대비
Archives
- Today
- Total
목록스택 (5)
시나브로
[코딩테스트 연습 _ 스택/큐] 탑
#include #include using namespace std; vector solution(vector heights) { int box=heights.size(); vector answer(box, 0); vector list; for (int i = heights.size()-1; i >= 0; i--) { if (list.size() != 0) { while (1) { if (list.size() != 0) { if (heights[i] > heights[list.back()]) { answer[list.back()] = i + 1; list.pop_back(); } else break; } else break; } } list.push_back(i); } return answer; } ht..
알고리즘/프로그래머스
2020. 3. 13. 17:11