![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spfa
tomjobs
别慌,慌也没用
展开
-
F - Haunted Graveyard Gym - 102470F(负环)
题意:gym上题面有错误,方向有四种。一个方格,4种方向走,有点不能走,有黑洞传送并且改变时间,求起点到终点最短时间。同时判断可不可能时间无限小或者到不了。思路:直接spfa判负环。#include <iostream>#include <string>#include <cstring>#include <cstdio>#include <vector>#include <queue>using namesp原创 2020-10-04 10:22:00 · 157 阅读 · 0 评论 -
2019 ICPC 银川区域赛 Delivery Route(spfa优化,拓扑排序+dijkstra)
Pony is the boss of a courier company. The company needs to deliver packages to nn offices numbered from 11 to nn. Especially, the ss-th office is the transfer station of the courier company.There ar...原创 2020-03-09 23:05:40 · 403 阅读 · 0 评论 -
BZOJ2200. [Usaco2011 Jan]道路和航线(spfa优化,dij)
DescriptionFarmer John正在一个新的销售区域对他的牛奶销售方案进行调查。他想把牛奶送到T个城镇 (1 <= T <= 25,000),编号为1T。这些城镇之间通过R条道路 (1 <= R <= 50,000,编号为1到R) 和P条航线 (1 <= P <= 50,000,编号为1到P) 连接。每条道路i或者航线i连接城镇A_i (1 <...原创 2019-10-22 14:23:07 · 359 阅读 · 1 评论 -
2018北京区域赛A - Jin Yong’s Wukong Ranking List HihoCoder - 1870(判负环)
Jin Yong was the most famous and popular Chinese wuxia (The one who fight bad people by his Wukong i.e. Wushu and Kongfu) novelist who lived in Hong Kong. Between 1955 and 1972, he wrote 14 novels whi...原创 2019-10-13 21:24:39 · 227 阅读 · 0 评论 -
BZOJ1202. [HNOI2005]狡猾的商人(spfa判负环 | 带权并查集)
Description刁姹接到一个任务,为税务部门调查一位商人的账本,看看账本是不是伪造的。账本上记录了n个月以来的收入情况,其中第i 个月的收入额为Ai(i=1,2,3…n-1,n), 。当 Ai大于0时表示这个月盈利Ai 元,当 Ai小于0时表示这个月亏损Ai 元。所谓一段时间内的总收入,就是这段时间内每个月的收入额的总和。 刁姹的任务是秘密进行的,为了调查商人的账本,她只好跑到商人那里打工...原创 2019-10-06 01:08:23 · 207 阅读 · 0 评论