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

手机h5网站开发打开百度一下

手机h5网站开发,打开百度一下,如何把自己做的网站发布到网上,公司建设网站方案带修改的莫队 带修改的莫队就是在基础莫队的基础上增加了一维属性,之前只需要维护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://www.yidumall.com/news/86992.html

相关文章:

  • 模拟网站建设软件有哪些seo网络推广公司
  • 新闻类网站备案 100万如何做好营销
  • 男人女人晚上做那事网站百度引流推广怎么收费
  • 如何用wp做企业网站搜索引擎网站推广如何优化
  • 做调查问卷能赚钱的网站实时积分榜
  • 做外贸网站诈骗万能搜索网站
  • 做盗版电影网站教程中国楼市最新消息
  • 怎样低成本做网站推广沈阳专业seo关键词优化
  • 河源市做网站google移动服务应用优化
  • 湖南茶叶网站建设seo优化排名是什么
  • php一个企业网站多钱宁波受欢迎全网seo优化
  • 成都广告公司网站建设写文案接单平台
  • wordpress插件urlseo解释
  • 做一个网站链接怎么做收录网站
  • 磐石市住房和城乡建设局网站app拉新项目一手渠道商
  • 用模板做企业网站东莞网站建设优化技术
  • 正规网站制作价格厦门网站制作
  • 新乡做网站的多吗信息服务平台有哪些
  • w5500做服务器网站深圳百度关键词排名
  • 北京网站设计公司排行榜恶意点击软件有哪些
  • 青岛做网站企业qq群推广拉人
  • 西安外贸网站建设免费建站网站大全
  • 做网站合同模板专门做推广的软文
  • 传奇私服的网站怎么做网站备案查询工信部官网
  • 赤峰做网站开发百度推广助手app下载
  • 腾讯云服务器使用教程seo整站优化新站快速排名
  • 如何查询网站是否备案优化网站排名茂名厂商
  • 神华两学一做网站seo免费培训教程
  • 网站代码如何导入指定关键词排名优化
  • 颍上县城乡住房建设局网站网络推广代运营公司