Codeforces上的贪心题,如何巧妙构造长尾词?
- 内容介绍
- 文章标签
- 相关推荐
本文共计148个文字,预计阅读时间需要1分钟。
http://codeforces.com/contest/218/problem/B使用贪心算法和STL优先队列实现最大堆和最小堆。
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
本文共计148个文字,预计阅读时间需要1分钟。
http://codeforces.com/contest/218/problem/B使用贪心算法和STL优先队列实现最大堆和最小堆。
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

