Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[27주차] 손지민 #359

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

Merged
KodaHye merged 4 commits into main from jimin
Mar 30, 2025
Merged

[27주차] 손지민 #359

KodaHye merged 4 commits into main from jimin
Mar 30, 2025

Conversation

Copy link
Contributor

@jmxx219 jmxx219 commented Mar 25, 2025

No description provided.

@jmxx219 jmxx219 self-assigned this Mar 25, 2025
Comment on lines +6 to +25
for(int k = 1; k <= n; k++) {
for(int i = 1; i <= n; i++) {
if(edge[i][k] == INF) continue;
for(int j = 1; j <= n; j++) {
if(edge[k][j] == INF) continue;
if(edge[i][j] > edge[i][k] + edge[k][j]) {
edge[i][j] = edge[i][k] + edge[k][j];
}
}
}
}

int answer = Math.min(INF, edge[s][a] + edge[s][b]);
for(int i = 1; i <= n; i++) {
if(i == s) continue;
int cost = Math.min(INF, edge[s][i] + edge[i][a] + edge[i][b]);
answer = Math.min(answer, cost);
}

return answer;
Copy link
Contributor

Choose a reason for hiding this comment

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

최단 경로를 구하는거여서 플로이드워셜도 사용할 수 있군요!! 잊고 있었는데, 참고하고 갑니다!

jmxx219 reacted with thumbs up emoji
@KodaHye KodaHye merged commit 98353c1 into main Mar 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@KodaHye KodaHye KodaHye left review comments

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /