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)); + } +} +```