---
title: "Codeforces Round #103 (Div. 2) D题  SPFA"
author: "coolsooner"
date: "2012-01-19T02:31:00Z"
tags: []
slug: "codeforces-round-103-div-2-d-spfa"
draft: false
lastmod: "2012-01-19T09:17:05Z"
id: 1357524
url: "https://coolsooner.iteye.com/blog/1357524"
---

题意就是求离源点距离为L的点的个数，点可以在节点上，也可以在路上，但是必须都是早源点的最短距离为L

用SPFA求一遍距离，然后扫描一遍点，再扫描一遍边

扫描边得时候注意了，有的边上有1个位置，有的边上有2个位置，并且要去重