#P10718. 【MX-X1-T6】「KDOI-05」简单的图上问题

    ID: 12126 远端评测题 3000ms 512MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>图论计算几何平衡树O2优化平面图平面图欧拉公式梦熊比赛

【MX-X1-T6】「KDOI-05」简单的图上问题

Background

Original link: https://oier.team/problems/X1F

Problem Description

You are given an edge-biconnected graph with nn vertices and mm edges, and the coordinates of each vertex are given. It is guaranteed that any two edges do not intersect, or only overlap at their endpoints.

You are given kk simple cycles on the graph C1,C2,,CkC_1,C_2,\dots,C_k. Define GiG_i as the graph consisting of only the vertices and edges inside CiC_i.

For S{1,2,,k},S={s1,s2,,st}S\subseteq\{1,2,\dots,k\},S=\{s_1,s_2,\dots,s_t\}, define f(S)f(S) as the number of connected components in the intersection of all GsiG_{s_i}.

There are qq queries. Each time you are given a zz, output S{1,2,,k},S=zf(S)\sum_{S\subseteq\{1,2,\dots,k\},|S|=z}f(S). Take the result modulo 998244353998244353.

Input Format

The first line contains three positive integers n,m,kn,m,k.

The next nn lines each contain two integers (xi,yi)(x_i,y_i), representing the coordinates of the ii-th vertex. It is guaranteed that for all 1i<jn1\leq i<j\leq n, both xixjx_i\neq x_j and yiyjy_i\neq y_j hold.

The next mm lines each contain two positive integers ui,viu_i,v_i, representing an undirected edge connecting (ui,vi)(u_i,v_i).

The next kk lines: the first positive integer on each line is lil_i, the size of the cycle, followed by lil_i positive integers Ci,1,Ci,2,,Ci,liC_{i,1},C_{i,2},\dots,C_{i,l_i} describing a simple cycle in the original graph. It is guaranteed that connecting Ci,jC_{i,j} in order forms a cycle in the original graph.

Then one line contains one positive integer qq.

The last qq lines each contain one positive integer, the query value ziz_i.

Output Format

Output qq lines. Each line contains one integer, the value of S{1,2,,k},S=zf(S)\sum_{S\subseteq\{1,2,\dots,k\},|S|=z}f(S) modulo 998244353998244353.

4 5 3
1 1
3 2
2 3
4 4
1 2
1 3
1 4
2 4
3 4
3 1 2 4
3 1 3 4
4 1 2 4 3
3
1
2
3

3
3
1
8 15 5
4 4
5 8
2 7
10 9
1 10
3 5
8 2
7 6
2 1
3 1
3 2
4 1
4 2
5 2
5 3
5 4
6 1
6 3
7 1
7 4
8 1
8 4
8 7
3 1 8 4 
3 1 6 3 
3 7 8 4 
4 8 1 7 4 
3 1 2 3 
5
1
2
3
4
5
5
8
5
1
0

Hint

Sample Explanation #1

The data of sample 11 is shown in the figure:

Constraints

This problem uses bundled testdata.

Subtask ID Score nn\leq Special Property
11 1515 1010 None
22 3030 10001000
33 4×1044\times10^4 It is guaranteed that the planar graph is a triangulation of a convex hull
44 1515 None
55 1010 10510^5

For 100%100\% of the data: 1n,li1051\leq n,\sum l_i\leq10^5, 1m3n61\leq m\leq 3n-6, 3li3\leq l_i, 0xi,yi1090\leq |x_i|,|y_i|\leq 10^9, 1q201\leq q\leq 20, 1ui,vin1\leq u_i,v_i\leq n, uiviu_i\neq v_i, 1zik1\leq z_i\leq k. It is guaranteed that for all 1i<jn1\leq i<j\leq n, both xixjx_i\neq x_j and yiyjy_i\neq y_j hold. It is guaranteed that any two edges do not intersect, or only overlap at their endpoints, and the graph is an edge-biconnected component.

Translated by ChatGPT 5