QOJ.ac

QOJ

Time Limit: 5 s Memory Limit: 512 MB Total points: 100

#6275. 大度一点

Statistics

给一个无向简单图 $G$,请问有多少边集的子集,使得保留这一子集后,每个点的度数 $\geq 2$?

你需要对 $G$ 的若干个导出子图都回答这一问题,答案对 $998244353$ 取模。

输入格式

第一行输入两个正整数 $n,m$。表示图的点数和边数。

接下来 $m$ 行每行输入两个正整数 $u,v$ 表示一条边。

接下来一行输入一个正整数 $q$,表示询问数。

接下来 $q$ 行每行输入一个长为 $n$ 的 01 串,其中第 $i$ 个数为 $1$ 表示 $i\in S$,否则 $i\notin S$,询问 $S$ 这个集合的导出子图。保证 $S$ 非空。

输出格式

输出 $q$ 行每行一个数,表示答案。

样例数据

样例输入

5 8
1 2
2 3
3 4
4 1
1 5
2 5
3 5
4 5
3
11111
01111
11110

样例输出

29
2
1

子任务

对于 $100\%$ 的数据,保证 $1\leq n\leq 19$,$1\leq m\leq \frac{n(n-1)}{2}$,$1\leq q\leq 10^5$。

测试点编号 $n=$ $q=$
$1$ $3$ $1$
$2$ $4$ $1$
$3,4$ $10$ $1$
$5$ $17$ $1$
$6$ $18$ $1$
$7$ $19$ $1$
$8$ $17$
$9$ $18$
$10$ $19$
About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.