Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- swift concurrency
- swift dashed line
- Tuist
- button configuration
- claen architecture
- custom navigation bar
- RxSwift
- uikit toast
- rxdatasources
- task cancel
- paragraph style
- coordinator
- 버튼 피드백
- DP
- swift 백준
- domain data
- UIKit
- swift navigationcontroller
- traits
- SWIFT
- identifiable
- BFS
- swift bottomsheet
- custom ui
- task cancellation
- custombottomsheet
- swift 점선
- 타임라인 포맷팅
- swift custom ui
- reactorkit
Archives
- Today
- Total
김경록의 앱 개발 여정
[Swift 백준] 25304 영수증 본문
오늘은 상당히 쉬운 문제를 하나 풀어봤습니다.
평소에 solved.ac를 주로 사용해서 '백준' 자체에는 잘 안 들어갔는데
뭘 풀지 돌아다니다가 '단계별로 풀어보기'라는 걸 발견하고 마침 반복문 파트가 이 문제 말곤 다 풀려있길래 업적작 하는 느낌으로 풀었습니다...😊
단순한 문제라 바로 풀이하겠습니다
풀이
let x = Int(readLine()!)!
let n = Int(readLine()!)!
var result = 0
for _ in 0..<n {
let ab = readLine()!.split(separator: " ").map{Int($0)!}
let (a,b) = (ab[0], ab[1])
result += a * b
}
result == x ? print("Yes") : print("No")
'Algorithm' 카테고리의 다른 글
[Swift 백준] 3184 양 (0) | 2025.02.07 |
---|---|
[Swift 백준] 25192 인사성 밝은 곰곰이 (0) | 2025.02.06 |
[Swift 백준] 1535 안녕 (0) | 2025.02.05 |
[Swift 백준] 2193 이친수 (0) | 2025.02.01 |
[Swift 백준] 16953 A -> B (0) | 2025.01.28 |