From e916dd693d7aade7ef4303c41f223d50df09ae1a Mon Sep 17 00:00:00 2001 From: SSOOYA Date: Tue, 24 Oct 2023 13:49:49 +0900 Subject: [PATCH] =?UTF-8?q?unsolve/#173:=20=ED=94=84=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EB=9E=98=EB=A8=B8=EC=8A=A4=20=ED=8C=8C=EA=B4=B4=EB=90=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EC=9D=80=20=EA=B1=B4=EB=AC=BC=20-=20?= =?UTF-8?q?=ED=9A=A8=EC=9C=A8=EC=84=B1=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=8B=9C=EA=B0=84=20=EC=B4=88=EA=B3=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AlgorithmReview.xcodeproj/project.pbxproj | 4 +++ ...54\235\200 \352\261\264\353\254\274.swift" | 33 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 "AlgorithmReview/Programmers/Lv3/\355\214\214\352\264\264\353\220\230\354\247\200 \354\225\212\354\235\200 \352\261\264\353\254\274.swift" diff --git a/AlgorithmReview.xcodeproj/project.pbxproj b/AlgorithmReview.xcodeproj/project.pbxproj index 12b5185..554d473 100644 --- a/AlgorithmReview.xcodeproj/project.pbxproj +++ b/AlgorithmReview.xcodeproj/project.pbxproj @@ -32,6 +32,7 @@ EED6FC712A020BE5006F6D72 /* 2493.swift in Sources */ = {isa = PBXBuildFile; fileRef = EED6FC702A020BE5006F6D72 /* 2493.swift */; }; EED6FC772A036698006F6D72 /* 2800.swift in Sources */ = {isa = PBXBuildFile; fileRef = EED6FC762A036698006F6D72 /* 2800.swift */; }; EEE527322AE624B5000A3505 /* 부대 복귀.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEE527312AE624B5000A3505 /* 부대 복귀.swift */; }; + EEE527382AE782FB000A3505 /* 파괴되지 않은 건물.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEE527372AE782FB000A3505 /* 파괴되지 않은 건물.swift */; }; EEEA901A2A89DC6F00EBE008 /* 수식 최대화.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEEA90192A89DC6F00EBE008 /* 수식 최대화.swift */; }; EEEA901E2A8B24A800EBE008 /* 행렬 테두리 회전하기.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEEA901D2A8B24A800EBE008 /* 행렬 테두리 회전하기.swift */; }; EEEA90302A8F2A5C00EBE008 /* 이모티콘 할인행사.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEEA902F2A8F2A5C00EBE008 /* 이모티콘 할인행사.swift */; }; @@ -195,6 +196,7 @@ EEE1154C29A775C4003FD4E3 /* 모의고사.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "모의고사.swift"; sourceTree = ""; }; EEE1155129A8427E003FD4E3 /* 소수 만들기.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "소수 만들기.swift"; sourceTree = ""; }; EEE527312AE624B5000A3505 /* 부대 복귀.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "부대 복귀.swift"; sourceTree = ""; }; + EEE527372AE782FB000A3505 /* 파괴되지 않은 건물.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "파괴되지 않은 건물.swift"; sourceTree = ""; }; EEE5D6912A6670F90009DCB5 /* 마법의 엘리베이터.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "마법의 엘리베이터.swift"; sourceTree = ""; }; EEEA8FF92A84A7CA00EBE008 /* 혼자서 하는 틱택토.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "혼자서 하는 틱택토.swift"; sourceTree = ""; }; EEEA90032A85D0FD00EBE008 /* 요격 시스템.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "요격 시스템.swift"; sourceTree = ""; }; @@ -464,6 +466,7 @@ EE123C1C2ADFAAFB00832264 /* 다단계 칫솔 판매.swift */, EEA92DFF2AE0EE9500C63ED6 /* 순위.swift */, EEE527312AE624B5000A3505 /* 부대 복귀.swift */, + EEE527372AE782FB000A3505 /* 파괴되지 않은 건물.swift */, ); path = Lv3; sourceTree = ""; @@ -566,6 +569,7 @@ EEAEC89F298CACDD001B1D62 /* main.swift in Sources */, EE5CEEC62A39A6BB00E1907E /* 가장 큰 정사각형 찾기.swift in Sources */, EE2738C429C193A3006077A3 /* 대충 만든 자판.swift in Sources */, + EEE527382AE782FB000A3505 /* 파괴되지 않은 건물.swift in Sources */, EECBCFEE2ADCFEB90056BC96 /* 연속 펄스 부분 수열의 합.swift in Sources */, EE2E5E6C29B5884D00545253 /* 체육복.swift in Sources */, EECBCFF02ADE55970056BC96 /* 풍선 터뜨리기.swift in Sources */, diff --git "a/AlgorithmReview/Programmers/Lv3/\355\214\214\352\264\264\353\220\230\354\247\200 \354\225\212\354\235\200 \352\261\264\353\254\274.swift" "b/AlgorithmReview/Programmers/Lv3/\355\214\214\352\264\264\353\220\230\354\247\200 \354\225\212\354\235\200 \352\261\264\353\254\274.swift" new file mode 100644 index 0000000..48bd3e7 --- /dev/null +++ "b/AlgorithmReview/Programmers/Lv3/\355\214\214\352\264\264\353\220\230\354\247\200 \354\225\212\354\235\200 \352\261\264\353\254\274.swift" @@ -0,0 +1,33 @@ +// +// 파괴되지 않은 건물.swift +// AlgorithmReview +// +// Created by 박소윤 on 2023/10/24. +// + +import Foundation + +func solution(_ board:[[Int]], _ skill:[[Int]]) -> Int { + + let (row, col) = (board.count, board[0].count) + + var board = board + for s in skill { + let degree = s[0] == 1 ? -s[5] : s[5] + for i in s[1]...s[3]{ + for j in s[2]...s[4]{ + board[i][j] += degree + } + } + } + + var ans = 0 + for i in 0.. 0 { + ans += 1 + } + } + } + return ans +}