网站在手机上内页图不显示,网站如何做谷歌推广,南京栖霞区有做网站的吗,wordpress 简繁体 插件我们发现前四个操作可以用双向链表维护#xff0c;而最后一个操作有一个限制就是1kn#xff0c;所以可以用一个数组存在光标前面的数#xff0c;每次维护一下前缀和就好 #includestdio.h
#includestring.h
#includealgorithm
#define N 100… 我们发现前四个操作可以用双向链表维护而最后一个操作有一个限制就是1kn所以可以用一个数组存在光标前面的数每次维护一下前缀和就好 #includestdio.h
#includestring.h
#includealgorithm
#define N 1000010
using namespace std;
int l[N],r[N],s[N]; char c[5];
int w[N],f[N]{-129},n0,m,t,cnt0;
int main(){freopen(editor.in,r,stdin);freopen(editor.out,w,stdout);scanf(%d,m);for(int x;m--;){scanf(%s,c);if(*cI){scanf(%d,x);n; cnt;l[cnt]t; r[cnt]r[t];l[r[t]]cnt; r[t]cnt;w[n]w[n-1]x; tcnt;s[t]x; f[n]max(f[n-1],w[n]);} else if(*cD){r[l[t]]r[t];l[r[t]]l[t];tl[t]; --n;} else if(*cR){if(r[t]){tr[t];n; w[n]w[n-1]s[t];f[n]max(f[n-1],w[n]);}} else if(*cL){if(n){ --n; tl[t]; }} else { scanf(%d,x); printf(%d\n,f[x]);}}
} 转载于:https://www.cnblogs.com/Extended-Ash/p/9477281.html