From 287d0b2a3699cca39b0fe07f10d5910978303fc7 Mon Sep 17 00:00:00 2001 From: songyc macbook Date: Sat, 9 Aug 2025 23:05:33 +0900 Subject: [PATCH] 20250809 baekjoon --- code_study/Baekjoon/swift/1074.swift | 43 ++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 code_study/Baekjoon/swift/1074.swift diff --git a/code_study/Baekjoon/swift/1074.swift b/code_study/Baekjoon/swift/1074.swift new file mode 100644 index 0000000..e960016 --- /dev/null +++ b/code_study/Baekjoon/swift/1074.swift @@ -0,0 +1,43 @@ +import Foundation + +if let input = readLine(), + let nums:[Int] = { + let temp = input.split(separator: " ").compactMap({Int($0)}) + return temp.count == 3 ? temp : nil + }(){ + var (N, r, c) = (nums[0],nums[1],nums[2]) + + var n = N + var result = 0 + + while n > 0 { + let half = Int(pow(2.0, Double(n-1))) + let quatorArea = half * half + + switch (r,c) + { + case (0..