#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int>arr(1001);
vector<int>dp(1001,1);
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int N; cin >> N;
for (int i = 0; i < N; i++) {
cin >> arr[i]; //์์ด ์
๋ ฅ.
}
for (int i = 1; i < N; i++) {
for (int k = 0; k < i; k++) {
if (arr[i] > arr[k]) dp[i] = max(dp[i], dp[k] + 1); //์์ด ํ์
}
}
cout << *max_element(dp.begin(), dp.end());
}
'Algorithm ๐ง๐ปโ๐ป > ๋ฐฑ์ค(BOJ)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค,c++] 11123๋ฒ - ์ ํ๋ง๋ฆฌ... ์ ๋๋ง๋ฆฌ... (0) | 2021.10.27 |
---|---|
[๋ฐฑ์ค,c++] 1110๋ฒ - ๋ํ๊ธฐ ์ฌ์ดํด (0) | 2021.10.27 |
[๋ฐฑ์ค,c++] 1107๋ฒ - ๋ฆฌ๋ชจ์ปจ (0) | 2021.10.27 |
[๋ฐฑ์ค,c++] 11052๋ฒ - ์นด๋ ๊ตฌ๋งคํ๊ธฐ (0) | 2021.10.27 |
[๋ฐฑ์ค,c++] 11051๋ฒ - ์ดํญ ๊ณ์2 (0) | 2021.10.26 |
[๋ฐฑ์ค,c++] 11050๋ฒ - ์ดํญ ๊ณ์1 (0) | 2021.10.26 |
๋๊ธ