原文:[CF938G]Shortest Path Queries

codeforces description 一張無向圖,支持如下三種操作: x y d :加一條連接 x,y ,邊權為 d 的邊。 x y :刪除 x,y 之間的邊。 x y :查詢 x 到 y 的異或最短路,也就是異或和最小的一條路徑。 保證任意時刻圖中無重邊無自環, 且圖連通 。 n,m,q le sol 根據WC 最大XOR和路徑那題的理論,圖中兩點的異或路徑一定是這兩點在某棵生成樹上的路 ...

2018-08-06 21:50 0 840 推薦指數:

查看詳情

cf 938E

哇自閉了。 一樣個毛啊。 和之前見過的幾道感覺很類似啊。 首先一個數如果有貢獻那么在他后面一定有一個大於它的數,並且前面的全比他小,然后我就跑偏了。。。 於是我們先排個序,顯然無影響,我們可以 ...

Sun Feb 03 00:20:00 CST 2019 0 645
[CF1051F]The Shortest Statement

題目大意:給定一張$n$個點$m$條有權邊的無向聯通圖,$q$次詢問兩點間的最短路 $n\le100000$,$m\le100000$,$1\le100000$,$m$-$n\le20$. 首先看 ...

Sat Sep 22 04:00:00 CST 2018 6 340
6-17 Shortest Path [2](25 分)

Write a program to find the weighted shortest distances from any vertex to a given source vertex in a digraph. It is guaranteed that all ...

Tue Oct 31 04:57:00 CST 2017 0 1211
[LeetCode] 1730. Shortest Path to Get Food

You are starving and you want to eat food as quickly as possible. You want to find the shortest path to arrive at any food cell. You are given an m ...

Sun Dec 05 20:39:00 CST 2021 0 1059
CF1254D Tree Queries(樹鏈剖分)

出題人的做法是 \(O(n\sqrt{n\log n})\),結果這場結束后就被狂噴,一群人給出了 \(O(n\sqrt{n})\) 做法,甚至 \(O(n\log n)\) 都出來了…… 首先發現 ...

Sun Nov 24 22:24:00 CST 2019 0 265
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM