실행 실패 (제출 코드 컴파일 에러)
Main.java:2: error: ';' expected private lateinit var graph: Array<BooleanArray> ^ Main.java:2: error: <identifier> expected private lateinit var graph: Array<BooleanArray> ^ Main.java:2: error: <identifier> expected private lateinit var graph: Array<BooleanArray> ^ Main.java:3: error: 'var' is not allowed here private var n = 0 ^ Main.java:3: error: ';' expected private var n = 0 ^ Main.java:4: error: 'var' is not allowed here private var h = 0 ^ Main.java:4: error: ';' expected private var h = 0 ^ Main.java:6: error: <identifier> expected fun solution(n: Int, h: Int, lines: Array<Pair<Int, Int>>): Int { ^ Main.java:6: error: > expected fun solution(n: Int, h: Int, lines: Array<Pair<Int, Int>>): Int { ^ Main.java:6: error: illegal start of expression fun solution(n: Int, h: Int, lines: Array<Pair<Int, Int>>): Int { ^ Main.java:6: error: illegal start of expression fun solution(n: Int, h: Int, lines: Array<Pair<Int, Int>>): Int { ^ Main.java:6: error: <identifier> expected fun solution(n: Int, h: Int, lines: Array<Pair<Int, Int>>): Int { ^ Main.java:7: error: ';' expected this.graph = Array(h + 1) { BooleanArray(n + 1) }.apply { ^ Main.java:7: error: ';' expected this.graph = Array(h + 1) { BooleanArray(n + 1) }.apply { ^ Main.java:7: error: illegal start of expression this.graph = Array(h + 1) { BooleanArray(n + 1) }.apply { ^ Main.java:7: error: not a statement this.graph = Array(h + 1) { BooleanArray(n + 1) }.apply { ^ Main.java:7: error: ';' expected this.graph = Array(h + 1) { BooleanArray(n + 1) }.apply { ^ Main.java:8: error: not a statement lines.forEach { (u, v) -> this[u][v] = true } ^ Main.java:8: error: ';' expected lines.forEach { (u, v) -> this[u][v] = true } ^ Main.java:8: error: not a statement lines.forEach { (u, v) -> this[u][v] = true } ^ Main.java:8: error: ';' expected lines.forEach { (u, v) -> this[u][v] = true } ^ Main.java:10: error: ';' expected this.n = n ^ Main.java:11: error: ';' expected this.h = h ^ Main.java:13: error: ';' expected for (i in 0..3) { ^ Main.java:13: error: ';' expected for (i in 0..3) { ^ Main.java:14: error: ';' expected val valid = dfs(1, 0, i) ^ Main.java:15: error: ';' expected if (valid) return i ^ Main.java:17: error: ';' expected return -1 ^ Main.java:20: error: <identifier> expected private fun dfs(depth: Int, change: Int, max: Int): Boolean { ^ Main.java:22: error: ';' expected for (i in 1..n) { ^ Main.java:22: error: ';' expected for (i in 1..n) { ^ Main.java:23: error: ';' expected var r = 1 ^ Main.java:24: error: ';' expected var c = i ^ Main.java:27: error: ';' expected if (graph[r][c]) ++c ^ Main.java:29: error: ';' expected ++r ^ Main.java:29: error: ';' expected ++r ^ Main.java:31: error: ';' expected if (i != c) return false ^ Main.java:33: error: ';' expected return true ^ Main.java:36: error: ';' expected for (r in depth..h) { ^ Main.java:36: error: illegal '.' for (r in depth..h) { ^ Main.java:36: error: not a statement for (r in depth..h) { ^ Main.java:36: error: ';' expected for (r in depth..h) { ^ Main.java:37: error: ';' expected for (c in 1 until n) { ^ Main.java:37: error: ';' expected for (c in 1 until n) { ^ Main.java:37: error: not a statement for (c in 1 until n) { ^ Main.java:37: error: ')' expected for (c in 1 until n) { ^ Main.java:37: error: not a statement for (c in 1 until n) { ^ Main.java:37: error: ';' expected for (c in 1 until n) { ^ Main.java:39: error: ';' expected graph[r][c] = true ^ Main.java:40: error: ';' expected if (dfs(depth + 1, change + 1, max)) return true ^ Main.java:41: error: ';' expected graph[r][c] = false ^ Main.java:45: error: ';' expected return false ^ Main.java:49: error: class, interface, or enum expected fun main() { ^ 53 errors
정답 개수:
-
틀린 개수:
-
실행 실패 개수:
-
반례를 발견하지 못했습니다.