摘要:
常规用法:默认从大到小排列。#include#includeusing namespace std;priority_queueque;typedef pair P;int main(){ for (int i = 0; i #include#include//需要用到greaterusing namespace std;priority_queue, greater> que;typedef pair P;int main(){ for (int i = 0; i #includeusing namespace std;struct cmp{ bool operator()... 阅读全文
摘要:
Fence RepairTime Limit:2000MSMemory Limit:65536KTotal Submissions:22196Accepted:7074DescriptionFarmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needsN(1 ≤N≤ 20,000) planks of wood, each having some integer lengthLi(1 ≤Li≤ 50,000) uni 阅读全文
摘要:
Best Cow LineDescriptionFJ is about to take hisN(1 ≤N≤ 2,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer arrange... 阅读全文