Skip to content

Conversation

@oncsr
Copy link
Contributor

@oncsr oncsr commented Oct 12, 2025

🧷 문제 링크

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

🧭 풀이 시간

10분

👀 체감 난이도

✏️ 문제 설명

정점 N개, 간선 M개인 그래프의 각 간선에는 Kaka와 Bebe가 각각 c[i], d[i]마리 살고 있다.
0번 정점에서 N-1번 정점까지 경로 중 다음 조건을 만족하는 경로를 찾아보자.

  1. 경로에 있는 Kaka의 총 마리 수와 Bebe의 총 마리 수는 각각 1,000을 넘어서는 안 된다.
  2. 해당 경로의 스트레스는 (Kaka의 총 마리 수)×(Bebe의 총 마리 수)로 정의된다. 만약 1번을 만족하는 경로가 여러 개가 있다면 그 중 스트레스가 가장 적은 경로를 선택한다.

🔍 풀이 방법

  • 다익스트라

dist배열을 dist[n][k] = n번 정점까지 k마리의 Kaka를 데리고 왔을 때 Bebe의 최소 마리 수 로 정의하고 다익스트라를 돌렸다.

⏳ 회고

ez

@oncsr oncsr added the success 👍 해설을 보지 않고 풀었을 때 label Oct 12, 2025
@ShinHeeEul ShinHeeEul merged commit 76a0a45 into main Oct 12, 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