Skip to content
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

[13 최단경로] 1914039 최유진 #358

Open
wants to merge 25 commits into
base: 1914039-최유진
Choose a base branch
from

Conversation

choi-yujin
Copy link

@choi-yujin choi-yujin commented May 30, 2023

인적사항

학번: 1914039
이름: 최유진


과제 제출

기존 제출 : 1238
추가 제출 : 2458, 15685


@Dong-droid
Copy link
Contributor

Dong-droid commented May 31, 2023

P1. 코드리뷰완료
수고하셨습니다 😸

int Cost = -PQ.top().first;
int Cur = PQ.top().second;
PQ.pop(); //coast와 cur에 저장한 다음 pop

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1. 다익스트라의 핵심적인 부분이 빠졌습니다!!! 다른 문제의 경우에 이 부분을 빠뜨리면 시간 초과가 나는 경우가 많습니다. 다익스트라의 그리디 최적해는 최소 정점을 뽑고, 어떤 경우 ❓ 에 무시를 하게 됩니다! 이 를 어떻게 구현했었죠??

Comment on lines 51 to 74
void Solution() {

for (int i = 1; i <= N; i++) {
for (int j = 1; j <= N; j++) {
Dist[j] = INF;
}
Dijkstra(i);
Res[i] = Dist[X];
}
for (int j = 1; j <= N; j++) {
Dist[j] = INF;
}

Dijkstra(X);
for (int i = 1; i <= N; i++) {
Res[i] = Res[i] + Dist[i];
}

sort(Res + 1, Res + N + 1);// 가장 큰 값을 찾기 위해 정렬
int Answer = Res[N];//가장 큰 값

cout << Answer;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 P3. 그런데, 변수 이름에 Answer 이렇게 첫 문자만 대문자로 하는 이유가 있나요?? snake case와 camel case 둘다 아닌 것 같은데요!! answer로 하시는 게 클린 코드에 더 부합하는 것 같습니다 😉

Copy link
Contributor

@jk0527 jk0527 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[최단 경로 구현 문제 추가 제출 확인 완료]

추가 제출 확인했습니다!🥰🥰
수고하셨습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants