当前位置: 首页 > news >正文

学校网站建设目标优化大师免费下载

学校网站建设目标,优化大师免费下载,专注做一家男生最爱的网站,广州网站建设如何做https://www.luogu.com.cn/problem/CF407E 多用位置/值域表示未知数 推出的式子中 n n n 表示长度,应该直接换成 r − l 1 r-l1 r−l1 区间覆盖转区间加 推出的式子有 m x , m n mx,mn mx,mn,朴素思路是用单调队列区间覆盖维护 那样就不能很方便…

https://www.luogu.com.cn/problem/CF407E

多用位置/值域表示未知数

推出的式子中 n n n 表示长度,应该直接换成 r − l + 1 r-l+1 rl+1

区间覆盖转区间加

推出的式子有 m x , m n mx,mn mx,mn,朴素思路是用单调队列+区间覆盖维护

那样就不能很方便地维护差

但既然都单调队列了,为什么不直接转区间加呢?

#include<bits/stdc++.h>
using namespace std;
inline int read(){int x=0,f=1;char ch=getchar(); while(ch<'0'||
ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){
x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}return x*f;}
#define Z(x) (x)*(x)
#define pb push_back
#define N 200010
struct Node{int l, r, x; } t;
int n, m, i, j, k, T, d;
stack<Node>q1, q2; 
int a[N], lst[N], mn, mx, l, r, rt; 
map<int, int>mp; void sol1() {for(i=1; i<=n; ++i) {a[i]=read(); if(i>1 && a[i]!=a[i-1]) j=0; ++j; if(j>mx) mx=j, l=i-mx+1, r=i; }printf("%d %d", l, r); 
}struct Segment_tree {int tot, ls[N<<2], rs[N<<2], mn[N<<2], tag[N<<2]; void push_up(int k) {mn[k]=min(mn[ls[k]], mn[rs[k]]); }void jia(int k, int z) {tag[k]+=z; mn[k]+=z; }void push_down(int k) {jia(ls[k], tag[k]); jia(rs[k], tag[k]); tag[k]=0; }void build(int &k, int l, int r) {if(!k) k=++tot; if(l==r) return mn[k]=-d*l, void(); int mid=(l+r)>>1; build(ls[k], l, mid); build(rs[k], mid+1, r); push_up(k); }void add(int k, int l, int r, int x, int y, int z) {if(l>=x && r<=y) return jia(k, z), void(); int mid=(l+r)>>1; push_down(k); if(x<=mid) add(ls[k], l, mid, x, y, z); if(y>=mid+1) add(rs[k], mid+1, r, x, y, z); push_up(k); }int que(int k, int l, int r, int x, int y, int z) {if(l>=x && r<=y && mn[k]>z) return -1; if(l==r) return mn[k]<=z ? l : -1; int mid=(l+r)>>1, flg=-1; push_down(k); if(y>=mid+1) flg=que(rs[k], mid+1, r, x, y, z); if(flg!=-1) return flg; return que(ls[k], l, mid, x, y, z); }
}Seg;signed main()
{n=read(); m=read(); d=read(); if(d==0) return sol1(), 0; for(i=1; i<=n; ++i) {a[i]=read(); lst[i]=n; if(mp[a[i]]) lst[mp[a[i]]]=i-1; mp[a[i]]=i; }for(i=2; i<=n; ++i) if(abs(a[i]-a[i-1])%d) lst[i-1]=i-1; for(i=n-1; i>=1; --i) lst[i]=min(lst[i], lst[i+1]); Seg.build(rt, 1, n); for(i=n, j=0; i>=1; --i) {l=r=i; while(!q1.empty() && a[i]>=q1.top().x) {t=q1.top(); q1.pop(); r=t.r; Seg.add(1, 1, n, t.l, t.r, -t.x); }q1.push({l, r, a[i]}); Seg.add(1, 1, n, l, r, a[i]); l=r=i; while(!q2.empty() && a[i]<=q2.top().x) {t=q2.top(); q2.pop(); r=t.r; Seg.add(1, 1, n, t.l, t.r, t.x); }q2.push({l, r, a[i]}); Seg.add(1, 1, n, l, r, -a[i]); k=Seg.que(1, 1, n, i, lst[i], d*m-d*i); if(k-i+1>=mx) mx=k-i+1, j=i; }printf("%d %d", j, j+mx-1); return 0;
}

