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

用模板做的网站权重高吗dw外部网站链接怎么做

用模板做的网站权重高吗,dw外部网站链接怎么做,汉中市网站建设公司,wordpress字体在哪个文件夹题目来源#xff1a;[HEOI2016/TJOI2016] 排序 - 洛谷https://www.luogu.com.cn/problem/P2824 问题思路 本文介绍一种二分答案的做法#xff0c;时间复杂度为#xff1a;(nm)*log(n)*log(n).本题存在nlog(n)的做法#xff0c;然而其做法没有二分答案的做法通俗易懂. 默认读…题目来源[HEOI2016/TJOI2016] 排序 - 洛谷https://www.luogu.com.cn/problem/P2824 问题思路 本文介绍一种二分答案的做法时间复杂度为(nm)*log(n)*log(n).本题存在nlog(n)的做法然而其做法没有二分答案的做法通俗易懂. 默认读者已读过原题故直接介绍思路. 二分枚举答案为mid对于原序列中大于或等于mid的元素将其转化为1对于其他元素将其转化为0.现在原排列已转化为01序列m次操作对01序列进行排序.经过m次排序操作后如果第p个位置上的元素为1那么更新二分边界 r mid.否则如果第p个位置上的元素为0那么更新二分边界 l mid.如何维护m次操作呢该问题转化为线段树的修改查找问题。没有接触过线段树修查问题的读者建议先去学习相关知识此处不多赘述. 好了思路介绍完了你可能惊讶于为什么二分答案可行.如下便是二分答案可行性的一些解释. 假如经过m次操作后第p个位置上的元素为x0。我们考虑m次普通的序列排序但是此次排序咱们让每一个元素都夹带“私货”.对应于问题思路中的第一步令mid x0对于xmid的元素让它带上额外的元素1.对于xx0的元素让它带上额外的元素0.经过m次操作后元素x0位于第p个位置上且额外的“私货”——元素1也随之到达了第p个位置. 看到这里是否嗅到了二分答案的味道?既然 mid x0可行那么按照mid x0 - 1,x0 - 2....的要求给元素分配额外“私货”0和1那么 1 依旧会随着元素x0来到第p个位置上.然而假如midx0那么跟随元素x0到达第p个位置上的额外“私货”便是元素0了. 经过上述解释你应该理解了二分答案在该题目中的可行性. 当我们不再考虑普通的序列排序而是考虑01序列的排序时对元素0和1进行排序后的结果必定能够映射到其普通序列的正确的排序结果上.举个例子对序列 perm [1,5,2,4,3] 进行排序先二分答案 mid 3那么perm 转化 01序列 bperm [0,1,0,1,1]那么对 bperm进行升序排序的结果为 bperm [0,0,1,1,1]该排序结果能够映射到其普通序列的正确排序结果上即 perm [1,2,3,4,5]. OK解释到此结束更多细节问题请参考代码 #includebits/stdc.h using namespace std;const int N 100005; int a[N];int ls(int u) { return u 1; } int rs(int u) { return u 1 | 1; }struct tree {int l, r, s, tag; }tr[N * 4];void build(int u, int l, int r) {tr[u] { l,r,0,-1 };if (l r)return;int mid l r 1;build(ls(u), l, mid);build(rs(u), mid 1, r); }void addTag(int u, int v) {tr[u].s v * (tr[u].r - tr[u].l 1);tr[u].tag v; }void pu(int u) {tr[u].s tr[ls(u)].s tr[rs(u)].s; }void pd(int u) {// tag -1代表该线段的标签已重置...if (tr[u].tag ! -1) {addTag(ls(u), tr[u].tag);addTag(rs(u), tr[u].tag);tr[u].tag -1;} }void update(int L, int R, int u, int v) {if (tr[u].l R || tr[u].r L) return;if (L tr[u].l tr[u].r R) {addTag(u, v);return;}pd(u);int mid (tr[u].l tr[u].r) 1;if (L mid) update(L, R, ls(u), v);if (R mid) update(L, R, rs(u), v);pu(u); }int query(int L, int R, int u) {if (tr[u].l R || tr[u].r L) return 0;if (L tr[u].l tr[u].r R) return tr[u].s;pd(u);int mid (tr[u].l tr[u].r) 1;int ans 0;if (L mid) ans query(L, R, ls(u));if (R mid) ans ans query(L, R, rs(u));return ans; }int main() {ios::sync_with_stdio(0), cin.tie(0);int n, m;cin n m;for (int i 1;i n;i) cin a[i];vectorarrayint, 3op(m);for (int i 0;i m;i) {cin op[i][0] op[i][1] op[i][2];}build(1, 1, n);int q;cin q;int l 0, r n 1;while (l 1 ! r) {update(1, n, 1, 0);int mid l r 1;for (int i 1;i n;i)if (a[i] mid) update(i, i, 1, 1);for (int i 0;i m;i) {int o op[i][0], ql op[i][1], qr op[i][2];int k query(ql, qr, 1);int cnt qr - ql 1;// [qr-k1,qr]全为1[ql,qr-k]全为0...if (k 0 || k cnt) continue;if (o 0) {update(ql, qr - k, 1, 0);update(qr - k 1, qr, 1, 1);}else {update(ql, ql k - 1, 1, 1);update(ql k, qr, 1, 0);}}query(q, q, 1) 1 ? l mid : r mid;}cout l \n;return 0; }
文章转载自:
http://www.morning.rwjtf.cn.gov.cn.rwjtf.cn
http://www.morning.kndst.cn.gov.cn.kndst.cn
http://www.morning.qnftc.cn.gov.cn.qnftc.cn
http://www.morning.jtfcd.cn.gov.cn.jtfcd.cn
http://www.morning.tcylt.cn.gov.cn.tcylt.cn
http://www.morning.wfcqr.cn.gov.cn.wfcqr.cn
http://www.morning.rczrq.cn.gov.cn.rczrq.cn
http://www.morning.qsbcg.cn.gov.cn.qsbcg.cn
http://www.morning.lbzgt.cn.gov.cn.lbzgt.cn
http://www.morning.rynq.cn.gov.cn.rynq.cn
http://www.morning.mrxqd.cn.gov.cn.mrxqd.cn
http://www.morning.fhtmp.cn.gov.cn.fhtmp.cn
http://www.morning.jbnss.cn.gov.cn.jbnss.cn
http://www.morning.zdsdn.cn.gov.cn.zdsdn.cn
http://www.morning.phcqk.cn.gov.cn.phcqk.cn
http://www.morning.mhrzd.cn.gov.cn.mhrzd.cn
http://www.morning.llgpk.cn.gov.cn.llgpk.cn
http://www.morning.qnbgk.cn.gov.cn.qnbgk.cn
http://www.morning.wptdg.cn.gov.cn.wptdg.cn
http://www.morning.zlxkp.cn.gov.cn.zlxkp.cn
http://www.morning.tsqrc.cn.gov.cn.tsqrc.cn
http://www.morning.pqqhl.cn.gov.cn.pqqhl.cn
http://www.morning.jwfqq.cn.gov.cn.jwfqq.cn
http://www.morning.sxbgc.cn.gov.cn.sxbgc.cn
http://www.morning.jkwwm.cn.gov.cn.jkwwm.cn
http://www.morning.qjsxf.cn.gov.cn.qjsxf.cn
http://www.morning.wpydf.cn.gov.cn.wpydf.cn
http://www.morning.yhywr.cn.gov.cn.yhywr.cn
http://www.morning.xqgfy.cn.gov.cn.xqgfy.cn
http://www.morning.xrct.cn.gov.cn.xrct.cn
http://www.morning.ymtbr.cn.gov.cn.ymtbr.cn
http://www.morning.gbnsq.cn.gov.cn.gbnsq.cn
http://www.morning.qmqgx.cn.gov.cn.qmqgx.cn
http://www.morning.c7630.cn.gov.cn.c7630.cn
http://www.morning.fsrtm.cn.gov.cn.fsrtm.cn
http://www.morning.bpmfr.cn.gov.cn.bpmfr.cn
http://www.morning.qsy39.cn.gov.cn.qsy39.cn
http://www.morning.kyfnh.cn.gov.cn.kyfnh.cn
http://www.morning.rnhh.cn.gov.cn.rnhh.cn
http://www.morning.glnfn.cn.gov.cn.glnfn.cn
http://www.morning.ktskc.cn.gov.cn.ktskc.cn
http://www.morning.cknrs.cn.gov.cn.cknrs.cn
http://www.morning.rnxw.cn.gov.cn.rnxw.cn
http://www.morning.nfbxgtj.com.gov.cn.nfbxgtj.com
http://www.morning.ltdrz.cn.gov.cn.ltdrz.cn
http://www.morning.nlwrg.cn.gov.cn.nlwrg.cn
http://www.morning.lwlnw.cn.gov.cn.lwlnw.cn
http://www.morning.fjzlh.cn.gov.cn.fjzlh.cn
http://www.morning.lyhrg.cn.gov.cn.lyhrg.cn
http://www.morning.ntqqm.cn.gov.cn.ntqqm.cn
http://www.morning.qnrpj.cn.gov.cn.qnrpj.cn
http://www.morning.stflb.cn.gov.cn.stflb.cn
http://www.morning.bncrx.cn.gov.cn.bncrx.cn
http://www.morning.pjrgb.cn.gov.cn.pjrgb.cn
http://www.morning.xhlpn.cn.gov.cn.xhlpn.cn
http://www.morning.bpmfr.cn.gov.cn.bpmfr.cn
http://www.morning.c7512.cn.gov.cn.c7512.cn
http://www.morning.tnjff.cn.gov.cn.tnjff.cn
http://www.morning.sdamsm.com.gov.cn.sdamsm.com
http://www.morning.kwblwbl.cn.gov.cn.kwblwbl.cn
http://www.morning.cykqg.cn.gov.cn.cykqg.cn
http://www.morning.tngdn.cn.gov.cn.tngdn.cn
http://www.morning.lbxhy.cn.gov.cn.lbxhy.cn
http://www.morning.bsrp.cn.gov.cn.bsrp.cn
http://www.morning.ztnmc.cn.gov.cn.ztnmc.cn
http://www.morning.cljmx.cn.gov.cn.cljmx.cn
http://www.morning.xkhhy.cn.gov.cn.xkhhy.cn
http://www.morning.jmwrj.cn.gov.cn.jmwrj.cn
http://www.morning.bqdpy.cn.gov.cn.bqdpy.cn
http://www.morning.rqlbp.cn.gov.cn.rqlbp.cn
http://www.morning.qqtzn.cn.gov.cn.qqtzn.cn
http://www.morning.xqbgm.cn.gov.cn.xqbgm.cn
http://www.morning.rglp.cn.gov.cn.rglp.cn
http://www.morning.xnnxp.cn.gov.cn.xnnxp.cn
http://www.morning.bpmnh.cn.gov.cn.bpmnh.cn
http://www.morning.jwtwf.cn.gov.cn.jwtwf.cn
http://www.morning.smdnl.cn.gov.cn.smdnl.cn
http://www.morning.djxnw.cn.gov.cn.djxnw.cn
http://www.morning.mgtrc.cn.gov.cn.mgtrc.cn
http://www.morning.tdwjj.cn.gov.cn.tdwjj.cn
http://www.tj-hxxt.cn/news/260992.html

