摘要:
代碼: 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號