https://www.luogu.com.cn/problem/P2050 用 上一题 的做法可以拿 60 分,考虑优化。我们发现对于每个厨师,它所被利用的边一定是一组前缀,因此可以贪心每进行一次增广后再动态加入新的边。 #include #include using namespace lastweapon; int main() { #ifndef ONLINE_JUDGE freopen(…
https://www.luogu.com.cn/problem/P2050 用 上一题 的做法可以拿 60 分,考虑优化。我们发现对于每个厨师,它所被利用的边一定是一组前缀,因此可以贪心每进行一次增广后再动态加入新的边。 #include #include using namespace lastweapon; int main() { #ifndef ONLINE_JUDGE freopen(…
讨论
登录后参与讨论
还没有评论,来说第一句吧。