Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
using namespace std;

typedef __int64 ll;

int main()
{
	int n,p;
	int a;
	ll odd = 0;
	ll even = 0;
	ll er[55];
	er[0] = 1;
	for(int i = 1; i <= 50; i++)
	{
		er[i] = er[i-1]<<1;
	}
	cin>>n>>p;
	for(int i = 0 ; i < n; i++)
	{
		cin>>a;
		if( a & 1 )
			odd++;
		else
			even++;
	}
	ll ans = er[even];
	if( 0 == p)
	{
		if( odd & 1) 
		{
			ans *= er[odd - 1];
		}
		else
		{
			if( odd > 0)
				ans *= er[odd - 1];
		}
	}
	else
	{
		if( 0 == odd)
			ans = 0;
		else
		{
			if( odd & 1)
			{
				ans *= er[odd - 1];
			}
			else
			{
				ans *= er[odd - 1];
			}
		}
	}
	printf("%I64d\n", ans);
	//system("pause");
}

Compiler output:
a.cc:8:9: error: '__int64' does not name a type; did you mean '__int64_t'?
    8 | typedef __int64 ll;
      |         ^~~~~~~
      |         __int64_t
a.cc: In function 'int main()':
a.cc:14:9: error: 'll' was not declared in this scope
   14 |         ll odd = 0;
      |         ^~
a.cc:15:11: error: expected ';' before 'even'
   15 |         ll even = 0;
      |           ^~~~~
      |           ;
a.cc:16:11: error: expected ';' before 'er'
   16 |         ll er[55];
      |           ^~~
      |           ;
a.cc:17:9: error: 'er' was not declared in this scope
   17 |         er[0] = 1;
      |         ^~
a.cc:27:25: error: 'odd' was not declared in this scope
   27 |                         odd++;
      |                         ^~~
a.cc:29:25: error: 'even' was not declared in this scope
   29 |                         even++;
      |                         ^~~~
a.cc:31:11: error: expected ';' before 'ans'
   31 |         ll ans = er[even];
      |           ^~~~
      |           ;
a.cc:34:21: error: 'odd' was not declared in this scope
   34 |                 if( odd & 1)
      |                     ^~~
a.cc:36:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   36 |                         ans *= er[odd - 1];
      |                         ^~~
      |                         abs
a.cc:41:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
   41 |                                 ans *= er[odd - 1];
      |                                 ^~~
      |                                 abs
a.cc:46:26: error: 'odd' was not declared in this scope
   46 |                 if( 0 == odd)
      |                          ^~~
a.cc:47:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   47 |                         ans = 0;
      |                         ^~~
      |                         abs
a.cc:52:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
   52 |                                 ans *= er[odd - 1];
      |                                 ^~~
      |                                 abs
a.cc:56:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
   56 |                                 ans *= er[odd - 1];
      |                                 ^~~
      |                                 abs
a.cc:60:27: error: 'ans' was not declared in this scope; did you mean 'abs'?
   60 |         printf("%I64d\n", ans);
      |                           ^~~
      |                           abs