diff --git a/code_study/Baekjoon/java/_1149.java b/code_study/Baekjoon/java/_1149.java new file mode 100644 index 0000000..420ab75 --- /dev/null +++ b/code_study/Baekjoon/java/_1149.java @@ -0,0 +1,22 @@ +import java.util.*; + +public class _1149 { + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + int N = Integer.parseInt(sc.nextLine()); + int[] RGB = Arrays.stream(sc.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray(); + int dpR = RGB[0], dpG = RGB[1], dpB = RGB[2]; + int prevR = dpR, prevG = dpG, prevB = dpB; + for(int i=1; i