哇自闭了。 一样个毛啊。 和之前见过的几道感觉很类似啊。 首先一个数如果有贡献那么在他后面一定有一个大于它的数,并且前面的全比他小,然后我就跑偏了。。。 于是我们先排个序,显然无影响,我们可以 ...
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 推荐指数:
哇自闭了。 一样个毛啊。 和之前见过的几道感觉很类似啊。 首先一个数如果有贡献那么在他后面一定有一个大于它的数,并且前面的全比他小,然后我就跑偏了。。。 于是我们先排个序,显然无影响,我们可以 ...
题目大意:给定一张$n$个点$m$条有权边的无向联通图,$q$次询问两点间的最短路 $n\le100000$,$m\le100000$,$1\le100000$,$m$-$n\le20$. 首先看 ...
题目如下: In an N by N square grid, each cell is either empty (0) or blocked (1). A clear path from top-left to bottom-right has length k ...
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 ...
DP: Initially I think of 1D DP, dp[i] stands for the shortest string of first i characters, then: dp[i] = minLen{dp[k] + encode(substring ...
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 ...
出题人的做法是 \(O(n\sqrt{n\log n})\),结果这场结束后就被狂喷,一群人给出了 \(O(n\sqrt{n})\) 做法,甚至 \(O(n\log n)\) 都出来了…… 首先发现 ...
The Shortest Path in Nya Graph Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 37 ...