We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1f2dd14 commit ac9314aCopy full SHA for ac9314a
2 files changed
백준/Silver/2805. 나무 자르기/README.md
@@ -4,15 +4,15 @@
4
5
### 성능 요약
6
7
-메모리: 119468 KB, 시간: 916 ms
+메모리: 119444 KB, 시간: 908 ms
8
9
### 분류
10
11
이분 탐색, 매개 변수 탐색
12
13
### 제출 일자
14
15
-2024년 12월 1일 17:15:46
+2024년 12월 1일 17:18:20
16
17
### 문제 설명
18
백준/Silver/2805. 나무 자르기/나무 자르기.java
@@ -39,11 +39,8 @@ static int binarySearch(){
39
static long cutting(int h){
40
long ans = 0;
41
42
- for(int i = 0; i < n; i++){
43
- if(trees[i] <= h) continue;
+ for(int i = 0; i < n; i++) ans += Math.max(0, trees[i] - h);
44
45
- ans += (trees[i] - h);
46
- }
47
return ans;
48
}
49
0 commit comments