1030 Beautiful Subsequence
Statement
Metadata
- 作者: 曹鹏
- 单位: Google
- 代码长度限制: 16 KB
- 时间限制: 1000 ms
- 内存限制: 64 MB
Given an integer
Input Specification
Each input file contains one test case. For each case, the first line contains 2 positive integers
Output Specification
Output the number of beautiful subsequences of the original sequence. Since the answer might be too large, output the result modulo 1000000007 (
Sample Input
Sample Output
Hint
The beautiful subsequences of the sample input are:
(1) Indices {1, 2}, values {5, 3}
(2) Indices {1, 4}, values {5, 6}
(3) Indices {3, 4}, values {8, 6}
(4) Indices {1, 2, 3}, values {5, 3, 8}
(5) Indices {1, 2, 4}, values {5, 3, 6}
(6) Indices {1, 3, 4}, values {5, 8, 6}
(7) Indices {2, 3, 4}, values {3, 8, 6}
(8) Indices {1, 2, 3, 4}, values {5, 3, 8, 6}