CF425E.Sereja and Sets

省选/NOI-

通过率:0%

时间限制:1.50s

内存限制:256MB

AC君温馨提醒

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

题目描述

Let's assume that set S consists of m distinct intervals [_l_1, _r_1], [_l_2, _r_2], ..., [l__m, r__m] (1 ≤ l__i ≤ r__i ≤ n; l__i, r__i are integers).

Let's assume that f(S) is the maximum number of intervals that you can choose from the set S, such that every two of them do not intersect. We assume that two intervals, [_l_1, _r_1] and [_l_2, _r_2], intersect if there is an integer x, which meets two inequalities: _l_1 ≤ x ≤ _r_1 and _l_2 ≤ x ≤ _r_2.

Sereja wonders, how many sets S are there, such that f(S) = k? Count this number modulo 1000000007 (109 + 7).

假设集合 SS 由 mm 个互不相同的区间 [l1, r1][l_1,\,r_1], [l2, r2][l_2,\,r_2], …, [lm, rm][l_m,\,r_m] 组成(其中 1 ≤ li ≤ ri ≤ n1 \le l_i \le r_i \le n;li, ril_i,\,r_i 均为整数)。

定义 f(S)f(S) 为:从集合 SS 中最多能选出多少个互不相交的区间。我们称两个区间 [l1, r1][l_1,\,r_1] 与 [l2, r2][l_2,\,r_2] 相交,当且仅当存在某个整数 xx 同时满足不等式 l1 ≤ x ≤ r1l_1 \le x \le r_1 和 l2 ≤ x ≤ r2l_2 \le x \le r_2。

Sereja 想知道:满足 f(S) = kf(S) = k 的集合 SS 共有多少个?答案对 10000000071000000007(即 109 + 710^9 + 7)取模。

输入格式

The first line contains integers n, k (1 ≤ n ≤ 500; 0 ≤ k ≤ 500).

第一行包含整数 nn、kk(1 ≤ n ≤ 5001 ≤ n ≤ 500;0 ≤ k ≤ 5000 ≤ k ≤ 500)。

输出格式

In a single line, print the answer to the problem modulo 1000000007 (109 + 7).

在一行中输出该问题的答案对 1000000007(109+710^9 + 7)取模的结果。

输入输出样例

  • 输入#1

    3 1

    输出#1

    23
  • 输入#2

    3 2

    输出#2

    32
  • 输入#3

    2 0

    输出#3

    1
  • 输入#4

    2 2

    输出#4

    2

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

首页