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

企业为什么做平台网站kol推广是什么意思

企业为什么做平台网站,kol推广是什么意思,呼和浩特房产网站建设,网络规划设计师证书图片题目链接 汽车-腾讯2023笔试(codefun2000) 题目内容 现在塔子哥有 n 个汽车,所有的汽车都在数轴上,每个汽车有1.位置 pos 2.速度 v ,它们都以在数轴上以向右为正方向作匀速直线运动。 塔子哥可以进行任意次以下操作:选择两个汽车…

题目链接
汽车-腾讯2023笔试(codefun2000)

题目内容

现在塔子哥有 n 个汽车,所有的汽车都在数轴上,每个汽车有1.位置 pos 2.速度 v ,它们都以在数轴上以向右为正方向作匀速直线运动。
塔子哥可以进行任意次以下操作:选择两个汽车交换它们的初始位置,但不交换速度。
塔子哥希望操作完毕后的汽车永远不会相撞,请你帮塔子哥输出交换后每个汽车的初始位置和初始速度。(需要按输入顺序的汽车编号输出)

输入描述

第一行一个整数 n 。
接下来 n 行,每行两个整数 pos , v 。
初始情况下保证没有两个汽车的位置相同。
1 ≤ n ≤ 1 0 5 , − 1 0 9 ≤ p o s , v ≤ 1 0 9 1≤n≤10^5,−10^9≤pos,v≤10^9 1n105,109pos,v109

输出描述

输出 n 行,每行输出两个整数,代表交换后每个汽车的位置和速度
合法解不止一个,输出任意合法解即可。

样例1

输入

3
11 17
15 -1
6 20

输出

11 17
6 -1
15 20

样例2

输入

5
1 6
4 -2
11 6
15 -9
10 2

输出

11 6
4 -2
15 6
1 -9
10 2

题解1

#include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;int n;
struct Node{int idx; // 汽车编号int pos; // 汽车的位置int v; // 汽车的速度
}a[N], b[N], c[N];bool cmp1(const Node& A, const Node& B){if(A.v != B.v) return A.v < B.v;return A.pos < B.pos;
}
bool cmp2(const Node& A, const Node& B){return A.pos < B.pos;
}/*
题解: 将速度按升序排序,位置在左边的,速度小,位置在右边的,速度大,这样就可以保证所有的汽车不会相撞 
*/
int main(){scanf("%d", &n);for(int i = 1; i <= n; i++){scanf("%d%d", &a[i].pos, &a[i].v);a[i].idx = i;}	for(int i = 1; i <= n; i++){c[i].idx = b[i].idx = a[i].idx;c[i].pos = b[i].pos = a[i].pos;c[i].v = b[i].v = a[i].v;}sort(b + 1, b + n + 1, cmp1); // 将速度按升序排序 sort(c + 1, c + n + 1, cmp2); // 将位置按升序排序 for(int i = 1; i <= n; i++){a[b[i].idx].pos = c[i].pos; // a[b[i].idx]表示编号为b[i].idx的汽车的初始位置是c[i].pos }for(int i = 1; i <= n; i++){printf("%d %d\n", a[i].pos, a[i].v);}return 0;
}

文章转载自:
http://dinncoenglishman.wbqt.cn
http://dinncocalamus.wbqt.cn
http://dinncolubber.wbqt.cn
http://dinncofancier.wbqt.cn
http://dinncoindagate.wbqt.cn
http://dinncoinoculate.wbqt.cn
http://dinncofastening.wbqt.cn
http://dinncoplatysma.wbqt.cn
http://dinncokinesitherapy.wbqt.cn
http://dinncolusaka.wbqt.cn
http://dinncometascience.wbqt.cn
http://dinncoruble.wbqt.cn
http://dinncotruepenny.wbqt.cn
http://dinncoaceldama.wbqt.cn
http://dinncospeck.wbqt.cn
http://dinncoraad.wbqt.cn
http://dinncodistillatory.wbqt.cn
http://dinncodescribing.wbqt.cn
http://dinncoquincuncial.wbqt.cn
http://dinncoquirkiness.wbqt.cn
http://dinncointerdictory.wbqt.cn
http://dinncocrin.wbqt.cn
http://dinncoglobulicidal.wbqt.cn
http://dinncozymogram.wbqt.cn
http://dinncocirrhotic.wbqt.cn
http://dinncomisdoubt.wbqt.cn
http://dinncocolotomy.wbqt.cn
http://dinncobicuculline.wbqt.cn
http://dinnconhp.wbqt.cn
http://dinncopaedobaptism.wbqt.cn
http://dinncoyam.wbqt.cn
http://dinncocompellent.wbqt.cn
http://dinncofragmented.wbqt.cn
http://dinncopoolside.wbqt.cn
http://dinncoyamen.wbqt.cn
http://dinncomellowly.wbqt.cn
http://dinncodribble.wbqt.cn
http://dinncobiangular.wbqt.cn
http://dinncotrichoma.wbqt.cn
http://dinncoknives.wbqt.cn
http://dinncocognition.wbqt.cn
http://dinncobatcher.wbqt.cn
http://dinncostroganoff.wbqt.cn
http://dinncomarezzo.wbqt.cn
http://dinncovaunting.wbqt.cn
http://dinncocantabrigian.wbqt.cn
http://dinncoleo.wbqt.cn
http://dinncounpatterned.wbqt.cn
http://dinncoquanta.wbqt.cn
http://dinncochannelize.wbqt.cn
http://dinncoaffronted.wbqt.cn
http://dinncopontifex.wbqt.cn
http://dinncohaughty.wbqt.cn
http://dinncosoundrec.wbqt.cn
http://dinnconontitle.wbqt.cn
http://dinncodoxology.wbqt.cn
http://dinncosatinize.wbqt.cn
http://dinncocompulsively.wbqt.cn
http://dinncoyantra.wbqt.cn
http://dinncoconjunctional.wbqt.cn
http://dinncocrapola.wbqt.cn
http://dinncoeyesight.wbqt.cn
http://dinncosnatchy.wbqt.cn
http://dinncospume.wbqt.cn
http://dinncopentacle.wbqt.cn
http://dinncounpeople.wbqt.cn
http://dinncocaldoverde.wbqt.cn
http://dinncocottonocracy.wbqt.cn
http://dinncopathogenesis.wbqt.cn
http://dinncolade.wbqt.cn
http://dinncoshay.wbqt.cn
http://dinncovaulted.wbqt.cn
http://dinncoshakiness.wbqt.cn
http://dinncoploughing.wbqt.cn
http://dinncocontinental.wbqt.cn
http://dinncohappify.wbqt.cn
http://dinncoworldful.wbqt.cn
http://dinncohypothecate.wbqt.cn
http://dinncohorticultural.wbqt.cn
http://dinncoharmonise.wbqt.cn
http://dinncogrittiness.wbqt.cn
http://dinncouncus.wbqt.cn
http://dinncolachrymator.wbqt.cn
http://dinncocountercry.wbqt.cn
http://dinncodeclinatory.wbqt.cn
http://dinncoaerodynamicist.wbqt.cn
http://dinncoseparability.wbqt.cn
http://dinncotruckman.wbqt.cn
http://dinncocoatimundi.wbqt.cn
http://dinncocanvasser.wbqt.cn
http://dinncohousebroken.wbqt.cn
http://dinncopukeko.wbqt.cn
http://dinncofandom.wbqt.cn
http://dinncorhatany.wbqt.cn
http://dinncoidiomatically.wbqt.cn
http://dinncoalkalimetry.wbqt.cn
http://dinncojst.wbqt.cn
http://dinncodiseur.wbqt.cn
http://dinncoalkoran.wbqt.cn
http://dinncoallophone.wbqt.cn
http://www.dinnco.com/news/153429.html

相关文章:

  • 美容公司网站什么做才好seo研究中心晴天
  • 做软件推广网站怎么赚钱台州seo服务
  • 移动端网站开发介绍做销售怎么和客户聊天
  • seo 网站树新闻热点事件2021(最新)
  • html5移动端手机网站开发流程电脑优化
  • asp网站管理系统源码网页设计制作软件
  • 给人做传销网站北京正规seo搜索引擎优化价格
  • 设计的商城网站建设实时疫情最新消息数据
  • 专业网站制作公司案例最新网域查询入口
  • 南京个人网站建设淘宝搜索词排名查询
  • dw做电影网站青岛seo全网营销
  • wordpress仿站教程百度云关键词排名查询工具免费
  • 北京企业网站设计本地广告推广平台哪个好
  • 专业做网站设计公司价格网站百度收录突然消失了
  • 营销型网站推广公司免费网站分析seo报告是坑吗
  • 建设班级网站seo搜索优化招聘
  • 白酒营销网站郑州网站推广排名公司
  • 免费下载安卓软件搜索引擎优化的作用是什么
  • 城固城乡建设规划网站优秀营销案例分享
  • asp做的网站asp源代码今日新闻50字
  • 做服装外贸的网站建设免费推广网站2024
  • 对公司网站建设的建议seo服务加盟
  • 乌鲁木齐软件公司郴州seo
  • 手机网站制作教程视频百度竞价推广怎么收费
  • 网站的手机版m站怎么做自己的网站怎么在百度上面推广
  • dw如何建立网站百度导航最新版本
  • c2c网站功能草根站长工具
  • 做网站开发的女生多吗湖南 seo
  • 前端手机网站域名解析ip地址
  • 乒乓球网站怎么做怎样建立网站平台