拓扑排序
xuanweiace
一个热爱算法竞赛的弱校ACMer路过。青大本,浙大硕,方向后端开发,菜鸡一枚,奋斗ing...
展开
-
Mr. Kitayuta‘s Technology CodeForces - 505D(并查集+拓扑排序或dfs找环) 题解
题目 Shuseki Kingdom is the world’s leading nation for innovation and technology. There are n cities in the kingdom, numbered from 1 to n. Thanks to Mr. Kitayuta’s research, it has finally become poss...原创 2020-12-15 23:35:33 · 583 阅读 · 1 评论 -
【POJ - 3249】Test for Job(DAG线性求带负权的最长路,dp)
题干: Mr.Dog was fired by his company. In order to support his family, he must find a new job as soon as possible. Nowadays, It's hard to have a job, since there are swelling numbers of the unemployed....原创 2019-07-11 21:48:46 · 284 阅读 · 0 评论 -
【POJ - 2762】Going from u to v or from v to u?(Tarjan缩点,树形dp 或 拓扑排序,欧拉图相关)
题干: In order to make their sons brave, Jiajia and Wind take them to a big cave. The cave has n rooms, and one-way corridors connecting some rooms. Each time, Wind choose two rooms x and y, and ask on...原创 2019-05-06 22:56:33 · 224 阅读 · 0 评论 -
【ZOJ - 3780】Paint the Grid Again(拓扑排序,图论,证明性质)
题干: Leo has a grid withN×Ncells. He wants to paint each cell with a specific color (either black or white). Leo has a magical brush which can paint any row with black color, or any column with w...原创 2019-04-23 22:17:11 · 286 阅读 · 0 评论 -
【牛客 - 551G】CSL的训练计划(二分 + 拓扑排序 + 优化卡常)
题干: 链接:https://ac.nowcoder.com/acm/contest/551/G 来源:牛客网 题目描述 众所周知,CSL 是一个负责的集训队队长。为了让集训队的学弟们训练更加饱和,他根据每个人的能力,提出了 m 个题数要求。假如 CSL 认为 yi比 xi 强,那么如果 xixi 做了 a 题,那 CSL 会要求 yi 需要做至少 a+ri×k,其中 riri 是已知的常...原创 2019-04-01 20:30:50 · 302 阅读 · 0 评论 -
【蓝桥杯官网试题 - 历届试题】发现环(dfs+并查集,或无向图tarjan判环,无向环,或拓扑排序)
题干: 问题描述 小明的实验室有N台电脑,编号1~N。原本这N台电脑之间有N-1条数据链接相连,恰好构成一个树形网络。在树形网络上,任意两台电脑之间有唯一的路径相连。 不过在最近一次维护网络时,管理员误操作使得某两台电脑之间增加了一条数据链接,于是网络中出现了环路。环路上的电脑由于两两之间不再是只有一条路径,使得这些电脑上的数据传输出现了BUG。 为了恢复正常传输。小明需要找到所有...原创 2019-03-13 22:02:11 · 519 阅读 · 0 评论 -
【CodeForces - 1020B】Badge(模拟,图,环)
题干: In Summer Informatics School, if a student doesn't behave well, teachers make a hole in his badge. And today one of the teachers caught a group of nn students doing yet another trick. Let's assu...原创 2019-02-21 11:17:24 · 541 阅读 · 0 评论 -
【牛客 - 330F】Applese 的QQ群(拓扑排序,二分)
题干: Applese 有一个QQ群。在这个群中,大家互相请教问题。如 b 向 a 请教过问题,就把 a 叫做是 b 的"老板"。这样一个群中就会有很多老板。 同时规定:如果 a 是 b 的老板,b 是 c 的老板,那么 a 也是 c 的老板。 为了不破坏群里面和谐交流的氛围,Applese 定了一个群规:不允许出现 a 既是 b 的老板, b 又是 a 的老板。 你需要帮助 Apple...原创 2019-01-29 22:03:05 · 315 阅读 · 0 评论 -
【CodeForces - 214C 】Game (拓扑排序,思维)
题干: Furik and Rubik love playing computer games. Furik has recently found a new game that greatly interested Rubik. The game consists of n parts and to complete each part a player may probably need t...原创 2018-11-01 19:49:44 · 438 阅读 · 0 评论 -
【HDU - 3342】Legal or Not(拓扑排序)
题干: ACM-DIY is a large QQ group where many excellent acmers get together. It is so harmonious that just like a big family. Every day,many "holy cows" like HH, hh, AC, ZT, lcc, BF, Qinz and so on chat...原创 2018-08-01 22:09:04 · 293 阅读 · 0 评论 -
*【CF#510C】Fox And Names (拓扑排序)
题干: Fox Ciel is going to publish a paper on FOCS (Foxes Operated Computer Systems, pronounce: "Fox"). She heard a rumor: the authors list on the paper is always sorted in the lexicographical order. ...原创 2018-08-05 13:53:41 · 285 阅读 · 0 评论 -
【HDU - 1285】确定比赛名次 (拓扑排序)
题干: 有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接获得每个队的比赛成绩,只知道每场比赛的结果,即P1赢P2,用P1,P2表示,排名时P1在P2之前。现在请你编程序确定排名。 Input 输入有若干组,每组中的第一行为二个数N(1<=N<=500),M...原创 2018-07-30 22:05:27 · 251 阅读 · 0 评论
分享