목록문제/백준_자바 (102)
sm 기술 블로그
import java.util.*; import java.io.*; class Main { static int cnt; static boolean[] visited; static int[] QueenLocation; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); cnt = 0; visited = new boolean[N]; QueenLocation = new int[N]; DFS(N, 0); System.out.println(cnt); } p..
import java.util.*; import java.io.*; class Main { static StringBuilder sb = new StringBuilder(); static int N, M; static int[] arr; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] sBits = br.readLine().split(" "); N = Integer.parseInt(sBits[0]); M = Integer.parseInt(sBits[1]); arr = new int[M]; DFS(1,..
import java.util.*; import java.io.*; public class Main { static StringBuilder sb = new StringBuilder(); static int[] arr; static int N, M; public static void main(String[] args)throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] sBits = br.readLine().split(" "); N = Integer.parseInt(sBits[0]); M = Integer.parseInt(sBits[1]); arr = new int[M]; ..
import java.util.*; public class Main { static int[] arr; static int N, M; public static void main(String[] args) { Scanner sc = new Scanner(System.in); N = sc.nextInt(); M = sc.nextInt(); arr = new int[M]; sc.close(); DFS(1, 0); } private static void DFS(int start, int depth) { if (depth == M) { for (int val : arr) { System.out.printf(val + " "); } System.out.println(); return; } for (int i = s..