2017湘潭大学邀请赛G题(贪心+优先队列)

参考博客:http://www.cnblogs.com/chendl111/p/6891770.html

题目链接:https://www.icpc.camp/contests/4mYguiUR8k0GKE

                                                 Parentheses

Input

The input contains zero or more test cases and is terminated by end-of-file. For each test case: The first line contains an integer n. The i-th of the following n lines contains li , ci , di .

• 1 ≤ n ≤ 105 • 1 ≤ l1 + l2 + · · · + ln ≤ 109

• l1 + l2 + · · · + ln is even.

• 1 ≤ di ≤ 109

• The sum of n does not exceed 106 .

猜你喜欢

转载自www.cnblogs.com/carcar/p/9026149.html