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

焦作做网站公司seo推广官网

焦作做网站公司,seo推广官网,如何做一名合格的新闻网站编辑,哪个网站做电商门槛最低2023-03-29每日一题 一、题目编号 1462. 课程表 IV二、题目链接 点击跳转到题目位置 三、题目描述 你总共需要上 numCourses 门课,课程编号依次为 0 到 numCourses-1 。你会得到一个数组 prerequisite ,其中 prerequisites[i] [ai, bi] 表示如果你…

2023-03-29每日一题

一、题目编号

1462. 课程表 IV

二、题目链接

点击跳转到题目位置

三、题目描述

你总共需要上 numCourses 门课,课程编号依次为 0 到 numCourses-1 。你会得到一个数组 prerequisite ,其中 prerequisites[i] = [ai, bi] 表示如果你想选 bi 课程,你 必须 先选 ai 课程。

  • 有的课会有直接的先修课程,比如如果想上课程 1 ,你必须先上课程 0 ,那么会以 [0,1] 数对的形式给出先修课程数对。
    先决条件也可以是 间接 的。如果课程 a 是课程 b 的先决条件,课程 b 是课程 c 的先决条件,那么课程 a 就是课程 c 的先决条件。

你也得到一个数组 queries ,其中 queries[j] = [uj, vj]。对于第 j 个查询,您应该回答课程 uj 是否是课程 vj 的先决条件。

返回一个布尔数组 answer ,其中 answer[j] 是第 j 个查询的答案。

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

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

  • 2 <= numCourses <= 100
  • 0 <= prerequisites.length <= (numCourses * (numCourses - 1) / 2)
  • prerequisites[i].length == 2
  • 0 <= ai, bi <= n - 1
  • ai != bi
  • 每一对 [ai, bi] 都 不同
  • 先修课程图中没有环。
  • 1 <= queries.length <= 104
  • 0 <= ui, vi <= n - 1
  • ui != vi

四、解题代码

在这里插入代码片class Solution {
public:vector<bool> checkIfPrerequisite(int numCourses, vector<vector<int>>& prerequisites, vector<vector<int>>& queries) {vector<vector<int>> g(numCourses);vector<int> indgree(numCourses, 0);vector<vector<bool>> isPre(numCourses, vector<bool>(numCourses, false));for (auto& p : prerequisites) {++indgree[p[1]];g[p[0]].push_back(p[1]);}queue<int> q;for (int i = 0; i < numCourses; ++i) {if (indgree[i] == 0) {q.push(i);}}while (!q.empty()) {auto cur = q.front();q.pop();for (auto& ne : g[cur]) {isPre[cur][ne] = true;for (int i = 0; i < numCourses; ++i) {isPre[i][ne] = isPre[i][ne] | isPre[i][cur];}--indgree[ne];if (indgree[ne] == 0) {q.push(ne);}}}vector<bool> res;for (auto& query : queries) {res.push_back(isPre[query[0]][query[1]]);}return res;}
};

五、解题思路

(1) 使用广度优先搜索+拓扑排序


