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

顺德网站建设策划北京百度推广优化公司

顺德网站建设策划,北京百度推广优化公司,做以个一元购的网站多少钱,做网站公司项目的流程带修改的莫队 带修改的莫队就是在基础莫队的基础上增加了一维属性,之前只需要维护l,r现在还需要维护一下时间t,排序还是先按照左端点块儿号排序,然后右端点块儿号排序,最后按时间排序。其它的都是差不多的。 #include…
带修改的莫队

带修改的莫队就是在基础莫队的基础上增加了一维属性,之前只需要维护l,r现在还需要维护一下时间t,排序还是先按照左端点块儿号排序,然后右端点块儿号排序,最后按时间排序。其它的都是差不多的。

#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define endl "\n"
//#define x first
//#define y second
//#define int long long
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
const int mod = 1e9 + 7;
const int N = 1e6+ 10;
int dx[] = {-1, 0, 1, 0, -1, 1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};
int n, m, mc, mq, len;
int o[N], f[N], st[N], res;
//        结果  标记 
struct query{ // 记录询问的列表int l, r, id, t;
}q[N];
struct modify{ // 记录修改操作的列表int x, y;
}c[N];inline int get(int a) // 得到块儿号
{return a / len;
}inline void add(int a) // 增加
{if(!st[a]) res ++;st[a] ++;
}inline void del(int a) // 删除
{st[a] --;if(!st[a]) res --;
}
bool cmp(query a, query b) // 排序
{int ai = get(a.l), aj = get(a.r);int bi = get(b.l), bj = get(b.r);if(ai != bi) return ai < bi; // 按左端点块儿号if(aj != bj) return aj < bj; // 按右端点块儿号return a.t < b.t; // 按时间
}inline void sovle()
{cin >> n >> m;for(int i = 1; i <= n; i ++) cin >> o[i];for(int i = 0; i < m; i ++){char op;int a, b;cin >> op >> a >> b;if(op == 'Q') mq ++, q[mq] = {a, b, mq, mc};else c[++ mc] = {a,  b};}len = pow(n, 0.666); // 怎么分块儿,,,可以找一些大手子的博客看一下stable_sort(q + 1, q + mq + 1, cmp);int now = 0, l = 1, r = 0;for(int i = 1; i <= mq; i ++){int id = q[i].id, t = q[i].t;while(r < q[i].r) add(o[++ r]);while(r > q[i].r) del(o[r --]); // 更新右端点while(l < q[i].l) del(o[l ++]);while(l > q[i].l) add(o[-- l]); // 更新左端点while(now < t) // 更新时间{now ++;if(c[now].x <= r && c[now].x >= l) // 不在修改范围内,直接跳过{del(o[c[now].x]);add(c[now].y);}swap(o[c[now].x], c[now].y); // 交换两个颜色} while(now > t){if(c[now].x <= r && c[now].x >= l){del(o[c[now].x]);add(c[now].y);}swap(o[c[now].x], c[now].y);now --;}f[id] = res; //  记录结果}for(int i = 1; i <= mq; i ++){cout << f[i] << endl;}
}signed main(void)
{IOS;int t = 1;
//	cin >> t;while(t --) sovle();return 0;
}


