BZOJ 1179: [Apio2009]Atm

某岛 at 
http://www.lydsy.com/JudgeOnline/problem.php?id=1179 强联通缩点,DAG DP……