Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
KENEW authored Jan 8, 2021
1 parent 8504ea4 commit e09ee7d
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions 11722_가장_긴_감소하는_부분_수열.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#include<iostream>
#include<algorithm>
using namespace std;

int N;
int arr[1001];
int length[1001];
int result = 0;

int main(void)
{
cin >> N;

for (int i = 0; i < N; i++)
{
cin >> arr[i];
}

for (int i = N - 1; i >= 0; i--)
{
length[i] = 1;

for (int j = N - 1; j >= i; j--)
{
if (arr[i] > arr[j])
{
length[i] = max(length[i], length[j] + 1);
}
}

result = max(result, length[i]);
}

cout << result;
return 0;
}

0 comments on commit e09ee7d

Please sign in to comment.