摘要:
代码: include include include using namespace std; struct Edge { int u, v, weight; // 重载小于运算符,用于边的排序 bool operator<(const Edge& other) const { return we 阅读全文
posted @ 2025-06-24 16:44
YOLO霖
阅读(6)
评论(0)
推荐(0)
摘要:
代码:#include include include include using namespace std; int main() { int N, M; cin >> N >> M; // 最小堆(优先队列)维护当前最大的M个元素 priority_queue<long long, vecto 阅读全文
posted @ 2025-06-24 16:42
YOLO霖
阅读(4)
评论(0)
推荐(0)
摘要:
代码: include include include using namespace std; int main() { int n; cin >> n; // 存储每个节点的入度 vector<int> inDegree(n + 1, 0); // 邻接表存储图结构 vector<vector< 阅读全文
posted @ 2025-06-24 15:14
YOLO霖
阅读(4)
评论(0)
推荐(0)

浙公网安备 33010602011771号