#include<bits/stdc++.h>
#define int long long
using namespace std;
int n,p;
int f[100][100];
signed main()
{
scanf("%d%d",&n,&p);
f[0][0]=1;
int tmp;
for(int i=1;i<=n;i++)
{
scanf("%d",&tmp);
tmp%=2;
f[i][0]=f[i-1][0];f[i][1]=f[i-1][1];
f[i][0^tmp]+=f[i-1][0];
f[i][1^tmp]+=f[i-1][1];
}
printf("%lld\n",f[n][p]);
return 0;
}
./Main.cpp: In function ‘int main()’:
./Main.cpp:8:20: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘long long int*’ [-Wformat=]
scanf("%d%d",&n,&p);
^
./Main.cpp:8:20: warning: format ‘%d’ expects argument of type ‘int*’, but argument 3 has type ‘long long int*’ [-Wformat=]
./Main.cpp:13:18: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘long long int*’ [-Wformat=]
scanf("%d",&tmp);
^
./Main.cpp:8:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&n,&p);
^
./Main.cpp:13:19: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&tmp);
^