목록분할탐색 (1)
MUKER_DEV with iOS

1074번: Z 한수는 크기가 2N × 2N인 2차원 배열을 Z모양으로 탐색하려고 한다. 예를 들어, 2×2배열을 왼쪽 위칸, 오른쪽 위칸, 왼쪽 아래칸, 오른쪽 아래칸 순서대로 방문하면 Z모양이다. N > 1인 경우, 배열을 www.acmicpc.net 나의 풀이 let inputs = readLine()!.split(separator: " ").map{Int(String($0))!} var (n, r, c) = (inputs[0], inputs[1], inputs[2]) func solution(_ n: Int, _ r: Int, _ c: Int) -> Int { guard n > 0 else { return 0 } return 2 * (r % 2) + (c % 2) + 4 * solution(n -..
🤖 알고리즘/BAEKJOON
2023. 4. 6. 21:59