xtu summer individual 3 F - Opening Portals】的更多相关文章

Opening Portals Time Limit: 2000ms Memory Limit: 262144KB This problem will be judged on CodeForces. Original ID: 196E64-bit integer IO format: %I64d      Java class name: (Any)     Pavel plays a famous computer game. A player is responsible for a wh…
F - Opening Portals Pavel plays a famous computer game. A player is responsible for a whole country and he can travel there freely, complete quests and earn experience. This country has n cities connected by m bidirectional roads of different lengths…
Water Tree Time Limit: 4000ms Memory Limit: 262144KB This problem will be judged on CodeForces. Original ID: 343D64-bit integer IO format: %I64d      Java class name: (Any)   Mad scientist Mike has constructed a rooted tree, which consists of n verti…
Post Office Time Limit: 1000ms Memory Limit: 10000KB This problem will be judged on PKU. Original ID: 116064-bit integer IO format: %lld      Java class name: Main     There is a straight highway with villages alongside the highway. The highway is re…
Opening Portals 我们先考虑如果所有点都是特殊点, 那么就是对整个图求个MST. 想在如果不是所有点是特殊点的话, 我们能不能也 转换成求MST的问题呢? 相当于我们把特殊点扣出来, 然后求出两两之间的最短路, 然后求MST, 但直接这样暴力做 肯定不行. 我们先跑个多元最短路, 找到离 i 最近的特殊点 p[ i ], 并且距离为d[ i ]. 对于每两个特殊点a, b之间的最短路 我们都能找到一条边(u, v, w)对应它, 并且p[ u ]  = a, p[ v ] = b,…
题意:给出一个有\(n\)个结点,\(m\)条边的连通无向图,边有边权,等于经过这条边所需的时间.有\(k\)个点设有传送门.一开始,所有传送门关闭.你从\(1\)号点出发,每当你到达一个有传送门的点,那个传送门就会永久开启.你可以从一个开启的传送门花费\(0\)时间到达另一个开启的传送门.求开启所有传送门所需的最小时间. \(n,m \leq 10^5\) 首先,简化一下题目.当到达第一个传送门点后,因为已经过传送门可以互相传送,所以剩下的时间就是所有传送门点两两之间连权值等于最短路的边建成的…
Dancing Lessons Time Limit: 5000ms Memory Limit: 262144KB This problem will be judged on CodeForces. Original ID: 45C64-bit integer IO format: %I64d      Java class name: (Any)   There are n people taking dancing lessons. Every person is characterize…
B. Infinite Maze time limit per test  2 seconds memory limit per test  256 megabytes input standard input output  standard output We've got a rectangular n × m-cell maze. Each cell is either passable, or is a wall (impassable). A little boy found the…
Double Profiles Time Limit: 3000ms Memory Limit: 262144KB This problem will be judged on CodeForces. Original ID: 154C64-bit integer IO format: %I64d      Java class name: (Any)   You have been offered a job in a company developing a large social net…
Hometask Time Limit: 2000ms Memory Limit: 262144KB This problem will be judged on CodeForces. Original ID: 154A64-bit integer IO format: %I64d      Java class name: (Any)   Sergey attends lessons of the N-ish language. Each lesson he receives a homet…