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

网站通栏广告设计自己搭建服务器做网站

网站通栏广告设计,自己搭建服务器做网站,工业信息化部网站备查询,网站承建商有哪些【题目来源】https://www.lanqiao.cn/problems/3255/learning/【题目描述】给定按从小到大的顺序排列的数字 1 到 n#xff0c;随后对它们进行 m 次操作#xff0c;每次将一个数字 x 移动到数字 y 之前或之后。请输出完成这 m 次操作后它们的顺序。【输入格式】第一行为两个数…【题目来源】https://www.lanqiao.cn/problems/3255/learning/【题目描述】给定按从小到大的顺序排列的数字 1 到 n随后对它们进行 m 次操作每次将一个数字 x 移动到数字 y 之前或之后。请输出完成这 m 次操作后它们的顺序。【输入格式】第一行为两个数字 n, m表示初始状态为 1 到 n 的从小到大排列后续有 m 次操作。 第二行到第 m1 行每行三个数 x, y, z。当 z0 时将 x 移动到 y 之后当 z1 时将 x 移动到 y 之前。【输出格式】 一行n 个数字中间用空格隔开表示 m 次操作完成后的排列顺序。【输入样例】 5 3 3 1 0 5 2 1 2 1 1【输出样例】 2 1 3 5 4【算法分析】★ 在大多数情况下可以直接使用 C 中的 STL list而不需手写链表。通过这种方式完成的代码通常更简洁。本例代码中将会使用 listint::iterator itfind(ls.begin(),ls.end(),y); 得到 y 的位置。 ★ STL listhttps://cplusplus.com/reference/list/ 1size()Returns the number of elements in the list container. 2empty()Returns whether the list container is empty (i.e. whether its size is 0). 3push_front()Inserts a new element at the beginning of the list, right before its current first element.  4push_back()Adds a new element at the end of the list container, after its current last element.  5pop_front()Removes the first element in the list container, effectively reducing its size by one.  6pop_back()Removes the last element in the list container, effectively reducing the container size by one. 7front()Returns a reference to the first element in the list container. 8back()Returns a reference to the last element in the list container. 9reverse()Reverses the order of the elements in the list container. 10insert()The container is extended by inserting new elements before the element at the specified position. 11erase()Removes from the list container either a single element (position) or a range of elements ([first,last)). 12unique()Notice that an element is only removed from the list container if it compares equal to the element immediately preceding it. Thus, this function is especially useful for sorted lists.【算法代码】 #include bits/stdc.h using namespace std;int main() {int n,m;cinnm;listint ls;for(int i1; in; i) {ls.push_back(i);}while(m--) {int x,y,z;cinxyz;ls.remove(x);listint::iterator itfind(ls.begin(),ls.end(),y);if(z0) ls.insert(it,x);if(z1) ls.insert(it,x);}for(auto i:ls) couti ;coutendl;return 0; }/* in: 5 3 3 1 0 5 2 1 2 1 1out: 2 1 3 5 4 */ 【参考文献】https://blog.csdn.net/mc10141222/article/details/123674677https://cplusplus.com/reference/list/list/
http://www.hkea.cn/news/14516169/

相关文章:

  • 网站制作公司需要什么资质百度广告投放价格表
  • 网站开发技术 下载海外服务器租用平台
  • 做书封面的模板下载网站美食怎么做的小视频网站
  • 怎么做网站的代理商济南比较好的网站建设公司
  • 公司最近想做个网站怎么办wordpress添加主题慢
  • 网站换程序 搜索引擎wordpress 安装 空白
  • 网站容易出现的问题零基础网站建设入门到精通视频教程
  • 个人网站 阿里云洛阳网最新消息
  • 做网站要ftp信息吗php网站忘记后台密码
  • 建网站要大约多少钱触摸网站手机
  • 智能建站服务平台车间管理系统
  • 阿里巴巴国际站怎么网站建设设计了网站首页
  • 企业网站模板包含什么三个字的洋气商标名字
  • 解析网站接口怎么做免费的云服务器哪家好
  • 江都区城乡建设局门户网站软件开发工具03173
  • 网站建设课程设计心得体会做网站宣传有用吗
  • 游戏网站设计论文超全的开源建站系统大全
  • 网站 带数据百一度一下你就知道
  • ·温州公司建设网站沈阳百度seo关键词排名优化软件
  • 潍坊专业网站建设怎么收费网站制作关键
  • 贸易公司网站源码公司做官网要多少钱
  • 织梦网站采集规则杭州建设项目审批网站
  • wordpress站点标题美化ui设计师工作内容怎么写
  • 巴中网站建设网站推广页面设计公司哪家好
  • 网站地图对seo王烨燃
  • 网站设计方案案例分析wordpress修改他人的模板
  • 怎么在网站上打广告求个网站你懂我的意思2021
  • 医院网站建设 不足网站空间需要备案吗
  • 网站源码上传wordpress配置ssl
  • 南京做网站的额旅游门户网站模板下载