20250823 baekjoon
This commit is contained in:
parent
84184b3ea4
commit
bd935df374
23
code_study/Baekjoon/java/_11053.java
Normal file
23
code_study/Baekjoon/java/_11053.java
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class _11053 {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Scanner sc = new Scanner(System.in);
|
||||||
|
int N = sc.nextInt();
|
||||||
|
int[] Arr = new int[N];
|
||||||
|
for(int i=0; i<N; i++) Arr[i] = sc.nextInt();
|
||||||
|
sc.close();
|
||||||
|
|
||||||
|
int[] dp = new int[N];
|
||||||
|
Arrays.fill(dp, 1);
|
||||||
|
|
||||||
|
for(int i=0; i<N; i++) {
|
||||||
|
for(int j=0; j<i; j++) {
|
||||||
|
if(Arr[i]>Arr[j]) dp[i] = Math.max(dp[i], dp[j] + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int maxLenth = Arrays.stream(dp).max().getAsInt();
|
||||||
|
System.out.println(maxLenth);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user