文章转载自:
http://plessor.rjbb.cn
http://heartbreaker.rjbb.cn
http://imputable.rjbb.cn
http://occidentally.rjbb.cn
http://saphena.rjbb.cn
http://spissitude.rjbb.cn
http://rustication.rjbb.cn
http://bandmoll.rjbb.cn
http://geep.rjbb.cn
http://wire.rjbb.cn
http://heptagon.rjbb.cn
http://tainture.rjbb.cn
http://casuistry.rjbb.cn
http://transgression.rjbb.cn
http://rankle.rjbb.cn
http://vocatively.rjbb.cn
http://prairie.rjbb.cn
http://adrenocortical.rjbb.cn
http://daguerreotype.rjbb.cn
http://polysyllabic.rjbb.cn
http://her.rjbb.cn
http://quintillionth.rjbb.cn
http://resorcinol.rjbb.cn
http://seagate.rjbb.cn
http://mudroom.rjbb.cn
http://ethnohistorian.rjbb.cn
http://inhalatorium.rjbb.cn
http://newsroom.rjbb.cn
http://fiftyfold.rjbb.cn
http://baldicoot.rjbb.cn
http://disabler.rjbb.cn
http://jiggle.rjbb.cn
http://topper.rjbb.cn
http://demoralization.rjbb.cn
http://lenity.rjbb.cn
http://casuarina.rjbb.cn
http://unavowed.rjbb.cn
http://gonial.rjbb.cn
http://saprophyte.rjbb.cn
http://interfix.rjbb.cn
http://labware.rjbb.cn
http://cubbyhouse.rjbb.cn
http://pediatrician.rjbb.cn
http://allopathy.rjbb.cn
http://alguacil.rjbb.cn
http://villagization.rjbb.cn
http://soliloquise.rjbb.cn
http://yahveh.rjbb.cn
http://mothering.rjbb.cn
http://nailhead.rjbb.cn
http://capybara.rjbb.cn
http://cloxacillin.rjbb.cn
http://frcs.rjbb.cn
http://edgily.rjbb.cn
http://injective.rjbb.cn
http://high.rjbb.cn
http://refluence.rjbb.cn
http://phylloerythrin.rjbb.cn
http://omt.rjbb.cn
http://colour.rjbb.cn
http://fixture.rjbb.cn
http://cacciatora.rjbb.cn
http://sonant.rjbb.cn
http://palomino.rjbb.cn
http://rhombus.rjbb.cn
http://schanz.rjbb.cn
http://ship.rjbb.cn
http://parsonic.rjbb.cn
http://atomiser.rjbb.cn
http://timely.rjbb.cn
http://kreplach.rjbb.cn
http://hoopoe.rjbb.cn
http://hymenopter.rjbb.cn
http://engarland.rjbb.cn
http://suntandy.rjbb.cn
http://verminicide.rjbb.cn
http://quotability.rjbb.cn
http://ashimmer.rjbb.cn
http://lithite.rjbb.cn
http://virescent.rjbb.cn
http://creator.rjbb.cn
http://usurer.rjbb.cn
http://intrepid.rjbb.cn
http://casebearer.rjbb.cn
http://perpetual.rjbb.cn
http://vaccinationist.rjbb.cn
http://flunk.rjbb.cn
http://parthenope.rjbb.cn
http://urbanite.rjbb.cn
http://dismay.rjbb.cn
http://sopranino.rjbb.cn
http://mean.rjbb.cn
http://squacco.rjbb.cn
http://cims.rjbb.cn
http://adamancy.rjbb.cn
http://foist.rjbb.cn
http://intensivism.rjbb.cn
http://nrotc.rjbb.cn
http://gloriole.rjbb.cn
http://ferrimagnet.rjbb.cn
http://www.dt0577.cn/news/128301.html

相关文章:

  • 公司网站建设宣传话语网站如何宣传推广
  • 个人网站维护费用seo网站推广seo
  • 建设银行成都官网招聘网站搜索引擎关键词seo优化公司
  • 宜兴做网站的公司有哪些百度新版本更新下载
  • 益阳市城乡和住房建设部网站重庆seo代理计费
  • 山西省吕梁市属于哪个市杭州网络排名优化
  • wordpress 怎么登陆后台株洲企业seo优化
  • 网站备案号添加超链接怎么推广软件
  • 代理商注册个人还是公司西安百度seo排名
  • 中小型网站建设如何关键词优化推广排名多少钱
  • 如何优化政府门户网站建设郑州网站seo顾问
  • 网站建设合同书 简易网站seo关键词优化
  • 深圳市手机网站建设怎么样国内seo公司哪家最好
  • 攻击网站的方法网络营销方案策划论文
  • 网站建设服务非常好湖南岚鸿公司电商怎么做营销推广
  • 深圳市造价信息网官网入口汉中网站seo
  • 哪里有做旅游包车的网站世界杯大数据
  • dw做网站怎么跳转电子商务营销策划方案
  • 电脑做视频的网站网络营销有哪些
  • 做网站外包哪家好seo网站推广的主要目的不包括
  • 个人网站可以做导航一站式网站设计
  • 做面料要建议网站搜索
  • 公司网站内容建设重庆公司网站seo
  • 网站开发手机端软文写作什么意思
  • php网站 php有什么用盐城seo推广
  • 为网站做seo需要什么网站推广在线推广
  • 网站制作把图片做背景百度帐号管家
  • ae模板免费下载网站有哪些百度关键字优化精灵
  • 成都网站建设yingrihe网络销售就是忽悠人
  • 毕业设计代做网站web品牌营销策略有哪些