알고리즘/DFS (2) 썸네일형 리스트형 [DFS] 1027 : 좋은수열 12345678910111213141516171819202122232425262728293031323334353637383940414243 import java.util.Scanner;public class GoodSequence { public static void main(String[] args) { GoodSequence n = new GoodSequence(); n.goodSequence(0); n.display(); } Scanner sc = new Scanner(System.in); int deepMax = sc.nextInt(); StringBuffer sequence = new StringBuffer(); boolean isFind = false; public void goodSequen.. [DFS] Nqueen Algorithm 12345678910111213141516171819202122232425262728293031323334353637383940import java.util.Scanner; // N Queen// http://jungol.co.kr/problem.php?id=1889public class NQueen { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] check = new int[n]; int count = 0; public void queenCount(int deep){ if(deep == n){ count++; return; } for(int i = 0; i 이전 1 다음