CF623E.Transforming Sequence

NOI/NOI+/CTSC

通过率:0%

时间限制:7.00s

内存限制:256MB

AC君温馨提醒

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

题目描述

Let's define the transformation P of a sequence of integers _a_1, _a_2, ..., a__n as _b_1, _b_2, ..., b__n, where b__i = _a_1 | _a_2 | ... | a__i for all i = 1, 2, ..., n, where | is the bitwise OR operation.

Vasya consequently applies the transformation P to all sequences of length n consisting of integers from 1 to 2_k_ - 1 inclusive. He wants to know how many of these sequences have such property that their transformation is a strictly increasing sequence. Help him to calculate this number modulo 109 + 7.

我们定义整数序列 a1,a2,…,ana_1, a_2, \dots, a_n 的变换 PP 为序列 b1,b2,…,bnb_1, b_2, \dots, b_n,其中对所有 i=1,2,…,ni = 1, 2, \dots, n,有 bi=a1∣a2∣⋯∣aib_i = a_1 \mid a_2 \mid \dots \mid a_i,其中 ∣\mid 表示按位或(bitwise OR)运算。

瓦夏依次将变换 PP 应用于所有长度为 nn、且每个元素均取自 11 到 2k−12^k - 1(含端点)的整数序列。他想知道:在这些序列中,有多少个序列满足其变换结果是一个严格递增序列?请你帮他计算该数目对 109+710^9 + 7 取模的结果。

输入格式

The only line of the input contains two integers n and k (1 ≤ n ≤ 1018, 1 ≤ k ≤ 30 000).

输入仅包含一行,有两个整数 nn 和 kk(1 ≤ n ≤ 10181 ≤ n ≤ 10^{18},1 ≤ k ≤ 30 0001 ≤ k ≤ 30\,000)。

输出格式

Print a single integer — the answer to the problem modulo 109 + 7.

输出一个整数——该问题答案对 109+710^9 + 7 取模的结果。

输入输出样例

  • 输入#1

    1 2

    输出#1

    3
  • 输入#2

    2 3

    输出#2

    30
  • 输入#3

    3 3

    输出#3

    48

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

首页