Good Sum
Practice
0 (0 votes)
C++
Counting
Math
Special numbers
Combinatorics
Problem
92% Success 352 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code
Bob has an array \(A\) of length \(N\) and he wants to gift Alice a subsequence of this array
But Alice doesn't like a subsequence if the sum of the elements in that subsequence is odd
Find out how many subsequences can Bob gift her modulo \(10^9 + 7\)
Input Format :
The first line contains \(N\), the size of the array
The second line contains \(N\) elements, representing the array \(A\)
Output Format :
Print one integer, the number of possible ways Bob can gift Alice modulo \(10^9 + 7\)
Constraints :
\(1 \leq N \leq 2*10^5 \\ 1 \leq a[i] \leq 10^{15}\)
Note: Use 64-bit integer data type
Submissions
Please login to view your submissions
Similar Problems
Points:30
4 votes
Tags:
Special NumbersMediumTernary searchAlgorithmsSearching algorithmMathematicsCounting
Points:30
2 votes
Tags:
Medium
Points:30
2 votes
Tags:
MathematicsMediumTreeApproved
Editorial