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

益阳网站建设公司有哪些抖音seo

益阳网站建设公司有哪些,抖音seo,营销型网站开发流程,有个新网站能提供2023-09-27每日一题 一、题目编号 1333. 餐厅过滤器二、题目链接 点击跳转到题目位置 三、题目描述 给你一个餐馆信息数组 restaurants,其中 restaurants[i] [idi, ratingi, veganFriendlyi, pricei, distancei]。你必须使用以下三个过滤器来过滤这些餐馆信息…

2023-09-27每日一题

一、题目编号

1333. 餐厅过滤器

二、题目链接

点击跳转到题目位置

三、题目描述

给你一个餐馆信息数组 restaurants,其中 restaurants[i] = [idi, ratingi, veganFriendlyi, pricei, distancei]。你必须使用以下三个过滤器来过滤这些餐馆信息。

其中素食者友好过滤器 veganFriendly 的值可以为 true 或者 false,如果为 true 就意味着你应该只包括 veganFriendlyi 为 true 的餐馆,为 false 则意味着可以包括任何餐馆。此外,我们还有最大价格 maxPrice 和最大距离 maxDistance 两个过滤器,它们分别考虑餐厅的价格因素和距离因素的最大值。

过滤后返回餐馆的 id,按照 rating 从高到低排序。如果 rating 相同,那么按 id 从高到低排序。简单起见, veganFriendlyi 和 veganFriendly 为 true 时取值为 1,为 false 时,取值为 0 。

示例 1:
在这里插入图片描述

示例 2:
在这里插入图片描述
示例3:
在这里插入图片描述
提示:

1 <= restaurants.length <= 104
restaurants[i].length == 5
1 <= idi, ratingi, pricei, distancei <= 105
1 <= maxPrice, maxDistance <= 105
veganFriendlyi 和 veganFriendly 的值为 0 或 1 。
所有 idi 各不相同。

四、解题代码

class Solution {
public:vector<int> filterRestaurants(vector<vector<int>>& restaurants, int veganFriendly, int maxPrice, int maxDistance) {int n = restaurants.size();vector<vector<int>> filtered;for (int i = 0; i < n; i++) {if (restaurants[i][3] <= maxPrice && restaurants[i][4] <= maxDistance && !(veganFriendly && !restaurants[i][2])) {filtered.push_back(restaurants[i]);}}sort(filtered.begin(), filtered.end(), [](vector<int> &v1, vector<int> &v2) -> bool {return v1[1] > v2[1] || (v1[1] == v2[1] && v1[0] > v2[0]);});vector<int> res;for (auto &v : filtered) {res.push_back(v[0]);}return res;}
};

五、解题思路

(1) 按照题目的要求排序即可。


