-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cpp] 백준 13907. 세금 (Platinum IV) (민코딩 다익스트라의 탑 2번. 통행) #57
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제가 cpp를 잘 몰라서 질문이 두가지 있습니다
- emplace_back은 일반적인 push_back과 어떻게 다른건가요?
- pair를 정렬할 때 기준이 따로 명시되어있지 않은데, 이 경우에는 무엇을 기준으로 정렬되나요? 첫번째 원소 기준 오름차순이어야 논리상 맞아보이긴 하는데 맞나요?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 이 문제 도전해보려고 해서 풀이를 자세히 못보는 상황이라서 너무 아쉽네요 ㅠㅠ
풀거나 포기한다면... 자세히 봐보겠습니다...
가끔 cpp 코드를 보면 간결하면서 속도도 빨라서 정말 신기하네요..
@kgh2120 풀고 오실때까지 머지 하지 않고 대기해볼께요 :) |
🌁 Background
민코딩 다익스트라 과제
👩💻 Contents
[Platinum IV] 세금 - 13907
📱 Screenshot
📝 Review Note
민코딩에서
다익스트라
를 중첩해서 작동시키는 방법으로 1차적으로 해결한 뒤, 백준에서 타임아웃을 마주쳤다.이를 해결하기 위해
DP
를 적용했고, 타임아웃은 해결했으나, 1초 이상의 시간이 소요되는 불편한 상황이 발생했다.속도를 올릴 방법을 생각하던 중, 어쳐피
DP
를 적용하기 때문에우선순위 큐
를 사용할 필요가 없다는 결론과, 결과에그리디 알고리즘
을 추가로 적용해 영원히 최소 경로가 될 수 없는 경우의 수를 제거해주며 최적화를 한 결과 소요 시간을250ms
까지 줄일 수 있었다.