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

泉州模板建站源码专业建网站 成都

泉州模板建站源码,专业建网站 成都,微信名字制作软件小程序,百度打广告多少钱一个月【链接】点击打开链接 【题意】 在这里写题意【题解】 贪心。连续一块的p[i]i的话,对答案的贡献就应该为(这个连续块的长度1)/2;长度为1的也正确.(也即两两相邻的互换位置。)【错的次数】 0【反思】 在这了写反思【代码】 #include cstdio #include iostream #… 【链接】点击打开链接 【题意】 在这里写题意 【题解】 贪心。 连续一块的p[i]i的话,对答案的贡献就应该为(这个连续块的长度1)/2; 长度为1的也正确. (也即两两相邻的互换位置。) 【错的次数】 0 【反思】 在这了写反思 【代码】 #include cstdio #include iostream #include algorithm #include cstring #include vector #include map #include queue #include iomanip #include set #include cstdlib #include cmath #include bitset using namespace std; #define lson l,m,rt1 #define rson m1,r,rt1|1 #define LL long long #define rep1(i,a,b) for (int i a;i b;i) #define rep2(i,a,b) for (int i a;i b;i--) #define mp make_pair #define pb emplace_back #define fi first #define se second #define ld long double #define ms(x,y) memset(x,y,sizeof x) #define ri(x) scanf(%d,x) #define rl(x) scanf(%lld,x) #define rs(x) scanf(%s,x) #define rf(x) scnaf(%lf,x) #define oi(x) printf(%d,x) #define ol(x) printf(%lld,x) #define oc putchar( ) #define os(x) printf(x) #define all(x) x.begin(),x.end() #define Open() freopen(F:\\rush.txt,r,stdin) #define Close() ios::sync_with_stdio(0) #define sz(x) ((int) x.size()) #define ld long doubletypedef pairint,int pii; typedef pairLL,LL pll;//mt19937 myrand(time(0)); //int get_rand(int n){return myrand()%n 1;} const int dx[9] {0,1,-1,0,0,-1,-1,1,1}; const int dy[9] {0,0,0,-1,1,-1,1,-1,1}; const double pi acos(-1.0); const int N 1e5;int n,p[N10];int main(){//Open();//Close();ri(n);rep1(i,1,n) ri(p[i]);int ans 0;rep1(i,1,n){if (p[i]!i){continue;}int j i;while (j1n p[j1](j1)){j;}ans(j-i11)/2;i j;}oi(ans);puts();return 0; }转载于:https://www.cnblogs.com/AWCXV/p/7626054.html
http://www.pierceye.com/news/105705/

相关文章:

  • php网站好吗红旗渠建设集团网站
  • 网站建设如何不被忽悠做营销怎样才能吸引客户
  • 代写文章兼职济南公交优化
  • 商城开发网站建立公司网站步骤
  • 查询域名注册网站泰国做网站
  • 网站图片描述怎么写社区类网站有哪些
  • 网站竞争对手的选定一般参考什么标准的网站的推广方案的内容有哪些
  • 把别人的图片拿来做网站wordpress 覆盖原始图片对比效果
  • 江门市建设工程备案网站乌兰浩特网站开发
  • 个人介绍微电影网站模板免费下载一个网站的建设成本
  • 搬瓦工怎么做网站百度小程序开发教程
  • 织梦网站被攻击小型门户网站建设方案
  • 长沙网站托管公司排名静态网站结构如何更新
  • 网站建设 宜宾湖州网站建设培训教程
  • 网站建设脚本什么叫营销型网站
  • 沧州网站建设专业的公司4000-262-seo优化与品牌官网定制
  • 网页游戏推广网站怎么做如何创建平台类网站
  • 十堰英文网站建设学校教育网站模板
  • 学校网页网站模板免费下载微信的微网站
  • 网站开发的解决方案小型行业网站建设维护成本
  • 浏阳市网站建设百度中心人工电话号码
  • 高端外贸网站制作智慧团建网站没有验证码
  • 做网站需要买服务器么网站建设营销外包公司排名
  • 网站建设中要多使用图片258网站建设
  • 做多语言网站教程开网页慢是什么原因
  • 汽车商城网站模板seo公司网站推广
  • 网站备案查询工信部官网网站建设费用推荐网络专业
  • 网站开发费用是研发费用国内做seo最好公司
  • 什么是网站建设公司企业网站后台管理
  • 做网站阿里巴巴好还是百度好柠檬网络科技网站建设