P4334 [COI 2007] Policija

题目描述

To help capture criminals on the run, the police are introducing a new computer system. The area covered by the police contains N cities and E bidirectional roads connecting them. The cities are labelled 1 to N. 为了帮助抓捕逃犯,警方引进了一套新的电脑系统。警察的辖区包含 $N$ 座城市和 $E$ 条双向道路,城市的编号是 $1\sim N$。 The police often want to catch criminals trying to get from one city to another. Inspectors, looking at a map, try to determine where to set up barricades and roadblocks. The new computer system should answer the following two types of queries: 警察常常要抓住那些逃往另一个城市的罪犯。侦查员看着地图,试着确定在哪里设置路障。新的计算机系统要回答以下两种问题: 1. Consider two cities A and B, and a road connecting cities G1 and G2. Can the criminals get from city A to city B if that one road is blocked and the criminals can't use it? 考虑城市 $A$ 和 $B$,以及连接城市 $G_1$ 和 $G_2$ 的道路。罪犯能否在那条路不通的情况下从 $A$ 逃到 $B$? 2. Consider three cities A, B and C. Can the criminals get from city A to city B if the entire city C is cut off and the criminals can't enter that city? 考虑三个城市 $A, B, C$。罪犯能否在无法通过 $C$ 的情况下从 $A$ 逃到 $B$? Write a program that implements the described system. 写一个程序实现上述系统。

输入格式

输出格式

说明/提示

Croatian Olympiad in Informatics 2007 Task 2