algorithm/算法/算法思路记录.md

38 lines
996 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 问
1. 机器人上高楼,遇到比自己高的,减去差距,遇到比自己低的,加上差距(可能加到溢出),问,机器人多高能刚好通过大楼?
2. [2551. 将珠子放入背包中 - 力扣LeetCode](https://leetcode.cn/problems/put-marbles-in-bags/)
3. [2127. 参加会议的最多员工数 - 力扣LeetCode](https://leetcode.cn/problems/maximum-employees-to-be-invited-to-a-meeting/)
4. [1489. 找到最小生成树里的关键边和伪关键边 - 力扣LeetCode](https://leetcode.cn/problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree/)
内向基环数
## 答
1. 二分法从最低0开始到最高楼二分测试测试值在0-max之间。
2. 无论怎么分都有第一个和最后一个的和,从头到尾,数字两两求和(在那里分,价值就是这个的和),去最大的几个减去最小的几个。
3. 拓扑排序根据入为0将不是环上的数据删除。