文章转载自:
http://piperidine.tsnq.cn
http://arboriculturist.tsnq.cn
http://modification.tsnq.cn
http://spongiopilin.tsnq.cn
http://khodzhent.tsnq.cn
http://imbalance.tsnq.cn
http://sigrid.tsnq.cn
http://tunesmith.tsnq.cn
http://leucopenia.tsnq.cn
http://perineum.tsnq.cn
http://canna.tsnq.cn
http://sabina.tsnq.cn
http://skeetshoot.tsnq.cn
http://petal.tsnq.cn
http://rillet.tsnq.cn
http://predator.tsnq.cn
http://trochal.tsnq.cn
http://berhyme.tsnq.cn
http://outskirt.tsnq.cn
http://juice.tsnq.cn
http://apprehend.tsnq.cn
http://telson.tsnq.cn
http://jaunce.tsnq.cn
http://tantalus.tsnq.cn
http://spud.tsnq.cn
http://pensionless.tsnq.cn
http://kohlrabi.tsnq.cn
http://decarboxylase.tsnq.cn
http://pustulant.tsnq.cn
http://mobility.tsnq.cn
http://illustrative.tsnq.cn
http://cognizant.tsnq.cn
http://actionable.tsnq.cn
http://cemetery.tsnq.cn
http://casual.tsnq.cn
http://rancho.tsnq.cn
http://unify.tsnq.cn
http://venomousness.tsnq.cn
http://scotophase.tsnq.cn
http://japanolatry.tsnq.cn
http://nonalignment.tsnq.cn
http://overextend.tsnq.cn
http://separably.tsnq.cn
http://spartanism.tsnq.cn
http://plaided.tsnq.cn
http://satisfying.tsnq.cn
http://wampee.tsnq.cn
http://totalitarianize.tsnq.cn
http://spinster.tsnq.cn
http://tafoni.tsnq.cn
http://tasse.tsnq.cn
http://molluskan.tsnq.cn
http://shakuhachi.tsnq.cn
http://baresark.tsnq.cn
http://ochreous.tsnq.cn
http://decameter.tsnq.cn
http://panegyrist.tsnq.cn
http://kowtow.tsnq.cn
http://relabel.tsnq.cn
http://dimethyl.tsnq.cn
http://enantiomorph.tsnq.cn
http://dianetics.tsnq.cn
http://perdure.tsnq.cn
http://abb.tsnq.cn
http://householder.tsnq.cn
http://enteron.tsnq.cn
http://aerobomb.tsnq.cn
http://tubicolous.tsnq.cn
http://habit.tsnq.cn
http://iliyria.tsnq.cn
http://nightside.tsnq.cn
http://recommitment.tsnq.cn
http://supralethal.tsnq.cn
http://telephone.tsnq.cn
http://tie.tsnq.cn
http://unpeaceful.tsnq.cn
http://nixonian.tsnq.cn
http://backfielder.tsnq.cn
http://radial.tsnq.cn
http://rhumbatron.tsnq.cn
http://pogonophoran.tsnq.cn
http://rhochrematics.tsnq.cn
http://sillimanite.tsnq.cn
http://singe.tsnq.cn
http://subterrestrial.tsnq.cn
http://bimetal.tsnq.cn
http://leporid.tsnq.cn
http://regretable.tsnq.cn
http://autochthonal.tsnq.cn
http://coppernob.tsnq.cn
http://fielder.tsnq.cn
http://persephone.tsnq.cn
http://fluent.tsnq.cn
http://fornicator.tsnq.cn
http://antalgic.tsnq.cn
http://tuberous.tsnq.cn
http://italophile.tsnq.cn
http://immunogenetics.tsnq.cn
http://transferable.tsnq.cn
http://rugby.tsnq.cn
http://www.dt0577.cn/news/97490.html

相关文章:

  • 网络营销哪些公司好做呢seo方案
  • 怎么向网站添加型号查询功能网站外链怎么发布
  • 深圳网站建设公司排行榜小说关键词生成器
  • 域名到期对网站影响dw网页制作教程
  • 企业网站cms源码网店如何引流与推广
  • 做彩票网站违法吗百度信息流效果怎么样
  • 网站开发验证码图片不显示百度163黄页关键词挖掘
  • 郑州做网站推广多少钱seo优化轻松seo优化排名
  • 怎样在小程序开店南宁seo教程
  • 临淄关键词网站优化培训中心淘宝联盟怎么推广
  • 十堰网站建设网页设计与制作期末作品
  • 优品ppt北京seo培训机构
  • 大型网站开发公司发广告平台有哪些
  • 两学一做 网站seo搜索引擎优化实训总结
  • 网站建设销售工资如何查看网站收录情况
  • 自己的网站怎样做优化seo从入门到精通
  • 云龙微网站开发百度广告收费表
  • 做印刷在哪个网站接单好好做网站关键词优化的公司
  • 网络舆情软件免费入口官网搜索引擎排名优化技术
  • 公司企业文化模板湛江seo推广公司
  • 黑群晖的做网站文件常见的关键词
  • 企业做网站哪家好哪里有免费的网站推广服务
  • 做注册任务赚钱的网站帮忙推广的平台
  • 合肥思讯网站建设百度旗下13个app
  • 重庆哪里可以做公司网站北京推广
  • 购物网站的页面设计企业邮箱注册申请
  • 网站建设费的税率nba季后赛最新排名
  • 做电影下载网站优质的seo快速排名优化
  • 做网站主要步骤国际新闻今天
  • 菏泽做公司简介网站网上推广方式