Problem p02194 - Generation 2

Orig Description

Zero AND Subsets
Given a multiset of non-negative integers a_1, a_2, ..., a_N.
How many non-empty subsets of this multiset have a bitwise AND value of 0?
Output the answer modulo 10^9+7.
Input
N
a_1 a_2...a_N
Output
Output the answer modulo 10^9+7.
Constraints
1 \leq N \leq 10^5 
0 \leq a_i \leq 2^{20}-1
Input Example
6
8 6 9 1 2 1
Output Example
51

Extracted Specification

Canonicalized Input Description:

An integer N (1 ≤ N ≤ 10^5), representing some quantity or size.
A list of integers A of size N, where each integer is between 0 and 2^20-1.

### Example Input:

```
6
8 6 9 1 2 1
```

### Function Signature:
Write a function f(N, A) that takes in the input.
def f(N: int, A: List[int]):
    '''
    N: an integer
    A: a list of integers
    '''

Test Case Generator

Sure! Here's a test case generator for the problem statement "Zero AND Subsets":

```python
import random

def tcgen():
    N = random.randint(1, 10**5)
    
    A = [random.randint(0, 2**20 - 1) for _ in range(N)]
    
    return N, A

# Example usage
if __name__ == "__main__":
    for _ in range(5):  # Generate 5 test cases
        N, A = tcgen()
        print(N)
        print(" ".join(map(str, A)))
```

This generator will create random test cases with the constraints specified:

1. The number of elements \(N\) is between 1 and \(10^5\).
2. Each element \(a_i\) in the multiset is a non-negative integer between 0 and \(2^{20} - 1\).

You can run this function to generate test cases for the problem "Zero AND Subsets". The output will be a randomly generated value for \(N\) and a list \(A\) of size \(N\) with elements in the specified range.

Extract Arguments

def extract_arguments(fh):
    N = int(fh.readline().strip())
    A = list(map(int, fh.readline().strip().split()))
    return N, A