From 943205ab4303c6256dece7f5bb1a4dd05bd08eb6 Mon Sep 17 00:00:00 2001 From: suyeun84 <81475092+suyeun84@users.noreply.github.com> Date: Sun, 13 Jul 2025 22:46:29 +0900 Subject: [PATCH] =?UTF-8?q?[20250713]=20BOJ=20/=20G5=20/=20=EB=91=90=20?= =?UTF-8?q?=EC=9A=A9=EC=95=A1=20/=20=EA=B9=80=EC=88=98=EC=97=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... \353\221\220 \354\232\251\354\225\241.md" | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 "suyeun84/202507/13 BOJ G5 \353\221\220 \354\232\251\354\225\241.md" diff --git "a/suyeun84/202507/13 BOJ G5 \353\221\220 \354\232\251\354\225\241.md" "b/suyeun84/202507/13 BOJ G5 \353\221\220 \354\232\251\354\225\241.md" new file mode 100644 index 00000000..692fdb34 --- /dev/null +++ "b/suyeun84/202507/13 BOJ G5 \353\221\220 \354\232\251\354\225\241.md" @@ -0,0 +1,37 @@ +```java +import java.util.*; +import java.io.*; + +public class boj2470 { + static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + static StringTokenizer st; + static void nextLine() throws Exception {st = new StringTokenizer(br.readLine());} + static int nextInt() {return Integer.parseInt(st.nextToken());} + + public static void main(String[] args) throws Exception { + nextLine(); + int N = nextInt(); + int[] num = new int[N]; + nextLine(); + for (int i = 0; i < N; i++) num[i] = nextInt(); + Arrays.sort(num); + + int check = Integer.MAX_VALUE; + int answer1 = 0, answer2 = 0; + int low = 0, high = N-1; + + while(low