原文:[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