[UVa 1267]Network

題解 我們將圖中給出的$VOD$爲根建立有根樹,每次取出未覆蓋的最深的節點第$k$級祖先,將其建爲$VOD$,遍歷一遍,將能夠蓋到的點標記。重複,直到蓋完。貪心正確性可以證明。 1 //It is made by Awson on 2017.9.16 2 #include <map> 3 #include <set> 4 #include <cmath> 5 #include
相關文章
相關標籤/搜索