http:codeforces.comcontest218problemB贪心算法:STL优先队列实现最大堆,最小堆#includeiostream#i http://codeforces.com/contest/218/problem/B 贪心算法: STL优先队列实现最大堆,最小堆 #include#include using na
http://codeforces.com/contest/218/problem/B
贪心算法:
STL优先队列实现最大堆,最小堆
#include#include using namespace std;const int MAX=1001;int a[MAX];int calPrize(int n, int x){ int start=n-x+1; return (start+n)*x/2;} int fun(int n, int m, int pos[]){ priority_queue