| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- Generator
- concurrency
- Protocol
- DWG
- 시바견
- kaggle
- Python
- t1
- data science
- iterator
- Substring with Concatenation of All Words
- 315. Count of Smaller Numbers After Self
- Python Code
- 30. Substring with Concatenation of All Words
- Decorator
- Python Implementation
- attribute
- 밴픽
- 컴퓨터의 구조
- shiba
- 파이썬
- 715. Range Module
- Convert Sorted List to Binary Search Tree
- 109. Convert Sorted List to Binary Search Tree
- Regular Expression
- 운영체제
- LeetCode
- Class
- 프로그래머스
- 43. Multiply Strings
Archives
- Today
- Total
Scribbling
[C++] lower_bound 본문
https://leetcode.com/problems/longest-increasing-subsequence/
LeetCode - The World's Leading Online Programming Learning Platform
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
class Solution {
public:
int lengthOfLIS(vector<int>& nums) {
vector<int> tmp;
for (int num : nums) {
auto it = lower_bound(tmp.begin(), tmp.end(), num);
if (it == tmp.end()) {
tmp.push_back(num);
} else {
*it = num;
}
}
return tmp.size();
}
};'Computer Science > C++' 카테고리의 다른 글
| [C++] Priority Queue with custom data type (0) | 2024.02.22 |
|---|---|
| [C++] Abstract Class, Interface, Multiple Inheritance (0) | 2024.02.14 |
| [C++] Deque<int> (0) | 2024.02.06 |
| [C++] 전문가를 위한 C++ - Chapter 8 (0) | 2023.10.07 |
| [C++] find, deque, bfs, structured binding (0) | 2023.09.30 |