Skip to content

Commit f2cec11

Browse files
committed
[Gold III] Title: 여왕벌, Time: 4700 ms, Memory: 304316 KB, Score: 100 point -BaekjoonHub
1 parent c52b6c2 commit f2cec11

2 files changed

Lines changed: 26 additions & 8 deletions

File tree

백준/Gold/10836. 여왕벌/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
### 성능 요약
66

7-
메모리: 36808 KB, 시간: 556 ms
7+
메모리: 304316 KB, 시간: 4700 ms
88

99
### 분류
1010

1111
구현, 시뮬레이션
1212

1313
### 제출 일자
1414

15-
2024년 11월 30일 06:01:25
15+
2024년 11월 30일 06:04:13
1616

1717
### 문제 설명
1818

백준/Gold/10836. 여왕벌/여왕벌.java

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,34 @@ static void daily_grow(){
2828

2929
for (int i = m - 1; 0 <= i; i--) {
3030

31-
if(0 < zero[day]--) bee[i][0] += 0;
32-
else if(0 < one[day]--) bee[i][0] += 1;
33-
else if(0 < two[day]--) bee[i][0] += 2;
31+
if(0 < zero[day]){
32+
bee[i][0] += 0;
33+
zero[day]--;
34+
35+
} else if(0 < one[day]){
36+
bee[i][0] += 1;
37+
one[day]--;
38+
39+
} else if(0 < two[day]) {
40+
bee[i][0] += 2;
41+
two[day]--;
42+
}
3443
}
3544

3645
for (int i = 1; i < m; i++) {
46+
47+
if(0 < zero[day]){
48+
bee[0][i] += 0;
49+
zero[day]--;
3750

38-
if(0 < zero[day]--) bee[0][i] += 0;
39-
else if (0 < one[day]--) bee[0][i] += 1;
40-
else if (0 < two[day]--) bee[0][i] += 2;
51+
} else if(0 < one[day]){
52+
bee[0][i] += 1;
53+
one[day]--;
54+
55+
} else if(0 < two[day]) {
56+
bee[0][i] += 2;
57+
two[day]--;
58+
}
4159
}
4260
}
4361

0 commit comments

Comments
 (0)