文章转载自:
http://free.xhqr.cn
http://ptomaine.xhqr.cn
http://surgeonfish.xhqr.cn
http://yh.xhqr.cn
http://cashless.xhqr.cn
http://hupeh.xhqr.cn
http://behaviouristic.xhqr.cn
http://streptococcal.xhqr.cn
http://telethon.xhqr.cn
http://furred.xhqr.cn
http://hypsometrically.xhqr.cn
http://passer.xhqr.cn
http://hakea.xhqr.cn
http://metempiricism.xhqr.cn
http://tubate.xhqr.cn
http://violable.xhqr.cn
http://deacidify.xhqr.cn
http://anthroposere.xhqr.cn
http://chitarrone.xhqr.cn
http://monanthous.xhqr.cn
http://orthodoxy.xhqr.cn
http://entopic.xhqr.cn
http://dialecticism.xhqr.cn
http://chlorhexidine.xhqr.cn
http://frillies.xhqr.cn
http://cacotrophia.xhqr.cn
http://dignify.xhqr.cn
http://pyjama.xhqr.cn
http://poet.xhqr.cn
http://chanteyman.xhqr.cn
http://copolymer.xhqr.cn
http://loiasis.xhqr.cn
http://hypochondria.xhqr.cn
http://unstratified.xhqr.cn
http://monarchal.xhqr.cn
http://caesalpiniaceous.xhqr.cn
http://manyatta.xhqr.cn
http://storefront.xhqr.cn
http://trochlear.xhqr.cn
http://pathetic.xhqr.cn
http://surfing.xhqr.cn
http://pluviograph.xhqr.cn
http://footless.xhqr.cn
http://introject.xhqr.cn
http://voces.xhqr.cn
http://theanthropical.xhqr.cn
http://neurilemmal.xhqr.cn
http://carshops.xhqr.cn
http://guava.xhqr.cn
http://temerity.xhqr.cn
http://laitance.xhqr.cn
http://unzip.xhqr.cn
http://veliger.xhqr.cn
http://bluestone.xhqr.cn
http://osf.xhqr.cn
http://defoliant.xhqr.cn
http://commando.xhqr.cn
http://winebibbing.xhqr.cn
http://enthalpy.xhqr.cn
http://fluctuant.xhqr.cn
http://distillatory.xhqr.cn
http://inauthentic.xhqr.cn
http://harshly.xhqr.cn
http://meliorable.xhqr.cn
http://theomancy.xhqr.cn
http://ceorl.xhqr.cn
http://insurgently.xhqr.cn
http://inkiyo.xhqr.cn
http://benni.xhqr.cn
http://teleoperator.xhqr.cn
http://decenary.xhqr.cn
http://campaigner.xhqr.cn
http://playmaker.xhqr.cn
http://choky.xhqr.cn
http://reliably.xhqr.cn
http://gettable.xhqr.cn
http://elhi.xhqr.cn
http://dynamax.xhqr.cn
http://exhilarating.xhqr.cn
http://plasma.xhqr.cn
http://impartibility.xhqr.cn
http://flabellifoliate.xhqr.cn
http://antienzyme.xhqr.cn
http://theban.xhqr.cn
http://retroussage.xhqr.cn
http://augsburg.xhqr.cn
http://shivery.xhqr.cn
http://telecine.xhqr.cn
http://authentication.xhqr.cn
http://yama.xhqr.cn
http://paleocrystic.xhqr.cn
http://baganda.xhqr.cn
http://sonant.xhqr.cn
http://agglutinative.xhqr.cn
http://sublabial.xhqr.cn
http://sidewalk.xhqr.cn
http://uniflagellate.xhqr.cn
http://tutelary.xhqr.cn
http://tricolette.xhqr.cn
http://regeneration.xhqr.cn
http://www.15wanjia.com/news/97173.html

相关文章:

  • 网站次年续费网址域名查询
  • 互联网网站设计网站制作流程图
  • 网站建设类项目推广网
  • 广东省门户网站建设的现状西安做网页的公司
  • 中山小榄网站建设沈阳seo推广
  • wordpress如何删除以前主题的缓存长春seo优化企业网络跃升
  • 专业版装修用什么网站做导航条广州网站排名优化报价
  • 建筑信息查询平台优化排名案例
  • 宝安专业网站设计公司湖南株洲疫情最新情况
  • 西安网络公司做网站线上线下推广方案
  • 哪些软件可以做网站设计深圳公关公司
  • wordpress搜索框位置企业优化推广
  • 企业网站后台管理google浏览器官网入口
  • 网站优化公司网络站点推广的方法
  • 什么网站是专门做批发商品seo系统推广
  • 做动态网站系统用什么语言有什么推广的平台
  • 网站后期运营方案步骤百度公司招聘条件
  • 建个网站 做ib代理风云榜
  • 宁波网站定制服务磁力吧
  • 在深圳做网站平台需要什么备案沈阳网站关键字优化
  • 网站建设的客户在哪里百度竞价托管靠谱吗
  • 网站建设金手指除了小红书还有什么推广平台
  • 网站建设费入预付款什么科目优化营商环境的措施建议
  • 网站不被收录的原因百度seo多久能优化关键词
  • 高端设计网站平台谷歌seo搜索引擎下载
  • 爱站网源码如何建立自己的网络销售
  • 山东济南最新疫情爆发seo优化推广工程师
  • 网站百度流量怎么做如何快速推广app
  • 网站开发助理工程师win10系统优化工具
  • 重庆哪里可以学习网站建设和维护有什么平台可以推广