CS/Algorithm

CS/Algorithm

[백준 : 1932] 정수 삼각형 - java

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { static int[][] arr; static Integer[][] dp; static int N; static int find(int height, int idx) { if(height == N - 1) return dp[height][idx]; if(dp[height][idx] == null) { dp[height][idx] = Math.max(find(height + 1, idx), find(height + 1, idx + 1)) + ar..

CS/Algorithm

[백준 : 2579] 계단오르기 - java

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { static Integer dp[]; static int arr[]; public static void main(String[] args) throws Exception, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); dp = new Integer[N + 1]; arr = new int[N + 1]; for(int i = 1..

CS/Algorithm

[백준 : 11053] 가장 긴 증가하는 부분 수열

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int max = 0; int N = scan.nextInt(); int[] array = new int[N]; int[] d = new int[N]; for(int i = 0; i max) ..

yujindonut
'CS/Algorithm' 카테고리의 글 목록 (19 Page)