1로만들기
-
[백준] 1463 1로 만들기 #JAVA #DPAlgorithm Solving/BAEKJOON 2021. 2. 25. 23:50
[백준] 1463 1로 만들기 #JAVA #DP 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] d = new int[n+1]; Arrays.fill(d, Integer.MAX_VALUE..
-
[백준] 1463 1로만들기 #JAVA #BFSAlgorithm Solving/BAEKJOON 2021. 2. 25. 21:48
[백준] 1463 1로만들기 #JAVA #BFS 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; public class Main { static int cnt; public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br...