목록문제풀이 (155)
말랑한 하루
[BAEKJOON] 15653 N과 M 5 (Java)
[ 소스 코드 ] import java.util.Arrays; import java.util.Scanner; public class Solution { static int N; static int M; static int ary[]; static boolean visit[] = new boolean[9]; static void permutation(int index, int cnt, int temp[]) { if (cnt == M) { for(int item : temp) System.out.print(item+" "); System.out.println(); return; } for(int i=1;i
문제풀이/BAEKJOON Online Judge
2021. 1. 21. 22:09
[BAEKJOON] 15652 N과 M 4 (Java)
[ 소스 코드 ] import java.util.Scanner; public class Solution { static int N; static int M; static int index = 0; static int temp[] = new int[8]; static StringBuilder sb = new StringBuilder(); static void permutation(int cnt) { if (cnt == M) { for (int i = 0; i < M; i++) sb.append(temp[i] + " "); sb.append("\n"); return; } for (int i = cnt == 0 ? 1 : temp[cnt - 1]; i
문제풀이/BAEKJOON Online Judge
2021. 1. 21. 22:08