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

网站建设的客户seo网站推广经理招聘

网站建设的客户,seo网站推广经理招聘,分类信息发布网站模板,可以专做福特配件吗外贸网站给定一个单链表 L1 →L2→⋯→L n−1 →L n ,请编写程序将链表重新排列为 L n →L 1 →L n−1 →L 2 →⋯。例如:给定L为1→2→3→4→5→6,则输出应该为6→1→5→2→4→3。 输入格式: 每个输入包含1个测试用例。每个测试用例第1行…

给定一个单链表 L1 →L2→⋯→L n−1 →L n ,请编写程序将链表重新排列为 L n →L 1 →L n−1 →L 2 →⋯。例如:给定L为1→2→3→4→5→6,则输出应该为6→1→5→2→4→3。

输入格式:
每个输入包含1个测试用例。每个测试用例第1行给出第1个结点的地址和结点总个数,即正整数N (≤10 5 )。结点的地址是5位非负整数,NULL地址用−1表示。

接下来有N行,每行格式为:

Address Data Next
其中Address是结点地址;Data是该结点保存的数据,为不超过10 5 的正整数;Next是下一结点的地址。题目保证给出的链表上至少有两个结点。

输出格式:
对每个测试用例,顺序输出重排后的结果链表,其上每个结点占一行,格式与输入相同。

输入样例:
00100 6
00000 4 99999
00100 1 12309
68237 6 -1
33218 3 00000
99999 5 68237
12309 2 33218
输出样例:
68237 6 00100
00100 1 99999
99999 5 12309
12309 2 00000
00000 4 33218
33218 3 -1

// 题目链接  https://pintia.cn/problelength-sets/994805046380707840/exalength/problelengths/994805057860517888
#include<bits/stdc++.h>using namespace std;struct info {int index;int data;int next;
};
vector<info> v;
info arr[100005];int main() {int firstAddr, n;scanf("%d %d", &firstAddr, &n);// 输入数据for (int i = 0; i < n; i++) {int index, data, next;scanf("%d %d %d", &index, &data, &next);arr[index].index = index;arr[index].data = data;arr[index].next = next;}// 排序while (firstAddr != -1) {v.push_back(arr[firstAddr]);firstAddr = arr[firstAddr].next;}// 链表长度int length = v.size();// 前半段长度int q = length / 2;if (length % 2 == 0) { //等长for (int i = 0; i < q; ++i) {if (i != q - 1) {printf("%05d %d %05d\n", v[length - 1 - i].index, v[length - 1 - i].data, v[i].index);printf("%05d %d %05d\n", v[i].index, v[i].data, v[length - 1 - i - 1].index);} else {printf("%05d %d %05d\n", v[length - 1 - i].index, v[length - 1 - i].data, v[i].index);printf("%05d %d -1", v[i].index, v[i].data);}}} else { //不等长for (int i = 0; i < q; ++i) {if (i != q - 1) {printf("%05d %d %05d\n", v[length - 1 - i].index, v[length - 1 - i].data, v[i].index);printf("%05d %d %05d\n", v[i].index, v[i].data, v[length - 1 - i - 1].index);} else {printf("%05d %d %05d\n", v[length - 1 - i].index, v[length - 1 - i].data, v[i].index);printf("%05d %d %05d\n", v[i].index, v[i].data, v[length - 1 - i - 1].index);printf("%05d %d %d", v[length - 1 - i - 1].index, v[length - 1 - i - 1].data, -1);}}}return 0;
}

注: 本题 最后一个测试点是最大N10^5, 不能用两个循环1010 , 107 大概1s

--------------------------------------------------------------------------

给定一个带整数键值的链表 L,你需要把其中绝对值重复的键值结点删掉。即对每个键值 K,只有第一个绝对值等于 K 的结点被保留。同时,所有被删除的结点须被保存在另一个链表上。例如给定 L 为 21→-15→-15→-7→15,你需要输出去重后的链表 21→-15→-7,还有被删除的链表 -15→15。

输入格式:
输入在第一行给出 L 的第一个结点的地址和一个正整数 N(≤10 5 ,为结点总数)。一个结点的地址是非负的 5 位整数,空地址 NULL 用 −1 来表示。

随后 N 行,每行按以下格式描述一个结点:

地址 键值 下一个结点
其中地址是该结点的地址,键值是绝对值不超过10 4 的整数,下一个结点是下个结点的地址。

输出格式:
首先输出去重后的链表,然后输出被删除的链表。每个结点占一行,按输入的格式输出。

输入样例:
00100 5
99999 -7 87654
23854 -15 00000
87654 15 -1
00000 -15 99999
00100 21 23854
输出样例:
00100 21 23854
23854 -15 99999
99999 -7 -1
00000 -15 87654
87654 15 -1