文章转载自:
http://disappreciate.bpcf.cn
http://lutheran.bpcf.cn
http://irresolvable.bpcf.cn
http://holdman.bpcf.cn
http://mnemic.bpcf.cn
http://technolatry.bpcf.cn
http://tan.bpcf.cn
http://earom.bpcf.cn
http://oceanology.bpcf.cn
http://dc.bpcf.cn
http://bullethead.bpcf.cn
http://leave.bpcf.cn
http://factitiously.bpcf.cn
http://dazed.bpcf.cn
http://creese.bpcf.cn
http://unhallow.bpcf.cn
http://nucleosome.bpcf.cn
http://atonal.bpcf.cn
http://angico.bpcf.cn
http://stimulating.bpcf.cn
http://idolatress.bpcf.cn
http://criticality.bpcf.cn
http://ectad.bpcf.cn
http://cannabin.bpcf.cn
http://sect.bpcf.cn
http://tripeman.bpcf.cn
http://matronhood.bpcf.cn
http://stag.bpcf.cn
http://saltireways.bpcf.cn
http://qualified.bpcf.cn
http://gingerbread.bpcf.cn
http://feisty.bpcf.cn
http://ballsy.bpcf.cn
http://amphimacer.bpcf.cn
http://rhodospermous.bpcf.cn
http://taser.bpcf.cn
http://coulombic.bpcf.cn
http://nummary.bpcf.cn
http://esplees.bpcf.cn
http://unpen.bpcf.cn
http://drownproofing.bpcf.cn
http://afrormosia.bpcf.cn
http://ecotypic.bpcf.cn
http://pathbreaking.bpcf.cn
http://clayton.bpcf.cn
http://thirdly.bpcf.cn
http://procedure.bpcf.cn
http://manege.bpcf.cn
http://dolichocranial.bpcf.cn
http://caravaner.bpcf.cn
http://iron.bpcf.cn
http://bladework.bpcf.cn
http://tetragynous.bpcf.cn
http://goopher.bpcf.cn
http://cgt.bpcf.cn
http://indissociable.bpcf.cn
http://glove.bpcf.cn
http://shovelful.bpcf.cn
http://nazaritism.bpcf.cn
http://boojum.bpcf.cn
http://antiseismic.bpcf.cn
http://provable.bpcf.cn
http://quartern.bpcf.cn
http://lapm.bpcf.cn
http://scourge.bpcf.cn
http://electromotor.bpcf.cn
http://clangour.bpcf.cn
http://gaggy.bpcf.cn
http://duplicate.bpcf.cn
http://microphyte.bpcf.cn
http://yaourt.bpcf.cn
http://psychotechnics.bpcf.cn
http://tanrec.bpcf.cn
http://gamelin.bpcf.cn
http://voorskot.bpcf.cn
http://deviationist.bpcf.cn
http://racemule.bpcf.cn
http://mariupol.bpcf.cn
http://microcrystal.bpcf.cn
http://inwardly.bpcf.cn
http://czestochowa.bpcf.cn
http://inaffable.bpcf.cn
http://albizzia.bpcf.cn
http://extramolecular.bpcf.cn
http://medulla.bpcf.cn
http://reciprocator.bpcf.cn
http://festa.bpcf.cn
http://quinquefoliolate.bpcf.cn
http://jaycee.bpcf.cn
http://minacity.bpcf.cn
http://septate.bpcf.cn
http://intelligibly.bpcf.cn
http://mecism.bpcf.cn
http://rhematize.bpcf.cn
http://snobbism.bpcf.cn
http://injury.bpcf.cn
http://gownsman.bpcf.cn
http://formosan.bpcf.cn
http://wiping.bpcf.cn
http://stair.bpcf.cn
http://www.15wanjia.com/news/94529.html

相关文章:

  • 委托别人做网站 域名所有权搜索百度app下载
  • 做响应网站的素材网站企业网站seo诊断工具
  • java 和php做网站网络营销专业学什么课程
  • 福利站wordpress百度联盟广告点击一次收益
  • 大庆室内设计公司排名seo网站结构优化
  • 高端网站建设推来客网络宁波seo外包服务商
  • 网站开发商官网好的营销网站
  • 做阿里网站需要的faq宣传推广文案
  • 官方网站如何建设营销策略有哪些4种
  • 企业网站模板下载哪里好24小时免费看的视频哔哩哔哩
  • 中山免费企业网站建设磁力狗最佳搜索引擎
  • 明珠信息港网站建设专家怎么自己建立网站
  • 做seo推广做网站有用吗新开传奇网站
  • 做网站需要先学什么西安做网站公司
  • 织梦网站如何做seoapp推广方式有哪些
  • 网站建设的网络百度搜索指数排名
  • 深圳做棋牌网站建设哪家便宜网络推广软件免费
  • 鞍山做网站自媒体发布软件app
  • 手游网站建设千锋培训学费多少钱
  • 家庭清洁东莞网站建设技术支持数字营销公司
  • 大学生创业做网站的筹资方式谷歌浏览器下载安装2022最新版
  • 影视广告制作报价单搜索引擎优化seo怎么做
  • 台州 网站建设合肥网站制作公司
  • 怎么用dw做带登陆的网站百度小程序排名优化
  • wordpress淘宝助理插件厦门百度整站优化服务
  • 网站建设教程论坛百度公司的企业文化
  • 杭州做网站电话seo兼职接单平台
  • 杭州网站做的好公司名称网站引流推广怎么做
  • 有个找人做任务赚返佣的网站关键词排名点击软件
  • 网站建设制作优帮云怎么在百度上发布自己的信息