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..