-
Notifications
You must be signed in to change notification settings - Fork 37
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
[최단경로] 2176255 이서연 #347
base: 2176255-이서연
Are you sure you want to change the base?
[최단경로] 2176255 이서연 #347
Conversation
[코드리뷰완료] |
vector<int> dist_X = dijkstra(X, N, graph); // ( X -> 모든 정점) 최단 시간 저장 | ||
|
||
int max_time = 0; // 최대 소요시간 초기화 | ||
for (int i = 1; i <= N; i++) { | ||
if (i == X) continue; // 모이는 마을은 제외 | ||
vector<int> dist_i = dijkstra(i, N, graph); // (학생 위치 i -> X) 최단 시간 | ||
max_time = max(max_time, dist_X[i] + dist_i[X]); | ||
// 왕복 시간 = ( X -> 학생 위치 i ) + ( 학생 위치 i -> X ) | ||
} |
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.
💯 👍
if (i != j && graph[i][j] == INF && graph[j][i] == INF) { | ||
// 둘이 같지 않고 가중치가 INF이면 | ||
// i번째 학생과 j번째 학생 사이의 경로가 없음 | ||
check = false; // 비교 불가능 | ||
break; |
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.
👍 💯
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.
[최단 경로 구현 문제 추가 제출 확인 완료]
추가 제출 확인했습니다!🥰🥰
수고하셨습니다!
인적사항
학번: 2176255
이름: 이서연
과제 제출
기존 제출 : 1238, 2458
추가 제출 : 15685