기출 문제 / ACPC 2026 ACPC

Authentication Code

N cities are connected by N−1 communication lines. By following the lines, there is exactly one path between any two cities. Line i connects cities ui and vi, and carries an encryption key wi.

30 agents are on standby. You choose one or more of them, and for each chosen agent you assign a start city and a destination city.