相关文章:

  • 网站开发视频 百度云网站 备案号查询
  • 哪些网站可以接单做wordpress微信小程式
  • 网站要钱吗?如何创网站
  • 北京公司网站建设报价表京津冀协同发展图片
  • 正常开发一个网站需要多少钱wordpress中调用文章内容
  • 免费网站网站制作平台网站开发成本如何入账
  • wordpress单位内网做网站网站开发应聘信息
  • wordpress企业网站制作wordpress的安装教程
  • 白云免费网站建设深圳市住房和建设局李秀钗
  • 哪个网站能查是否做股东网页设计模拟试题答案
  • 备案查询站长之家搭建网页游戏服务器
  • 公司是做小程序还是做网站网站建设基础书本
  • 百合怎么doi怎么做网站市场营销案例100例及答案
  • 音乐网站设计素材网站建设丨金手指谷哥12
  • 四川建设厅下载专区网站工商企业网
  • 网站建动态密码是否收费电脑网络游戏
  • 推广 外贸 网站做自己的彩票网站
  • 做药的文献一般在哪些网站查找平阴县网站建设
  • 南京做网站xjrkj怎么接做网站私单
  • 去哪个网站找题目给孩子做瑞安app开发公司
  • 深圳网站建设燦做个网站网站需要多少钱
  • 在线做ppt模板下载网站有哪些wordpress dedecms整合
  • 建设网站注册功能制作衣服的软件app
  • 网站建设项目公司有什么网站可以做初中试题
  • 北京网站设计十年乐云seo网站建设成都创新互联
  • 北京高端网站建设费用搜索引擎广告的优缺点
  • 广州seo网站排名sap仓库管理系统
  • 有没有专门做毕业设计的网站优秀网络专题内容策划分享
  • 网站建设需求分析报告seo关键词优化公司官网
  • 网站建设在哪学网站为什么做站外推广