随笔分类 - 题库—UVA
摘要:题意 "题目链接" Sol 神仙题Orz 我们考虑选的边的补集,可以很惊奇的发现,这个补集中的边恰好是原图中的一颗生成树; 并且答案就是所有边权的和减去这个边集中的边的权值; 于是我们只需要求最大生成树就好了; cpp include using namespace std; const int M
阅读全文
摘要:题意 "题目链接" 问从$0$出发能否回到$0$且边权为负 Sol 先用某B姓算法找到负环,再判一下负环上的点能否到$0$ cpp include define chmax(x, y) (x = (x y ? x : y)) define chmin(x, y) (x = (x define MP
阅读全文
摘要:John Doe, a skilled pilot, enjoys traveling. While on vacation, he rents a small plane and starts visiting beautiful places. To save money, John must
阅读全文