離散化+最大費(fèi)用最大流...
源點(diǎn)---1 .. 2 ..3 .... n ---匯點(diǎn) 連流量為K,費(fèi)用為0的邊
對(duì)于(a , b , w) 連從 a到b容量1費(fèi)用w的邊
Intervals
Description You are given N weighted open intervals. The ith interval covers (ai, bi) and weighs wi. Your task is to pick some of the intervals to maximize the total weights under the limit that no point in the real axis is covered more than k times. Input The first line of input is the number of test case. Output For each test case output the maximum total weights in a separate line. Sample Input 4
3 1
1 2 2
2 3 4
3 4 8
3 1
1 3 2
2 3 4
3 4 8
3 1
1 100000 100000
1 2 3
100 200 300
3 2
1 100000 100000
1 150 301
100 200 300
Sample Output 14
12
100000
100301
Source
POJ Founder Monthly Contest
生活不易,碼農(nóng)辛苦
如果您覺得本網(wǎng)站對(duì)您的學(xué)習(xí)有所幫助,可以手機(jī)掃描二維碼進(jìn)行捐贈(zèng) ![]()
------分隔線----------------------------
------分隔線----------------------------
欄目熱點(diǎn)
|