Codeforces 895 c.square subsets (shaped pressure dp+ linear basis)

Source: Internet
Author: User

Description

Give the number of n n n A1,..., an a 1, ..., a n a_1,..., A_n, ask from the n n n number of a non-empty set so that the product is a total square number of scenarios

Input

The first line an integer n n n represents the number of numbers, followed by the input n n n integer ai (1≤n≤105,1≤ai≤70) a I (1≤n≤10 5, 1≤a i≤70) a_i (1\le n\le 10^5,1\le a_i\le 70 )

Output

Output scheme number, result modulo 109+7 10 9 + 7 10^9+7

Sample Input

4
1 1 1 1

Sample Output

15

Solution1

The number of occurrences of I i i numi n u m i num_i, because the AI a I a_i range is very small, 1 1 1~ 70 70 70 primes only 19 19 19, set it to P1,..., p19 P 1, ..., P p_1, ..., p_{19}, you can use a 19 19 19 bit 01

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.