P10559 [ICPC 2024 Xi'an I] The Last Cumulonimbus Cloud

题目描述

Every April, the city is always shrouded under cumulonimbus clouds. This city is connected by $n$ buildings and $m$ two-way streets. In order to facilitate people's travel, any two buildings can directly or indirectly reach each other through the streets. At the same time, no street connects the same building, and there is at most one street that connects each pair of buildings. The pace of life in this city is very slow because the city layout is not very bulky. Specifically,if we consider this city as an undirected graph $G$ ,it is guaranteed that for any non empty subgraph in this graph,there is at least one building inside it that connects up to 10 streets within the subgraph. The rain is not stopping, and the number of cumulonimbus clouds is constantly increasing. At the beginning, there are $a_i$ cumulonimbus clouds above the $i$ -th building, but in the following $q$ days, one of the following two events will occur every day: - $\text{1 x v}$ $v$ cumulonimbus clouds have been added over the $x$ -th building. - $\text{2 x}$ you need to report how many cumulonimbus clouds are in total over all buildings directly connected to building $x$.

输入格式

输出格式