Skip to content

Conversation

@LiiNi-coder
Copy link
Contributor

🧷 문제 링크

https://www.acmicpc.net/problem/1956

🧭 풀이 시간

35 분

👀 체감 난이도

✏️ 문제 설명

  • 단방향 그래프가 주어지고, 사이클을 찾아서, 가장 짧은 거리합산 사이클을 찾고, 그 짧은 거리를 출력

🔍 풀이 방법

  • 플루이드 워셜을 진행한 후, 사이클을 찾기 위해서, a->b, b->a를 해서, a는 for 0...n, b는 for 0...n인데, a와 같으면 넘김

⏳ 회고

  • 플루이드 워셜엔 Integer.MAX_VALUE() 를쓰면안된다!
  • 이번 코딩테스트에서, 그래프에서 a에서 b로가는 최단거리route안에 특정 간선이 포함되어있는지없는지를 알아내는 로직이 나왔다. 다음엔 최단길이뿐만 아니라, 최단경로 자체를 구하는 로직을 연습해야겠다.

@LiiNi-coder LiiNi-coder added the success 👍 해설을 보지 않고 풀었을 때 label Aug 10, 2025
@ShinHeeEul ShinHeeEul merged commit d1faba3 into main Aug 10, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants