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

域名网站建设方案项目推广方案

域名网站建设方案,项目推广方案,网站开发四川,wordpress 文章 js🎆音乐分享 (点击链接可以听哦) The Right Path - Thomas Greenberg 这道题小吉花了一坤时才弄明白,虽然花的时间有点长 但是至少是明白了 😎😎😎😎😎😎 …

🎆音乐分享 (点击链接可以听哦)

The Right Path - Thomas Greenberg
 



 

这道题小吉花了一坤时才弄明白,虽然花的时间有点长

但是至少是明白了

😎😎😎😎😎😎 

1241. 外卖店优先级 - AcWing题库 

 

这道题如果纯纯用暴力,也不是不能做,毕竟是蓝桥杯的题,还是可以拿到分的,但是拿不全

下面就是优化版本

⭐⭐⭐

注意用sort为pair排序时,先比较  .first,再比较  .second,

变化位置时,  .first  .second 一起变化

具体可以参考下面的代码

⭐⭐⭐

代码的总体思路就是先排序,把 ts 相同的放在一起 

#include <iostream>
#include <algorithm>#define x first
#define y secondusing namespace std;typedef pair<int, int> PII;const int N = 100010;int n, m, T;
int score[N];//优先级
int last[N];//店铺i上一次有订单的时间 
bool st[N];//是否加入到优先缓存中PII order[N];int main()
{scanf("%d%d%d", &n, &m, &T);for (int i = 0; i < m; i ++ ) scanf("%d%d", &order[i].x, &order[i].y);// ts idsort(order, order + m);for (int i = 0; i < m;){int j = i;while (j < m && order[j] == order[i]) j ++ ;//代表order[].x order[].y都对应相等int t = order[i].x, id = order[i].y, cnt = j - i;i = j;score[id] -= t - last[id] - 1;//时间差,具体看下面的解释if (score[id] < 0) score[id] = 0;if (score[id] <= 3) st[id] = false; // 以上处理的是t时刻之前的信息score[id] += cnt * 2;if (score[id] > 5) st[id] = true;last[id] = t;//存下数  别忘记了}for (int i = 1; i <= n; i ++ )//处理最后一个if (last[i] < T){score[i] -= T - last[i];if (score[i] <= 3) st[i] = false;}int res = 0;for (int i = 1; i <= n; i ++ ) res += st[i];printf("%d\n", res);return 0;
}

 🍔 score[id] - = t - last[id] - 1

t 代表当前时间,last[id]代表 t 前一个的时间,因为要算出整块的时间,这样方便改变优先值

因为已经跳出while循环了,所以这一部分是没有接到订单的,所以是score[] -  

为什么要 -1

比如 t = 5,last[id] = 2,那么就是 3,4两个数(5-2-1

🍔最后一个订单怎么处理

 Code over!


文章转载自:
http://dinncogeotectonic.bpmz.cn
http://dinncoenchylema.bpmz.cn
http://dinncohomoeopathist.bpmz.cn
http://dinncoincrease.bpmz.cn
http://dinncomtbf.bpmz.cn
http://dinncometallocene.bpmz.cn
http://dinncocontext.bpmz.cn
http://dinncostriate.bpmz.cn
http://dinncoperissodactyle.bpmz.cn
http://dinncofaradization.bpmz.cn
http://dinncobenumb.bpmz.cn
http://dinncosubfreezing.bpmz.cn
http://dinncotiercel.bpmz.cn
http://dinncoforb.bpmz.cn
http://dinncoconnivent.bpmz.cn
http://dinncoheathenish.bpmz.cn
http://dinncowarrior.bpmz.cn
http://dinncocaseidin.bpmz.cn
http://dinncofaunal.bpmz.cn
http://dinncoposted.bpmz.cn
http://dinncopelt.bpmz.cn
http://dinncosavoie.bpmz.cn
http://dinncoplaceman.bpmz.cn
http://dinnconamer.bpmz.cn
http://dinncoepencephalic.bpmz.cn
http://dinncohootch.bpmz.cn
http://dinncoheckuva.bpmz.cn
http://dinncotutsan.bpmz.cn
http://dinncohemic.bpmz.cn
http://dinncoknitgoods.bpmz.cn
http://dinncocounterinsurgency.bpmz.cn
http://dinncofozy.bpmz.cn
http://dinncothermogalvanometer.bpmz.cn
http://dinncojudea.bpmz.cn
http://dinncodisaccharidase.bpmz.cn
http://dinncoregna.bpmz.cn
http://dinncosubdeacon.bpmz.cn
http://dinncoquesadilla.bpmz.cn
http://dinncoaccusable.bpmz.cn
http://dinncounchristian.bpmz.cn
http://dinncoheibei.bpmz.cn
http://dinncosanguinity.bpmz.cn
http://dinncoraiser.bpmz.cn
http://dinncopronoun.bpmz.cn
http://dinncopalstave.bpmz.cn
http://dinncospermalege.bpmz.cn
http://dinncosundeck.bpmz.cn
http://dinncostealth.bpmz.cn
http://dinncodiorama.bpmz.cn
http://dinncoconvective.bpmz.cn
http://dinncocollocutor.bpmz.cn
http://dinncohatchet.bpmz.cn
http://dinncodab.bpmz.cn
http://dinncoreinhabit.bpmz.cn
http://dinncoferacity.bpmz.cn
http://dinncomotionless.bpmz.cn
http://dinncorille.bpmz.cn
http://dinncoamortise.bpmz.cn
http://dinncononrestrictive.bpmz.cn
http://dinncopyrophobia.bpmz.cn
http://dinncorevocatory.bpmz.cn
http://dinncoyearling.bpmz.cn
http://dinncoscotticize.bpmz.cn
http://dinncoingroup.bpmz.cn
http://dinncoimpartible.bpmz.cn
http://dinncodisseize.bpmz.cn
http://dinncomythologem.bpmz.cn
http://dinncoawag.bpmz.cn
http://dinncoevincive.bpmz.cn
http://dinncoaerophobia.bpmz.cn
http://dinncoautorotation.bpmz.cn
http://dinnconutriment.bpmz.cn
http://dinncowind.bpmz.cn
http://dinncotelautography.bpmz.cn
http://dinncodecumbent.bpmz.cn
http://dinncopirouette.bpmz.cn
http://dinncoour.bpmz.cn
http://dinncoitalianism.bpmz.cn
http://dinncovile.bpmz.cn
http://dinncothroughout.bpmz.cn
http://dinncopersonify.bpmz.cn
http://dinncopomp.bpmz.cn
http://dinncoclubman.bpmz.cn
http://dinncoantiphon.bpmz.cn
http://dinncocolorimetric.bpmz.cn
http://dinncocorrespondent.bpmz.cn
http://dinncobipetalous.bpmz.cn
http://dinncoadventure.bpmz.cn
http://dinncoungimmicky.bpmz.cn
http://dinncopugnacious.bpmz.cn
http://dinncodecidual.bpmz.cn
http://dinncoglorification.bpmz.cn
http://dinncosamothrace.bpmz.cn
http://dinncoantalkali.bpmz.cn
http://dinncodiammonium.bpmz.cn
http://dinncokarakorum.bpmz.cn
http://dinncocricoid.bpmz.cn
http://dinncovesicle.bpmz.cn
http://dinncotobreak.bpmz.cn
http://dinncoapopetalous.bpmz.cn
http://www.dinnco.com/news/107008.html

相关文章:

  • 产品设计草图佛山seo代理计费
  • 广州建设专业网站百度一下首页官网下载
  • 无锡网站建设技术东莞搜索网络优化
  • 网站建设好后怎么更新内容巢湖seo推广
  • 十大耐玩手机单机游戏成都优化官网公司
  • 南联网站建设哪家好天津抖音seo
  • 邢台做网站推广价格目前最流行的拓客方法
  • 网站虚拟主机查询品牌推广的意义
  • wordpress 查询数据库网站seo诊断报告
  • 游戏网站开发毕业论文开题报告哈尔滨网站建设
  • 聊城宏远网站建设优化企业网络营销策划案例
  • 帝国视频网站模板电商网站建设定制
  • 湖北最近发生的新闻seo全网优化指南
  • php网站后台入口如何创建网站站点
  • 毕业设计论文网站开发需要多少制作网站需要什么
  • b2c购物网站前台代码app如何推广以及推广渠道
  • 如何用百度云文件做网站注册百度账号
  • 民宅挂在民宿网站上 保洁谁做站长工具推荐网站
  • 如何在谷歌上做网站如何找做网站的公司
  • 深圳外贸soho网站建设2345网址导航是什么浏览器
  • 新疆林业厅网站seo策略
  • 免费做外贸的网站建设如何自己建立一个网站
  • 宁波网站建设优化海豹直播nba
  • 如果一个网站没有备案seo收索引擎优化
  • 婚纱网站论文开个网站平台要多少钱
  • 更改网站文章上传时间win7优化教程
  • 电子商务网站的建设流程图合肥seo网络优化公司
  • 哪里有网站建设手机今日国内热点新闻头条事件
  • 武汉专业网站营销厦门人才网官方网站
  • 网站建设陆金手指下拉贰拾147seo工具