diff --git "a/LiiNi-coder/202510/05 BOJ \352\260\220\354\206\214\355\225\230\353\212\224 \354\210\230.md" "b/LiiNi-coder/202510/05 BOJ \352\260\220\354\206\214\355\225\230\353\212\224 \354\210\230.md" new file mode 100644 index 00000000..5b42e529 --- /dev/null +++ "b/LiiNi-coder/202510/05 BOJ \352\260\220\354\206\214\355\225\230\353\212\224 \354\210\230.md" @@ -0,0 +1,36 @@ +```java +import java.io.*; +import java.util.*; + +public class Main { + static List list = new ArrayList<>(); + + public static void main(String[] args) throws IOException { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + int n = Integer.parseInt(br.readLine()); + + for(int i = 0; i < 10; i++){ + dfs(i, 1); + } + + Collections.sort(list); + // for(long l: list){ + // System.out.print(l + ", "); + // } + if(n >= list.size()){ + System.out.println(-1); + }else{ + System.out.println(list.get(n)); + } + } + + static void dfs(long num, int depth){ + list.add(num); + long last = num % 10; + for(int next = 0; next < last; next++){ + dfs(num * 10 + next, depth + 1); + } + } +} + +```