编程介的小学生 2019-01-01 10:06 采纳率: 0.2%
浏览 216
已采纳

无环图数据结构方面的计算问题,比较困难一些的用C语言,怎么计算

Problem Description
As we know, Tsuyuri Kumin likes sleeping in Eastest magical day sleep group's summer. But Rikka wants Kumin to play games with her. So she comes up with one problem:

Here is an undirected graph G with n vertices and m edges. Now you need to delete m−n edges and to make sure that the remain graph is connected. Rikka wants you to tell her the number of ways to choose the edges.

Kumin wants to go to sleep, so she asks you to answer this question. Can you help her?

Input
There are at most 100 testcases,and there are no more 5 testcases with n≥10.

For each test case, the first line contains two integers n,m (1≤n≤16,n≤m≤n(n−1)2).

Then m lines follows. Each of them contains two integers ui,vi, meaning that there is an edge between ui and vi. It is guaranteed that the graph doesn't contain self loops or multiple edges.

Output
For each testcase print a single integer - the number of ways to choose the edges. The answer may be very large, so you only need to print the answer modulo 998244353.

Sample Input
4 5
1 2
2 3
3 4
4 1
1 3

Sample Output
5

  • 写回答

1条回答 默认 最新

  • threenewbee 2019-10-04 08:03
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 求京东批量付款能替代天诚
  • ¥15 slaris 系统断电后,重新开机后一直自动重启
  • ¥15 51寻迹小车定点寻迹
  • ¥15 谁能帮我看看这拒稿理由啥意思啊阿啊
  • ¥15 关于vue2中methods使用call修改this指向的问题
  • ¥15 idea自动补全键位冲突
  • ¥15 请教一下写代码,代码好难
  • ¥15 iis10中如何阻止别人网站重定向到我的网站
  • ¥15 滑块验证码移动速度不一致问题
  • ¥15 Utunbu中vscode下cern root工作台中写的程序root的头文件无法包含