308408: CF1514B. AND 0, Sum Big
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
AND 0, Sum Big
题意翻译
#### 题目大意: 给定两个正整数 $n$ 和 $k$ ,求有多少个序列满足下列条件: 1. 序列中的所有元素都在 $[0,2^k-1]$ 之间。 2. 它的所有元素的与运算之和为 $0$ 。 3. 它的元素之和是尽可能大的。 答案对 $10^9+7$ 取模。 #### 输入格式: 第一行一个整数 $t$ ($1 \le t \le 10$) 表示数据组数。 每组测试数据包含两个整数 $n$ 和 $k$ ,意义如题面所述。 #### 输出格式: 对于每组数据,输出符合条件的序列对 $10^9+7$ 取模的结果。题目描述
Baby Badawy's first words were "AND 0 SUM BIG", so he decided to solve the following problem. Given two integers $ n $ and $ k $ , count the number of arrays of length $ n $ such that: - all its elements are integers between $ 0 $ and $ 2^k-1 $ (inclusive); - the [bitwise AND](https://en.wikipedia.org/wiki/Bitwise_operation#AND) of all its elements is $ 0 $ ; - the sum of its elements is as large as possible. Since the answer can be very large, print its remainder when divided by $ 10^9+7 $ .输入输出格式
输入格式
The first line contains an integer $ t $ ( $ 1 \le t \le 10 $ ) — the number of test cases you need to solve. Each test case consists of a line containing two integers $ n $ and $ k $ ( $ 1 \le n \le 10^{5} $ , $ 1 \le k \le 20 $ ).
输出格式
For each test case, print the number of arrays satisfying the conditions. Since the answer can be very large, print its remainder when divided by $ 10^9+7 $ .
输入输出样例
输入样例 #1
2
2 2
100000 20
输出样例 #1
4
226732710