From 1a4be714cccfa8bd7000734d814628cb4cd275c2 Mon Sep 17 00:00:00 2001 From: lkhyun <102892446+lkhyun@users.noreply.github.com> Date: Wed, 7 Jan 2026 16:59:48 +0900 Subject: [PATCH] =?UTF-8?q?[20260107]=20BOJ=20/=20G5=20/=20=EA=B0=90?= =?UTF-8?q?=EC=86=8C=ED=95=98=EB=8A=94=20=EC=88=98=20/=20=EC=9D=B4?= =?UTF-8?q?=EA=B0=95=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4\355\225\230\353\212\224 \354\210\230.md" | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 "lkhyun/202601/07 BOJ G5 \352\260\220\354\206\214\355\225\230\353\212\224 \354\210\230.md" diff --git "a/lkhyun/202601/07 BOJ G5 \352\260\220\354\206\214\355\225\230\353\212\224 \354\210\230.md" "b/lkhyun/202601/07 BOJ G5 \352\260\220\354\206\214\355\225\230\353\212\224 \354\210\230.md" new file mode 100644 index 00000000..46a0325e --- /dev/null +++ "b/lkhyun/202601/07 BOJ G5 \352\260\220\354\206\214\355\225\230\353\212\224 \354\210\230.md" @@ -0,0 +1,28 @@ +```java + +import java.util.*; +import java.io.*; + +public class Main { + public static void main(String[] args) throws Exception { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + int N = Integer.parseInt(br.readLine()); + + List list = new ArrayList<>(); + + for (int i = 1; i < 1024; i++) { + long num = 0; + for (int j = 9; j >= 0; j--) { + if ((i & (1 << j)) != 0) { + num = num * 10 + j; + } + } + list.add(num); + } + + Collections.sort(list); + + System.out.println(N >= list.size() ? -1 : list.get(N)); + } +} +```