编程介的小学生 2019-01-01 10:06 采纳率: 20.3%
浏览 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
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法