Skip to content

Commit d45ff9f

Browse files
committed
Fix: 백준 문제 번호에 맞게 패키지 이동
1 parent 913611a commit d45ff9f

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

BOJ/1000-10000번/YJ_13335.java renamed to BOJ/10001-15000번/YJ_13335.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* - 한컨씩 전진 했을 떼 "가장 앞에 있는 트럭"이 다리의 길이까지 왔다면 다리에서 탈출한다
1010
* - 다리 최대하중 이하일때만 트럭이 다리에 올라올 수 있다
1111
* - 한번의 반복이 시간 +1
12+
* 참고: https://dy-coding.tistory.com/entry/%EB%B0%B1%EC%A4%80-13335%EB%B2%88-%ED%8A%B8%EB%9F%AD-java
1213
*/
1314
public class YJ_13335 {
1415
public static void main(String[] args) {
@@ -48,9 +49,9 @@ static int getMinTime(int W, int L, Queue<Truck> trucks, int[] moveCount){
4849
int idx = truck.index;
4950
int weight = truck.weight;
5051

51-
if(!bridge.isEmpty()){ //O(N) > 최악의 경우 다리에 있는 모든 트럭이 이동
52+
if(!bridge.isEmpty()){
5253
int start = bridge.peek().index; //★다리 위에 있는 가장 앞에 있는 트럭의 인덱스
53-
for(int i = start; i<idx; i++){ //★새로 올라가려는 트럭의 인덱스 idx 전까지 다리 위에 있는 트럭들이 한 칸씩 전진
54+
for(int i = start; i<idx; i++){ //O(logN)★새로 올라가려는 트럭의 인덱스 idx 전까지 다리 위에 있는 트럭들이 한 칸씩 전진
5455
moveCount[i]--;
5556
}
5657

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)