摘要: 最开始的思路想错了: 把所有是负数段的连成一块,发现下一步会走到这些负数区域的时候,就算出来需要差了多少,然后在当前这个正数块停留一段时间。 但有可能我们当前踩着的这一块正数非常小,导致我们要等很长时间,所以正确的贪心应该是: 记录最大值的位置,先不停往后走,当发现结果变为负数的时候,就算出需要在之 阅读全文
posted @ 2024-03-23 00:25 Gold_stein 阅读(4) 评论(0) 推荐(0) 编辑
摘要: MC里面无限水的模型 #include <iostream> #include <stdio.h> #include <algorithm> #include <string> #include <cmath> #define For(i, j, n) for(int i = j ; i <= n 阅读全文
posted @ 2024-03-23 00:19 Gold_stein 阅读(8) 评论(0) 推荐(0) 编辑