#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int N; cin >> N;
vector<long long>v;
v.push_back(-1e9); //์
๋ ฅ ๋ฐ์ ์ ์๋ ์ต์๊ฐ
for (int i = 0; i < N; i++) {
long long number; cin >> number;
if (v.back() < number) v.push_back(number);
else {
auto it = lower_bound(v.begin(), v.end(), number);
*it = number;
}
}
cout << v.size() - 1;
}
'Algorithm ๐ง๐ปโ๐ป > ๋ฐฑ์ค(BOJ)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค,c++] 1292๋ฒ - ์ฝ๊ฒ ํธ๋ ๋ฌธ์ (0) | 2021.11.04 |
---|---|
[๋ฐฑ์ค,c++] 12851๋ฒ - ์จ๋ฐ๊ผญ์ง2 (0) | 2021.11.04 |
[๋ฐฑ์ค,c++] 12813๋ฒ - ์ด์ง์ ์ฐ์ฐ (0) | 2021.11.02 |
[๋ฐฑ์ค,c++] 1264๋ฒ - ๋ชจ์์ ๊ฐ์ (0) | 2021.11.02 |
[๋ฐฑ์ค,c++] 1261๋ฒ - ์๊ณ ์คํ (0) | 2021.11.02 |
[๋ฐฑ์ค,c++] 12605๋ฒ - ๋จ์ด ์์ ๋ค์ง๊ธฐ (0) | 2021.11.02 |
๋๊ธ