随笔分类 - 优先队列+单调队列
摘要:/*两个约束条件求最短路,用优先队列*/#include#include#includeusing namespace std;#define N 110struct node {int u,v,w,f,next;}bian[N*N*4];int head[N],yong,money;void i...
阅读全文
摘要:#include#include#include//水杯盛水问题,用优先队列不断从最小的边缘开始using namespace std;int n,m;#define N 400int p[N][N];struct node { int x,y,w; friend bool operatorb.w;...
阅读全文
摘要:#include#include#include#include#include#includeusing namespace std;#define N 30char map[N][N];struct node {double t;int x,y,f;friend bool operatorb.t...
阅读全文
摘要:#include#include#includeusing namespace std;struct node {int num;friend bool operatorb.num;}};int main() {int count,n,k,i;char s[3];while(scanf("%d%d"...
阅读全文
摘要:#include#include#define N 1100000int a[N];int fmin[N],fmax[N];int tmin[N],tmax[N];int dicmax(int l,int r,int f[],int k) { int mid; while(l=f[mid])//...
阅读全文
摘要:#include#define N 1100000int minf[N],maxf[N],a[N],index[N];int main() {int n,i,k,first,end;while(scanf("%d%d",&n,&k)!=EOF) {first=end=0; for(i=0;iinde...
阅读全文
摘要:#include//每次要吧生命值长的加入,吧生命用光的舍弃#define N 1100000int getmin[N],getmax[N],num[N],n,k,a[N];int main(){int i,first,last;while(scanf("%d%d",&n,&k)!=EOF) {fo...
阅读全文
摘要:http://blog.pureisle.net/archives/477.htmlhttp://blog.sina.com.cn/s/blog_7058524b01017m8v.html
阅读全文
摘要:#include#include#include#define N 1100using namespace std;struct node {char s[20];int power,num;friend bool operatorb.power;return a.num>b.num;}};int ...
阅读全文
浙公网安备 33010602011771号