Java464 [백준/Java] 9252번 LCS 2 -Codeimport java.io.*;public class BOJ9252 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str1 = br.readLine(); String str2 = br.readLine(); int strLength1 = str1.length(); int strLength2 = str2.length(); // LIS 알고리즘 int[][] dp = new i.. 2026. 1. 16. [백준/Java] 9251번 LCS -Codeimport java.io.*;public class BOJ9251 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str1 = br.readLine(); String str2 = br.readLine(); // LCS 알고리즘 int strLength1 = str1.length(); int strLength2 = str2.length(); int[][] dp = new int.. 2026. 1. 16. [백준/Java] 9151번 Starship Hakodate-maru -Codeimport java.io.*;import java.util.*;public class BOJ9151 { static ArrayList container1 = new ArrayList(); static ArrayList container2 = new ArrayList(); static boolean[] isOk = new boolean[151201]; static { // 연료통1 셋팅 for (int i = 0; i * i * i 151200) break; container2.add(temp); n++; } // 가능 숫자 셋팅 for (int con1 : contain.. 2026. 1. 16. [백준/Java] 2156번 포도주 시식 -Codeimport java.io.*;import java.util.*;public class BOJ2156 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int cnt = Integer.parseInt(br.readLine()); // 와인 배열 초기화 int[] wineVal = new int[cnt + 1]; for (int i = 1; i 처음에는 상태를 2개로 보고 작성해서 와인을 안고른 경우가 빠져서 문제가 .. 2026. 1. 16. [백준/Java] 2579번 계단 오르기 -Codeimport java.io.*;public class BOJ2579 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int cnt = Integer.parseInt(br.readLine()); // 배열 초기화 int[] stairVal = new int[cnt + 1]; for (int i = 1; i = 2) { // 1칸 넘은 경우 dp[2][0] =.. 2026. 1. 16. [프로그래머스/Java] 베스트앨범 -Codeimport java.util.*;class Solution { static class Song { int index, score; public Song (int index, int score) { this.index = index; this.score = score; } } public int[] solution(String[] genres, int[] plays) { int length = genres.length; Map genreTotalScore = new HashMap(); Map> genrePlayInfo = new HashMap.. 2026. 1. 15. 이전 1 ··· 10 11 12 13 14 15 16 ··· 78 다음