今天比赛因为不会双端队列卡了几道题,今天好好学学。双端队列一般保存2个值, 原数组的下标,数组中的值。View Code #include<stdio.h>#include<string.h>#include<algorithm>using namespace std;#define maxn 1000003int a[maxn];int n, m;struct Queue{ int pos, val;}que[maxn];void getmin(){ int i; int head = 0, tail = -1; for(i = 0; i < m-1 Read More
posted @ 2012-10-04 22:00
To be an ACMan
Views(413)
Comments(0)
Diggs(0)

浙公网安备 33010602011771号