时间限制:C/C++/Rust/Pascal 10秒,其他语言20秒 空间限制:C/C++/Rust/Pascal 1024 M,其他语言2048 M 64bit IO Format: %lld
题目描述
Let be a set of integers. Suppose you have a set . You may perform the following operations an arbitrary number of times (including zero times):
Choose such that ;
Remove the -th largest element in .
Find the total number of sets that can be generated through the process. The answer might be enormous, and you should output the desired value modulo .
输入描述:
The first line of input contains an integer ().
The second line of input contains a binary string of length , denoting the set .