Wiring
시간 제한: 1000ms메모리 제한: 512MB출처: IOI 2017BOJ 20077
문제
Maryam is an electrical engineer. She is designing wiring on a communication tower. On the tower there are some connection points, placed at distinct heights. A wire can be used to connect any two connection points. Each connection point can be connected to an arbitrary number of wires. There are two types of connection points: red and blue.
For the purpose of this problem the tower should be viewed as a line and the connection points as blue and red points that are at non-negative integer coordinates on this line. The length of a wire is the distance between the two connection points it connects.
Your goal is to help Maryam find a wiring scheme such that:
- Each connection point has at least one wire to a connection point of a different color.
- The total length of the wires is minimized.
코드를 제출하려면 로그인하세요.