摘要: 题目传送门: 解题思路: 正着搞好像有点恶心。 反着搞。 一边删一边搞,从崩坏的地方开始,入度--。 最后dfs崩坏,更新答案。 注意要把边删掉防止重复崩坏。 代码: 阅读全文
posted @ 2018-10-26 18:08 Unstoppable728 阅读(263) 评论(0) 推荐(0) 编辑
摘要: You are given a weighed undirected connected graph, consisting of nn vertices and mm edges. You are given a weighed undirected connected graph, consis 阅读全文
posted @ 2018-10-26 17:55 Unstoppable728 阅读(406) 评论(0) 推荐(0) 编辑
摘要: Imagine that Alice is playing a card game with her friend Bob. They both have exactly 88 cards and there is an integer on each card, ranging from 00 t 阅读全文
posted @ 2018-10-26 17:07 Unstoppable728 阅读(344) 评论(0) 推荐(0) 编辑
摘要: 构造图论总是一种让人身心愉快的方法。 把一种看起来不怎么地的题转化为图论问题总是有满满的成就感。 先看几个栗子: 1.逻辑关系构造: cf1027F. Session in BSU 2同余最短路构造: BZOJ2118: 墨墨的等式 洛谷P3403跳楼机 3.最短路构造: IOIOI卡片占卜(Atc 阅读全文
posted @ 2018-10-26 17:07 Unstoppable728 阅读(206) 评论(0) 推荐(0) 编辑
摘要: Polycarp studies in Berland State University. Soon he will have to take his exam. He has to pass exactly nn exams. Polycarp studies in Berland State U 阅读全文
posted @ 2018-10-26 16:31 Unstoppable728 阅读(297) 评论(0) 推荐(0) 编辑