fork(2) download
  1. #include <iostream>
  2. #include <cstdio>
  3. using namespace std;
  4.  
  5. int main() {
  6. int n, a, r, b;
  7. const int md=1e9+7;
  8. r=1, b=0;
  9. scanf("%d", &n);
  10. for(int i=0; i<n; i++) {scanf("%d", &a); if(a & 1) b++;}
  11. if(b==0) n++;
  12. for(int i=1; i<n; i++) r<<=1, r%=md;
  13. printf("%d", r-1);
  14. return 0;
  15. }
Success #stdin #stdout 0s 3300KB
stdin
10
16 18 10 13 2 9 17 17 0 19
stdout
511