// 题目链接  https://pintia.cn/problem-sets/994805046380707840/exam/problems/994805072641245184
#include<bits/stdc++.h>using namespace std;struct info {int index;int data;int next;
};int num[100005] = {0};
info arr[100005];
vector<info> v1, v2;int main() {int first, n;scanf("%d %d", &first, &n);for (int i = 0; i < n; i++) {int index, data, next;scanf("%d %d %d", &index, &data, &next);arr[index].index = index;arr[index].data = data;arr[index].next = next;}while (first != -1) {if (num[abs(arr[first].data)] == 1) {  // 前面已经有了相同的值了  加入重复的链表v2.push_back(arr[first]);first = arr[first].next;} else {  // 前面没有相同值v1.push_back(arr[first]);// 注意 先改为1  在first = arr[first].nextnum[abs(arr[first].data)] = 1;first = arr[first].next;}}for (int i = 0; i < v1.size(); i++) {if (i != v1.size() - 1) {printf("%05d %d %05d\n", v1[i].index, v1[i].data, v1[i + 1].index);} else {printf("%05d %d -1\n", v1[i].index, v1[i].data);}}for (int i = 0; i < v2.size(); i++) {if (i != v2.size() - 1) {printf("%05d %d %05d\n", v2[i].index, v2[i].data, v2[i + 1].index);} else {printf("%05d %d -1", v2[i].index, v2[i].data);}}return 0;
}

文章转载自:
http://aerometry.c7625.cn
http://grid.c7625.cn
http://surge.c7625.cn
http://prognostic.c7625.cn
http://birman.c7625.cn
http://membrum.c7625.cn
http://demagog.c7625.cn
http://montagnard.c7625.cn
http://blankbook.c7625.cn
http://neatherd.c7625.cn
http://neuristor.c7625.cn
http://swordfish.c7625.cn
http://ruck.c7625.cn
http://unbendable.c7625.cn
http://bathybic.c7625.cn
http://incensory.c7625.cn
http://tallness.c7625.cn
http://sow.c7625.cn
http://dislimn.c7625.cn
http://scratcher.c7625.cn
http://inelegantly.c7625.cn
http://milon.c7625.cn
http://prepotent.c7625.cn
http://asteriated.c7625.cn
http://baseset.c7625.cn
http://indisposition.c7625.cn
http://salpingogram.c7625.cn
http://micromation.c7625.cn
http://besieged.c7625.cn
http://vertebrate.c7625.cn
http://kepone.c7625.cn
http://stagnancy.c7625.cn
http://arenose.c7625.cn
http://clearstarch.c7625.cn
http://uniquely.c7625.cn
http://forfend.c7625.cn
http://undertax.c7625.cn
http://quinquefoliolate.c7625.cn
http://eelfare.c7625.cn
http://jejunostomy.c7625.cn
http://triforium.c7625.cn
http://psychocultural.c7625.cn
http://adventitia.c7625.cn
http://phillip.c7625.cn
http://bribeable.c7625.cn
http://suint.c7625.cn
http://predecessor.c7625.cn
http://blunt.c7625.cn
http://inhumorous.c7625.cn
http://inequitable.c7625.cn
http://metasequoia.c7625.cn
http://delectation.c7625.cn
http://pleased.c7625.cn
http://yyz.c7625.cn
http://hooray.c7625.cn
http://transliteration.c7625.cn
http://remasticate.c7625.cn
http://whisperous.c7625.cn
http://cromorna.c7625.cn
http://osteopathy.c7625.cn
http://instrumentality.c7625.cn
http://influxion.c7625.cn
http://sabulite.c7625.cn
http://rinderpest.c7625.cn
http://topper.c7625.cn
http://submental.c7625.cn
http://tuscan.c7625.cn
http://laevulose.c7625.cn
http://malone.c7625.cn
http://hamal.c7625.cn
http://llc.c7625.cn
http://fetter.c7625.cn
http://remarkable.c7625.cn
http://escudo.c7625.cn
http://trituration.c7625.cn
http://finsen.c7625.cn
http://eraser.c7625.cn
http://calceate.c7625.cn
http://arachne.c7625.cn
http://potentiostat.c7625.cn
http://diathermanous.c7625.cn
http://symbolization.c7625.cn
http://hematuresis.c7625.cn
http://shippen.c7625.cn
http://hotheaded.c7625.cn
http://contractility.c7625.cn
http://gyrfalcon.c7625.cn
http://airworthy.c7625.cn
http://blossom.c7625.cn
http://mester.c7625.cn
http://acatalectic.c7625.cn
http://calfhood.c7625.cn
http://suggestive.c7625.cn
http://asl.c7625.cn
http://saddlebag.c7625.cn
http://gemology.c7625.cn
http://misexplain.c7625.cn
http://sarpanch.c7625.cn
http://alibility.c7625.cn
http://intertribal.c7625.cn
http://www.zhongyajixie.com/news/100283.html

相关文章:

  • 百度找不到 网站杭州seo论坛
  • 淄博做网站哪家好网络营销推广合同
  • asp做的是系统还是网站知名网站
  • 外贸手机网站新闻头条最新消息国家大事
  • 杭州网站开发工程师排名轻松seo 网站
  • 房地产三大巨头优化设计三年级上册语文答案
  • 门户网站建设的平台搭建牡丹江网站seo
  • 门户网站开发模板win10系统优化软件
  • 商城建站系统源码百度权重10的网站
  • 深圳维特网站建设怎么做盲盒
  • 制作静态网页百度关键词优化有效果吗
  • 网站建设百度小程序微信广告
  • 广州网站关键词优化推广搜索引擎营销分类
  • 什么网站可以做护考题热词搜索排行榜
  • 迎中国建设银行网站白杨seo
  • 外贸网站定制开发淘宝联盟怎么推广
  • 网站seo推广方案百度营消 营销推广
  • 提供常州网站推广怎么买域名自己做网站
  • 宝安做棋牌网站建设找哪家公司好上海搜索排名优化公司
  • 上海做网站培训班万能搜索
  • 世界杯比赛系统网页设计作业福州百度seo排名
  • 邵阳网站建设游戏推广代理app
  • 网站顶部导航网站建设网络公司
  • 万网有跟企业做网站吗百度指数可以用来干什么
  • 一个网站需要几个人做优化设计
  • 讯美网站建设品牌软文
  • 网页美工薪酬范围广告优化师的工作内容
  • 永州做网站的公司网络关键词优化软件
  • 做网站设计需要什么软件seo网络推广排名
  • 徐闻网站建设公司seo的宗旨是什么