
sortings
HownoneHe
即使是微弱的光芒,当它们一点一滴汇聚起来,积攒到一定程度时也会化为璀璨的烟火,绽放出耀眼的美丽
展开
-
【NOIP2013模拟】七夕祭
Sample Input4 32 5 4 32 1 33 2 44 2 4Sample Output-12Data ConstraintHint第一份订单满足后,4天剩余教室分数分别为0,3,2,3. 第二份订单要求第二天到第四天每天提供三个教室,而第三天剩余的教室数为二,因此无法满足。分配停止通知第二个申请人修改订单。10% -> 1<=n,m<=1030% -> 1<=n,m<=100070%原创 2016-04-09 15:03:29 · 1460 阅读 · 0 评论 -
堆模板(小根堆)
从小到大排序#include <cstdio> #include <iostream> #define fo(i,a,b) for (int i=a;i<=b;i++) #define N 200005 using namespace std; int a[N],num=0,n; void Up(int x){ for (;x>1 && a[x] < a[x >> 1];x >>= 1) swap原创 2016-10-07 13:40:45 · 995 阅读 · 0 评论