diff --git "a/0305/basic_B11053_\352\260\200\354\236\245\352\270\264\354\246\235\352\260\200\355\225\230\353\212\224\353\266\200\353\266\204\354\210\230\354\227\264/jjunii.java" "b/0305/basic_B11053_\352\260\200\354\236\245\352\270\264\354\246\235\352\260\200\355\225\230\353\212\224\353\266\200\353\266\204\354\210\230\354\227\264/jjunii.java" new file mode 100644 index 0000000..353f066 --- /dev/null +++ "b/0305/basic_B11053_\352\260\200\354\236\245\352\270\264\354\246\235\352\260\200\355\225\230\353\212\224\353\266\200\353\266\204\354\210\230\354\227\264/jjunii.java" @@ -0,0 +1,32 @@ +package boj; + +import java.io.*; +import java.util.*; + +public class Boj11053 { + public static void main(String[] args) throws Exception { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + int n = Integer.parseInt(br.readLine()); + + int[] list = new int[n]; + StringTokenizer st = new StringTokenizer(br.readLine()); + for (int i = 0; i < n; i++) { + list[i] = Integer.parseInt(st.nextToken()); + } + + int[] dp = new int[n]; + int result = 0; + for (int i = 0; i < n; i++) { + dp[i] = 1; + for (int j = 0; j < i; j++) { + if (list[j] < list[i]) { + dp[i] = Math.max(dp[i], dp[j] + 1); + } + } + + result = Math.max(result, dp[i]); + } + + System.out.println(result); + } +}