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

网站推广必做google引擎入口

网站推广必做,google引擎入口,做饼干的网站,wordpress程序员主题solution 类型判断:插入排序中已排序的部分有序,未排序的和原数组元素相同;否则为归并排序测试点6:对于归并排序的子序列长度,不能简单视为前k个有序则子序列长度就是k 例如该测试用例的归并排序的子序列长度应该为2&…

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

solution

  • 类型判断:插入排序中已排序的部分有序,未排序的和原数组元素相同;否则为归并排序
  • 测试点6:对于归并排序的子序列长度,不能简单视为前k个有序则子序列长度就是k
    例如该测试用例的归并排序的子序列长度应该为2,而非4
8
2 1 3 8 5 2 4 6
1 2 3 8 2 5 4 6
#include<iostream>
#include<algorithm>
using namespace std;
const int maxn = 110;
int pre[maxn], did[maxn];
int main(){int n, cnt = 0, flag = 0, p, t;scanf("%d", &n);for(int i = 0; i < n; i++){scanf("%d", pre + i);}for(int i = 0; i < n; i++){scanf("%d", did + i);}for(p = 0; p < n; p++){if(p == 0) t = did[p];if(did[p] < t) break;t = did[p];cnt++;}for(; p < n; p++){if(did[p] != pre[p]){flag = 1;break;}}if(flag){printf("Merge Sort\n");t = 1;while(t){t = 0;for(int i = 0; i < n / cnt; i++){for(int j = i * cnt; j < (i + 1) * cnt - 1; j++){if(did[j] > did[j + 1]) t = 1;}}if(t) cnt /= 2;}cnt *= 2;for(int i = 0; i < n / cnt; i++){sort(did + i * cnt, did + (i + 1) * cnt);}sort(did + n / cnt * cnt, did + n);}else{printf("Insertion Sort\n");sort(did, did + cnt + 1);}for(int i = 0; i < n; i++){if(i) printf(" ");printf("%d", did[i]);}return 0;
} 
http://www.ds6.com.cn/news/97495.html

相关文章:

  • 静态网站源码新网店怎么免费推广
  • 像美团这种网站怎么做的投资网站建设方案
  • 如何做汽车的创意视频网站营销软文的范文
  • 个人微信网站建设全国最新实时大数据
  • 徐州商城网站建设百度账号申诉中心
  • 直接下载app安装江苏seo
  • 企业微信官方网站网站关键词排名优化客服
  • 做团购网站哪家好些网站联盟推广
  • 比较好的建立站点百度指数资讯指数是指什么
  • 公司官方网站制作能搜任何网站的浏览器
  • 域名新闻网站31省市新增疫情最新消息
  • 网站备案空间备案长沙本地推广
  • 私人架设服务器河北百度竞价优化
  • wordpress手机分享插件下载夫唯老师seo
  • 网站的安全度百度搜索排行榜
  • 做网站框架手机百度账号登录个人中心
  • 西安网上进行公司seo搜索引擎实训心得体会
  • 邢台专业网站建设公司seo技术培训海南
  • 邵阳网站制作网络营销主要特点有哪些
  • 网站中qq跳转怎么做的十堰seo
  • tk免费域名注册网站搜索引擎有哪些网站
  • 福州网站设计哪家做的好seo建设
  • 怎样找家做网站的公司惠州seo优化
  • 视频网站seo怎么做广州百度提升优化
  • 经济师考试时间2023报名时间aso具体优化
  • wordpress dux2.0seo人工智能
  • 网站免费的不用下载seo基础课程
  • 宁波中小企业网站制作百度风云榜小说榜排名
  • 周口做网站哪家好宁波seo公司排名榜
  • 做购票系统网站跨界营销案例