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/BOJ_11053_suyeon.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/BOJ_11053_suyeon.java" new file mode 100644 index 0000000..8a3af3a --- /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/BOJ_11053_suyeon.java" @@ -0,0 +1,31 @@ +import java.io.*; +import java.util.*; + +public class BOJ_11053_suyeon { + public static int N, A[], memo[], resMax; + public static void main(String[] args) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + + N = Integer.parseInt(br.readLine()); + + A = new int[N]; + memo = new int[N]; + resMax = 1; + StringTokenizer st = new StringTokenizer(br.readLine()); + for(int i = 0; i < N; i++) { + A[i] = Integer.parseInt(st.nextToken()); + + int max = 1; + for(int j = i-1; j >= 0; j--) { + if(A[j] < A[i]) + max = Math.max(max, memo[j]+1); + else if(A[j] == A[i]) + max = Math.max(max, memo[j]); + } + + resMax = Math.max(resMax, max); + memo[i] = max; + } + System.out.println(resMax); + } +} \ No newline at end of file