题库练习 Ski Base
← 上一题 下一题 →

A8260 | Ski Base

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

The first line contains two integers $n$ and $m$ ( $2<=n<=10^{5},1<=m<=10^{5}$ ). They represent the number of junctions and the number of roads correspondingly. Then on $m$ lines follows the description of the roads in the order in which they were built. Each road is described by a pair of integers $a_{i}$ and $b_{i}$ ( $1<=a_{i},b_{i}<=n,a_{i}≠b_{i}$ ) — the numbers of the connected junctions. There could be more than one road between a pair of junctions.

输入格式

Print $m$ lines: the $i$ -th line should represent the number of ways to build a ski base after the end of construction of the road number $i$ . The numbers should be printed modulo $1000000009$ ( $10^{9}+9$ ).

输出格式

Let us have 3 junctions and 4 roads between the junctions have already been built (as after building all the roads in the sample): 1 and 3, 2 and 3, 2 roads between junctions 1 and 2. The land lot for the construction will look like this:

![](/uploads/acgo/image/71b7eb71eda9a5d9_06e9be6b94e3.jpeg)The land lot for the construction will look in the following way:

![](/uploads/acgo/image/71b7eb71eda9a5d9_06e9be6b94e3.jpeg)We can choose a subset of roads in three ways:

![](/uploads/acgo/image/35ffbdfd69f7977b_3ee07f95f5e0.jpeg)In the first and the second ways you can choose one path, for example, 1 - 2 - 3 - 1. In the first case you can choose one path 1 - 2 - 1.

输入输出样例

输入 #1
3 4
1 3
2 3
1 2
1 2
输出 #1
0
0
1
3
C++ 编辑器
输入
输出