We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f4dc51e commit c9de759Copy full SHA for c9de759
2 files changed
백준/Gold/2470. 두 용액/README.md
@@ -12,7 +12,7 @@
12
13
### 제출 일자
14
15
-2025년 5월 8일 11:35:21
+2025년 5월 8일 11:35:35
16
17
### 문제 설명
18
백준/Gold/2470. 두 용액/두 용액.swift
@@ -10,9 +10,7 @@ while true {
10
break
11
}
// 특성값의 합이 전보다 작으면, 특성값을 갱신한다.
- let curDiff = 0-(valueList[start] + valueList[end]) > 0 ? 0-(valueList[start] + valueList[end]) : -(0-(valueList[start] + valueList[end]))
- let oldDiff = 0-minSum > 0 ? 0-minSum : -(0-minSum)
- if curDiff < oldDiff {
+ if abs(0-(valueList[start] + valueList[end])) < abs(0-minSum) {
v1 = valueList[start]
v2 = valueList[end]
minSum = valueList[start] + valueList[end]
0 commit comments