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
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
2 votes
Tags:
Medium
Points:30
2 votes
Tags:
MathematicsMediumTreeApproved
Points:30
7 votes
Tags:
MathematicsMedium
Editorial
Login to unlock the editorial