diff --git "a/lkhyun/202511/10 BOJ G5 \354\272\240\355\224\204 \354\244\200\353\271\204.md" "b/lkhyun/202511/10 BOJ G5 \354\272\240\355\224\204 \354\244\200\353\271\204.md" new file mode 100644 index 00000000..b1c95d19 --- /dev/null +++ "b/lkhyun/202511/10 BOJ G5 \354\272\240\355\224\204 \354\244\200\353\271\204.md" @@ -0,0 +1,43 @@ +```java +import java.util.*; +import java.io.*; + +public class Main{ + static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); + static StringBuilder sb = new StringBuilder(); + static StringTokenizer st; + static int N,L,R,X; + static int[] problems; + static int answer = 0; + public static void main(String[] args) throws Exception { + st = new StringTokenizer(br.readLine()); + N = Integer.parseInt(st.nextToken()); + L = Integer.parseInt(st.nextToken()); + R = Integer.parseInt(st.nextToken()); + X = Integer.parseInt(st.nextToken()); + + problems = new int[N]; + st = new StringTokenizer(br.readLine()); + for(int i=0; i= X && count >= 2) answer++; + return; + } + int newMax = Math.max(max,problems[depth]); + int newMin = Math.min(min,problems[depth]); + select(sum+problems[depth], newMax, newMin, depth+1, count+1); + + select(sum, max, min, depth+1, count); + } +} +```