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 | 31 |
Tags
- DFS
- 위상정렬
- 순열
- DP
- 조합
- 다익스트라
- 백트래킹
- C++ 1918
- C++ 1937
- BFS
- C++ 17071
- Backtracking
- 투포인터
- 알고리즘
- strtok
- 백준
- 조합론
- 프로그래머스
- 인덱스 트리
- 백준 17071
- 가장 긴 증가하는 부분 수열
- c언어
- 소트 게임
- C++1967
- 백준 숨바꼭질5
- C++
- 16933
- LIS
- C++1167
- 문자열
Archives
- Today
- Total
목록boj (1)
블로그
[C++] 14003 : 가장 긴 증가하는 부분 수열 5
플래티넘 Ⅴ #include #include #include using namespace std; int main() { int n; scanf("%d", &n); vector seq; int s; for (int i = 0; i < n; i++) { scanf("%d", &s); seq.push_back(s); } vector subsq; subsq.push_back(seq[0]); vector pos; pos.resize(n); pos[0] = 1; int idx; for (int i = 1; i < n; i++) { if (subsq.back() < seq[i]) { subsq.push_back(seq[i]); pos[i] = subsq.size(); } else { idx = lower_bound..
PS
2021. 2. 13. 01:28