Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int N = 2e5 + 5;
- int MOD = 1e9 +7;
- vector<long long int> pow2(N);
- pow2[0] = 1;
- for(int i=1; i<N; i++)
- (pow2[i] = 2ll*pow2[i-1]) %= MOD;
- int t;
- cin>>t;
- while(t--)
- {
- int n;
- cin>>n;
- vector<int> a(n);
- for(auto &e: a) cin>>e;
- int cntEven = 0;
- for(auto e: a) cntEven += (e%2 == 0);
- cout<<(pow2[cntEven] - (cntEven==n))<<"\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment