import Foundation while let line = readLine() { let n = Int(line)! var mat = [[Int]](repeating: [Int](repeating: -1, count: n), count: n) var k = 1 //! 广度优先 var queue = [(Int,Int)]() queue.append((0,0)) while !queue.isEmpty { let count = queue.coun...