CF848D.Shake It!

省选/NOI-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

A never-ending, fast-changing and dream-like world unfolds, as the secret door opens.

A world is an unordered graph G, in whose vertex set V(G) there are two special vertices s(G) and t(G). An initial world has vertex set {s(G), t(G)} and an edge between them.

A total of n changes took place in an initial world. In each change, a new vertex w is added into V(G), an existing edge (u, v) is chosen, and two edges (u, w) and (v, w) are added into E(G). Note that it's possible that some edges are chosen in more than one change.

It's known that the capacity of the minimum s-t cut of the resulting graph is m, that is, at least m edges need to be removed in order to make s(G) and t(G) disconnected.

Count the number of non-similar worlds that can be built under the constraints, modulo 109 + 7. We define two worlds similar, if they are isomorphic and there is isomorphism in which the s and t vertices are not relabelled. Formally, two worlds G and H are considered similar, if there is a bijection between their vertex sets , such that:

  • f(s(G)) = s(H);
  • f(t(G)) = t(H);
  • Two vertices u and v of G are adjacent in G if and only if f(u) and f(v) are adjacent in H.

一扇秘密之门开启,一个永无止境、瞬息万变、如梦似幻的世界徐徐展开。

一个“世界”是一个无序图 $ G $,其顶点集 $ V(G) $ 中包含两个特殊顶点 $ s(G) $ 和 $ t(G) $。初始世界仅含顶点集 $ {s(G),,t(G)} $,以及它们之间的一条边。

初始世界共经历了 $ n $ 次变化。每次变化中,向 $ V(G) $ 添加一个新顶点 $ w $,选择一条已存在的边 $ (u,,v) $,并在 $ E(G) $ 中加入两条新边 $ (u,,w) $ 和 $ (v,,w) $。注意:同一条边可能在多次变化中被选中。

已知最终图的最小 $ s −- t $ 割的容量为 $ m $,即至少需要删除 $ m $ 条边,才能使 $ s(G) $ 与 $ t(G) $ 不连通。

在给定约束下,求可构造的互不相似的世界个数(对 $ 10^9 + 7 $ 取模)。我们定义两个世界“相似”,当且仅当它们同构,且存在一个保持 $ s $ 和 $ t $ 顶点标签不变的同构映射。形式化地,两个世界 $ G $ 和 $ H $ 被视为相似,当且仅当存在其顶点集之间的一个双射
,满足:

  • $ f(s(G)) = s(H) $;
  • $ f(t(G)) = t(H) $;
  • $ G $ 中两个顶点 $ u $ 和 $ v $ 相邻,当且仅当 $ H $ 中 $ f(u) $ 与 $ f(v) $ 相邻。

输入格式

The first and only line of input contains two space-separated integers n, m (1 ≤ n, m ≤ 50) — the number of operations performed and the minimum cut, respectively.

输入仅有一行,包含两个以空格分隔的整数 nn、mm(1 ≤ n, m ≤ 501 ≤ n, m ≤ 50),分别表示执行的操作次数和最小割。

输出格式

Output one integer — the number of non-similar worlds that can be built, modulo 109 + 7.

输出一个整数——可构建的非相似世界的数量,对 109+710^9 + 7 取模。

输入输出样例

  • 输入#1

    3 2

    输出#1

    6
  • 输入#2

    4 4

    输出#2

    3
  • 输入#3

    7 3

    输出#3

    1196
  • 输入#4

    31 8

    输出#4

    64921457

说明/提示

In the first example, the following 6 worlds are pairwise non-similar and satisfy the constraints, with s(G) marked in green, t(G) marked in blue, and one of their minimum cuts in light blue.

In the second example, the following 3 worlds satisfy the constraints.

在第一个例子中,以下6个世界两两不相似,且均满足约束条件,其中 s(G)s(G) 用绿色标出,t(G)t(G) 用蓝色标出,其一个最小割用浅蓝色标出。

在第二个例子中,以下3个世界满足约束条件。

输入解题思路,AI测评打分。不知道怎么写?

首页