깊이우선탐색2 [백준] 알파벳 (1987)(Kotlin) 원본 문제 : https://www.acmicpc.net/problem/1987 문제 참고 : https://hyeooona825.tistory.com/65 import java.io.BufferedReader import java.io.InputStreamReader var R: Int = 0 var C: Int = 0 var check: BooleanArray = BooleanArray(26) var map: Array = arrayOf() var visited: Array = arrayOf() val dx: IntArray = intArrayOf(1, -1, 0, 0) val dy: IntArray = intArrayOf(0, 0, 1, -1) fun main() = with(BufferedRead.. 2020. 4. 7. [백준] 로또 (6603)(Kotlin) 원본 문제 : https://www.acmicpc.net/problem/6603 문제 참고 : https://zoonvivor.tistory.com/108 import java.util.* var n = 0 var arr: IntArray = intArrayOf() var visited: BooleanArray = booleanArrayOf() fun main() { val sc: Scanner = Scanner(System.`in`) while (true) { n = sc.nextInt() if (n == 0) break arr = IntArray(n) visited = BooleanArray(n) for (i in 0 until n) { arr[i] = sc.nextInt() } dfs(0, 0) p.. 2020. 2. 26. 이전 1 다음