criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll quick_pow(ll a, ll b) {
    ll ans = 1;
    while(b) {
        if(b & 1) ans *= a;
        a *= a;
        b >>= 1;
    }
    return ans;
}

int main(void) {
    int n, p;
    while(~scanf("%d%d", &n, &p)) {
        bool flag = 0;
        int cnt1 = 0, cnt2 = 0;
        for(int i = 0; i < n; ++i) {
            int x; scanf("%d", &x);
            if(x & 1) cnt1++;
            else cnt2++;
        }
        if(p) {
            if(cnt1) printf("%lld\n", quick_pow(2, n - 1));
            else puts("0");
        } else {
            printf("%lld\n", cnt1 ? quick_pow(2, n - 1) : quick_pow(2, n)
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:74: error: expected ')' before '}' token
   28 |             printf("%lld\n", cnt1 ? quick_pow(2, n - 1) : quick_pow(2, n)
      |                   ~                                                      ^
      |                                                                          )
   29 |         }
      |         ~
Language: Java

import java.io.*;
import java.util.*;
public class    grand      {
	public static void main(String[] args) 
	{
		InputReader in = new InputReader(System.in);
		PrintWriter w = new PrintWriter(System.out);
		Scanner sc = new Scanner(System.in);
		int n = in.nextInt();
		int p=in.nextInt();
		int arr[] = new int[100001];
		arr=in.nextIntArray(n);
		int flagodd=0;
		for(int i=0;i<n;i++)
		{
			if(arr[i]%2==1)
			{
				flagodd=1;
				break;
			}
		}
		if(flagodd==0)
		{
			if(p==0)
			{
				w.println((int)Math.pow(2, n));
			}
			else
			{
				w.println("0");
			}
		}
		else
		{
			w.println((int)Math.pow(2, (n-1)));
		}
		
		//w.println(n);
		w.close();
	}
	static class InputReader {
		private final InputStream stream;
		private final byte[] buf = new byte[8192];
		private int curChar, snumChars;
		public InputReader(InputStream st) {
			this.stream = st;
		}
		public int read() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
		
		public int nextInt() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
		
		public long nextLong() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
		
		public int[] nextIntArray(int n) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextInt();
			}
			return a;
		}
		
		public String readString() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}
		
		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}
		
		public boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
		
		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
		
	}
	
}

Compiler output:
Main.java:3: error: class grand is public, should be declared in a file named grand.java
public class    grand      {
       ^
1 error
Language: C++

#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;
long long cau[100][100];
int main()
{    int n,m;
      cin>>n>>m;
      long long  J=0;
      long long  O=0;
      memset(cau,0,sizeof(cau));
      int i=0;
      int b;
      while(n--)
      {
            cin>>b;
          if(b%2)
            J++;
          else
            O++;
      }
      memset(cau,0,sizeof(cau));
      cau[0][0]=1；
      for(int i=0;i<=50;i++)
        for(int is=0;is<=i;is++)
      {    
          cau[is][i]=cau[is-1][i-1]+cau[is][i-1];
      }
     long long fd=1;
     for(int i=0;i<O;i++)
     {
         fd=fd*2;
     }
     long long num=0;
      if(m%2)
      {
          for(int i=1;i<=J;i=i+2)
          {    long long t=cau[i][J];
              num=num+(t*fd);
          }
          cout<<num;
      }
      else
      { for(int i=0;i<=J;i=i+2)
          {    long long t=cau[i][J];
              num=num+t*fd;
          }
          cout<<num;

      }
     return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: unable to find numeric literal operator 'operator""\U0000ff1b'
   26 |       cau[0][0]=1；
      |                 ^~~
a.cc:27:28: error: expected ';' before ')' token
   27 |       for(int i=0;i<=50;i++)
      |                            ^
      |                            ;
a.cc:28:22: error: 'is' was not declared in this scope; did you mean 'i'?
   28 |         for(int is=0;is<=i;is++)
      |                      ^~
      |                      i
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    int N, P;
    cin >> N >> P;

    int t, ar[2] = { 0 };
    for( int i = 0; i < N; ++i ){
        cin >> t;
        ++ar[t%2];
    }


    long long int ans = 0;

    if( ar[1] == 0 ){
        if( P == 0 ) ans = pow(2, N);
        else if( P == 1 ) ans = 0;
    } else if( 0 < ar[1] ){
        long long int others = pow(2, N-1);
        for( int i = 0; i < ar[1]; ++i ){
            S = ar[0] + ar[1] - 1;
            if( S%2 == 1 ) ;
            else if( S%2 == 0 ) ;
        }
        ans = others;
    }

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:13: error: 'S' was not declared in this scope
   26 |             S = ar[0] + ar[1] - 1;
      |             ^
Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define MX      54
typedef long long LL;

int a[MX];
int n,p;
LL C[MX][MX];
void getAC()
{
	C[1][0] = C[1][1] = 1LL;
	C[0][0] = C[0][1] = 1LL;
	for(int i = 1;i <= MX;i++)
	{
		C[i][0] = C[i][i] = 1LL;
	}
	for(int i = 2;i <= MX;i++)
	{
		for(int j = 1;j < i;j++)
		C[i][j] = C[i - 1][j] + C[i - 1][j - 1] ;
	}
}
int main()
{
    scanf("%d%d",&n,&p);
    int cnt1 = 0,cnt2 = 0;

    getAC();

    for(int i = 1; i <= n;i++){
        scanf("%d",&a[i]);
        if(a[i]%2==0)
            cnt1++;
        else
            cnt2++;
    }
    LL cnt = 1LL<<cnt1;
    LL ans = 0;
            for(int i = p;i<= cnt2;i++){
                    ans += C[cnt2][i];
        LL res = ans*cnt;
        printf("%lld\n",res);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:2: error: expected '}' at end of input
   46 | }
      |  ^
a.cc:26:1: note: to match this '{'
   26 | {
      | ^
Language: C++

#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <set>
#include <queue>

#define INTFY 10000000

using namespace std;

int N, P;
long long cnt;


long long fct[51];


int main() {
	cin >> N >> P;
	int g = 0, k = 0;

	fct[0] = 1;
	for (int i = 1; i < 51; ++i) {
		fct[i] = fct[i - 1] * 2;
		//printf("fct[%d]:", i);
		//cout << fct[i] << endl;
	}
	fct[0] = 0;

	for (int i = 0; i < N; ++i) {
		int t;
		cin >> t;
		if (t % 2 == 0)
			g++;
		else
			k++;
	}

	if (k == 0)
		P == 0 ? cout << fct[N] << endl : printf("0\n");
	else
		cout << fct[k+g-1] << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:24: error: operands to '?:' have different types 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'int'
   42 |                 P == 0 ? cout << fct[N] << endl : printf("0\n");
      |                 ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,px,y;
int main(){
	cin>>n>>p;
	for(int i=1;i<=n;i++){
		cin>>x;
		if(x&1)y=1;
	}
	if(y)cout<<(1LL<<(n-1));
	else if(p==0)cout<<(1LL<<n);
	else cout<<0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: 'p' was not declared in this scope
    6 |         cin>>n>>p;
      |                 ^
a.cc:8:22: error: 'x' was not declared in this scope
    8 |                 cin>>x;
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int freq[210000];
int balls[210000];
int main(){
	int n, m;
	cin >> n >> m;
	for(int i = 1; i <= n; i++){
		freq[i] = 0;
	}
	for(int i = 0; i < n; i++){
		cin >> balls[i];
		freq[balls[i]]++;
	}
	for(int i = 0; i < m; i++){
		int c, d;
		cin >> c >> d;
		c--;
		freq[balls[c]]--;
		balls[c] = d;
		freq[balls[c]]++;
		int ans = 0;
		int fl[n+1];
		int fr[n+1];
		int f = 0;
		for(int j = 1; j <= n; j++){
			f += freq[j];
			fl[j] = f;
		}
		f = 0;
		for(int j = n; j >= 1; j--){
			f += freq[j];
			fr[j] = f;
		}
		for(int i = 1; i <= n; i++){
			for(int j = i+1; j <= n; j++){
				ans = max(max(0,freq[i]-i)+max(0,freq[j]-j));
		}
		cout << ans << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:42: error: no matching function for call to 'max(int)'
   38 |                                 ans = max(max(0,freq[i]-i)+max(0,freq[j]-j));
      |                                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   template argument deduction/substitution failed:
a.cc:38:42: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   38 |                                 ans = max(max(0,freq[i]-i)+max(0,freq[j]-j));
      |                                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided
a.cc:42:2: error: expected '}' at end of input
   42 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: Java

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    int bagNumber = scan.nextInt();
	    int remainder = scan.nextInt();
	    int[] intArray = new int[bagNumber];
	    int counter = 0;
	    for (int i =0;i<bagNumber;i++){
	    	intArray[i] = scan.nextInt();
	    }
		int mc=1<<bagNumber;  // 全組み合わせ総数
		for(int i=0; i<mc; ++i){
			int ttl=0;
			for(int j=0; j<bagNumber; ++j){
				if(0<(i&1<<j)){
					ttl+=intArray[j];
				}
			}
			if(ttl%2==remainder){
				counter = counter + 1;
			}
			if(i == mc -1) {
				System.out.println(remainder);
			}
		}
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		                   ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C

#include <stdio.h>

long long comb(long long n, long long r){
  static long long c[50][50]={};
  if(r==0 || r==n) return c[n][r] = 1;
  if(r==1 || r==n-1) return c[n][r] = n;
  if(c[n][r] != 0) return c[n][r];
  if(c[n][n-r] != 0) return c[n][r] = c[n][n-r];

  return c[n][r] = comb(n-1, r) + comb(n-1, r-1);
}

int main()
{
  long long i, a, b, ans=0;
  int n, p, t;
  char s[100];

  scanf(" %d %d", &n, &p);

  a=b=0;
  for(i=0; i<n; i++){
    scanf(" %d", &t);
    t%2 ? a++ : b++;
    //printf("[%d (%lld,%lld)] ", t, a, b);
  }

  if(p){
    for(i=1; i<=a; i+=2){
      ans += comb(a, i);
      //printf("comb(%lld,%lld):%lld ", a, i, comb(a, i));
    }
  }else{
    for(I=0; i<=a; i+=2){
      ans += comb(a, i);
      //printf("comb(%lld,%lld):%lld ", a, i, comb(a, i));
    }
  }
  //printf("ans: %lld (%lld, %lld) ", ans, a, b);
  ans *= 1<<b;
  sprintf(s, "%lld", ans);
  puts(s);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:34:9: error: 'I' undeclared (first use in this function)
   34 |     for(I=0; i<=a; i+=2){
      |         ^
main.c:34:9: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

import java.util.Scanner;

public class Biscuits {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    int bagNumber = scan.nextInt();
	    int remainder = scan.nextInt();
	    int[] intArray = new int[bagNumber];
	    int counter = 0;
	    for (int i =0;i<bagNumber;i++){
	    	intArray[i] = scan.nextInt();
	    }
		int mc=1<<bagNumber;  // 全組み合わせ総数
		for(int i=0; i<mc; ++i){
			int ttl=0;
			for(int j=0; j<bagNumber; ++j){
				if(0<(i&1<<j)){
					ttl+=intArray[j];
				}
			}
			if(ttl%2==remainder){
				counter = counter + 1;
			}
			if(i == mc -1) {
				System.out.println(remainder);
			}
		}
	}
}

Compiler output:
Main.java:3: error: class Biscuits is public, should be declared in a file named Biscuits.java
public class Biscuits {
       ^
1 error
Language: C++

#include <bits/stdc++.h>
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define SORTR(v,n) sort(v, v+n, greater<int>());
#define SORTPairSecond(v, n) sort(v, v+n, pairCompareSecond);
#define int long long    // %d=>%lld
#define pb push_back
#define INF 1000000007
#define llINF 1e17
#define EPS 1e-9
#define pi acos(-1)

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> piii;
typedef pair<ll, pll> plll;
bool pairCompareSecond(const pii& firstEl, const pii& secondEl) {
    return firstEl.second > secondEl.second;
}


const int MAX_n = 50;
int n,p,a[MAX_n];
int odd, even;
int ans;
int odd_n,even_n;


int comb(int n, int r) {
    if(n < 0 || r < 0 || n < r) return 0;
    if(!r) return 1;
    return conb(n - 1, r - 1) + conb(n - 1, r);
}

signed main(){

    cin >> n >> p;
    for(int i = 0;i < n;i++){
        cin >> a[i];
        if(a[i]%2 == 0)
            even++;
        else {
            odd++;
        }
    }

    if(p == 0){
        for(int i = 0;i <= odd/2;i++){
            odd_n += comb(odd , i*2);
        }
        even_n = 1 << even;
        cout<< odd_n*even_n<<endl;
    }else{
        for(int i = 0;i <= odd/2;i++){
            odd_n += comb(odd , i*2+1);
        }
        even_n = 1 << even;
        cout<< odd_n*even_n<<endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'long long int comb(long long int, long long int)':
a.cc:35:12: error: 'conb' was not declared in this scope; did you mean 'comb'?
   35 |     return conb(n - 1, r - 1) + conb(n - 1, r);
      |            ^~~~
      |            comb
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

int n, p, a[50], ans = 0;


int saiki(int g, int s) {
  if(g == n) ans += return s % 2 == p ? 1 : 0;
  saiki(g + 1, s + a[g]);
  saiki(g + 1, s);
  return 0;
}


int main() {
  cin >> n >> p;
  rep(i, 0, n) cin >> a[i];
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int saiki(int, int)':
a.cc:21:21: error: expected primary-expression before 'return'
   21 |   if(g == n) ans += return s % 2 == p ? 1 : 0;
      |                     ^~~~~~
Language: C++

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
ll sum;
int a[2],n,p;
ll D[60][60];



ll jiecheng(int x)
{
	ll s=1;
	for(int i=1;i<=x;i++)
	{
		s*=i;
		
	}
	return s;
}

ll C(int n,int m){return jiecheng(n)/jiecheng(m)/jiecheng(n-m);}

int main()
{
	scanf("%d%d",&n,&p);
	for(int i=0;i<n;i++)
	{
		int x;
		scanf("%d",&x);
		a[x%2]++;
	}
	if (!p%2) sum++;
	D[0][1]=a[1];
	D[1][0]=a[0];
	if (p%2 )sum+=a[1];
	else sum+=a[0];
	for(int i=2;i<=n;i++)	
		for(int j=0;j<=i;j++)
		{
			int k=i-j;
			if (j>a[0]||k>a[1])
				continue;
			D[j][k]=C(a[0],j)*C(a[1],k);
			if ((j*0+k*1)%2==p)
			{
				sum+=(ll)D[j][k];
			}
				
		}
		
	for(int i=1;i<=n;i++)
	{
		for(int j=0;j<=i;j++)
		{
			int k=i-j;
			cout<<D[j][k]<<" ";
		}
		cout<<endl;
	}
		
		#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
ll sum;
int a[2],n,p;
ll D[60][60];



ll jiecheng(int x)
{
	ll s=1;
	for(int i=1;i<=x;i++)
	{
		s*=i;
		
	}
	return s;
}

ll C(int n,int m){return jiecheng(n)/jiecheng(m)/jiecheng(n-m);}

int main()
{
	scanf("%d%d",&n,&p);
	for(int i=0;i<n;i++)
	{
		int x;
		scanf("%d",&x);
		a[x%2]++;
	}
	if (!p%2) sum++;
	D[0][1]=a[1];
	D[1][0]=a[0];
	if (p%2 )sum+=a[1];
	else sum+=a[0];
	for(int i=2;i<=n;i++)	
		for(int j=0;j<=i;j++)
		{
			int k=i-j;
			if (j>a[0]||k>a[1])
				continue;
			D[j][k]=C(a[0],j)*C(a[1],k);
			if ((j*0+k*1)%2==p)
			{
				sum+=(ll)D[j][k];
			}
				
		}
		
	for(int i=1;i<=n;i++)
	{
		for(int j=0;j<=i;j++)
		{
			int k=i-j;
			cout<<D[j][k]<<" ";
		}
		cout<<endl;
	}
		
			
	cout<<sum<<endl;
				
	return 0;
}	
	cout<<sum<<endl;
				
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:71:1: error: a function-definition is not allowed here before '{' token
   71 | {
      | ^
a.cc:81:18: error: a function-definition is not allowed here before '{' token
   81 | ll C(int n,int m){return jiecheng(n)/jiecheng(m)/jiecheng(n-m);}
      |                  ^
a.cc:83:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   83 | int main()
      |         ^~
a.cc:83:9: note: remove parentheses to default-initialize a variable
   83 | int main()
      |         ^~
      |         --
a.cc:83:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:84:1: error: a function-definition is not allowed here before '{' token
   84 | {
      | ^
Language: C++

#include <algorithm> 
#include <iostream> 
using namespace std; 
 
int main(){
long long int N,P,a[50],x,y,z,l,m,e,f;
cin>>N>>P;
if(P==0){
for(int i=0;i<N;i++){
       cin>>a[i];
       if(a[i]%2==0){
              x+=1;
}else{
              y+=1;
        } }
for(int j=1;j<=x;j++){
     for(int k=x;k>=j;k=k-1){
             l*=k;
             l=l/(x-k+1);
       }
           m+=l;
}
if(y%2==0){
            for(int c=2;c<=y;c+=2){
                 for(int d=y;d>=c;d-=1){
                        e*=d;
                        e=e/(y-c+1);
                     }
                        f+=e;
          }
    }else{
 for(int c=2;c<=y-1;c+=2){
                 for(int d=y;d>=c;d-=1){
                        e*=d;
                        e=e/(y-c+1);
                     }
                        f+=e;
          }}

cout<<m*f<<endl;
}else{
for(int i=0;i<N;i++){
       if(a[i]%2==0){
              x+=1;
}else{
              y+=1;
        } }
for(int j=1;j<=x;j++){
     for(int k=x;k>=j;k=k-1){
             l*=k;
             l=l/(x-k+1);
       }
           m+=l;
}
if(y%2==1){
            for(int c=1;c<=y;c+=2){
                 for(int d=y;d>=c;d=d-1){
                        e*=d;
                        e=e/(y-c+1);
                     }
                        f+=e;
          }
    }else{
 for(int c=1;c<=y-1;c+=2){
                 for(int d=y;d>=c;d=d-1){
                        e*=d;
                        e=e/(y-c+1);
                     }
                        f+=e;
          }
}
cout<<m*f<<endl;
}
}
 
}

Compiler output:
a.cc:76:1: error: expected declaration before '}' token
   76 | }
      | ^
Language: C++

#include <algorithm> 
#include <iostream> 
using namespace std; 
 
int main(){
long long int N,P,a[50],x,y,z,l,m,e,f;
cin>>N>>P;
if(P==0){
for(int i=0;i<N;i++){
       cin>>a[i];
       if(a[i]%2==0){
              x+=1;
}else{
              y+=1;
        } }
for(int j=1;j<=x;j++){
     for(int k=x;k>=j;k=k-1){
             l*=k;
             l=l/(x-k+1);
       }
           m+=l;
}
if(y%2==0){
            for(int c=2;c<=y;c+=2){
                 for(int d=y;d>=c;d-=1){
                        e*=d;
                        e=e/(y-c+1);
                     }
                        f+=e;
          }
    }else{
 for(int c=2;c<=y-1;c+=2){
                 for(int d=y;d>=c;d-=1){
                        e*=d;
                        e=e/(y-c+1);
                     }
                        f+=e;
          }}

cout<<m*f<<endl;
}else{
       if(a[i]%2==0){
              x+=1;
}else{
              y+=1;
        } 
for(int j=1;j<=x;j++){
     for(int k=x;k>=j;k=k-1){
             l*=k;
             l=l/(x-k+1);
       }
           m+=l;
}
if(y%2==1){
            for(int c=1;c<=y;c+=2){
                 for(int d=y;d>=c;d=d-1){
                        e*=d;
                        e=e/(y-c+1);
                     }
                        f+=e;
          }
    }else{
 for(int c=1;c<=y-1;c+=2){
                 for(int d=y;d>=c;d=d-1){
                        e*=d;
                        e=e/(y-c+1);
                     }
                        f+=e;
          }
}
cout<<m*f<<endl;
}
}
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:13: error: 'i' was not declared in this scope
   42 |        if(a[i]%2==0){
      |             ^
a.cc: At global scope:
a.cc:75:1: error: expected declaration before '}' token
   75 | }
      | ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
long long c(int a,int b) {
	if (b == 0)return 1;
	return a*c(a - 1, b - 1) / b;
}
int main() {
	int n, p; cin >> n >> p;
	long long s0 = 1, s1 = 0;
	for (int i = 0; i < n; i++){
		int a; cin >> a;
		if (a % 2 == 0)s0 *= 2; else s1++;
	}
	long long sum = 0;
	for (int i = p; i <= s1; i += 2)
		sum += c(s1, min(i, s1 - i));
	cout << sum*s0 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:33: error: no matching function for call to 'min(int&, long long int)'
   18 |                 sum += c(s1, min(i, s1 - i));
      |                              ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:18:33: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   18 |                 sum += c(s1, min(i, s1 - i));
      |                              ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:18:33: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   18 |                 sum += c(s1, min(i, s1 - i));
      |                              ~~~^~~~~~~~~~~
Language: C++

#include <algorithm> 
#include <iostream> 
using namespace std; 
 
int main(){
long long int N,P,a[50],x,y,z,l,m,e,f;
cin>>N>>P;
for(int i=0;i<N;i++){
       cin>>a[i];
if(P==0){
       if(a[i]%2==0){
              x+=1;
}else{
              y+=1;
        } 
}
for(int j=1;j<=x;j++){
     for(int k=x;k>=j;k=k-1){
             l*=k;
             l=l/(x-k+1);
       }
           m+=l;
}
if(y%2==0){
            for(int c=2;c<=y;c+=2){
                 for(int d=y;d>=c;d-=1){
                        e*=d;
                        e=e/(y-c+1);
                     }
                        f+=e;
          }
    }else{
 for(int c=2;c<=y-1;c+=2){
                 for(int d=y;d>=c;d-=1){
                        e*=d;
                        e=e/(y-c+1);
                     }
                        f+=e;
          
}
cout<<m*f<<endl;
}else{
       if(a[i]%2==0){
              x+=1;
}else{
              y+=1;
        } 
}
for(int j=1;j<=x;j++){
     for(int k=x;k>=j;k=k-1){
             l*=k;
             l=l/(x-k+1);
       }
           m+=l;
}
if(y%2==1){
            for(int c=1;c<=y;c+=2){
                 for(int d=y;d>=c;d=d-1){
                        e*=d;
                        e=e/(y-c+1);
                     }
                        f+=e;
          }
    }else{
 for(int c=1;c<=y-1;c+=2){
                 for(int d=y;d>=c;d=d-1){
                        e*=d;
                        e=e/(y-c+1);
                     }
                        f+=e;
          }
}
cout<<m*f<<endl;
}

 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:2: error: 'else' without a previous 'if'
   42 | }else{
      |  ^~~~
Language: Java

import java.math.BigInteger;
import java.util.Scanner;

public class Biscuits {
    public static void main(String args[] ) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int P = sc.nextInt();
        int Ec = 0;
        for (int i = 0; i < N; i++) {
            int num = sc.nextInt();
            if(num % 2 == 0)
                Ec++;
        }
        int Oc = N - Ec;
        BigInteger ans = BigInteger.ONE;
        if(P == 1) {
            BigInteger temp = new BigInteger("2").pow(Oc).divide(new BigInteger("2"));
            ans = ans.max(temp);
            if(Oc == 0)
                ans = BigInteger.ZERO;
            temp = ans.multiply(new BigInteger("2").pow(Ec));
            ans = ans.max(temp);
        }
        else {
            BigInteger temp = new BigInteger("2").pow(Oc).divide(new BigInteger("2"));
            ans = ans.max(temp);
            temp = ans.multiply(new BigInteger("2").pow(Ec));
            ans = ans.max(temp);
        }

        System.out.println(ans);
    }
}


Compiler output:
Main.java:4: error: class Biscuits is public, should be declared in a file named Biscuits.java
public class Biscuits {
       ^
1 error
Language: C++

#include <algorithm> 
#include <iostream> 
using namespace std; 

int main(){
long long int N,P,a[50],x,y,z,l,m,e,f;
cin>>N>>P;
for(int i=0;i<N;i++){
       cin>>a[i];
if(P==0){
       if(a[i]%2==0){
              x+=1;
}else{
              y+=1;
        } 
for(int j=1;j<=x;j++){
     for(int k=x;k>=j;k=k-1){
             l*=k;
             l=l/(x-k+1);
       }
           m+=l;
}
if(y%2==0){
            for(int c=2;c<=y;c+=2){
                 for(int d=y;d>=c;d-=1){
                        e*=d;
                        e=e/(y-c+1);
                     }
                        f+=e;
          }
    }else{
 for(int c=2;c<=y-1;c+=2){
                 for(int d=y;d>=c;d-=1){
                        e*=d;
                        e=e/(y-c+1);
                     }
                        f+=e;
          }
}
cout<<m*f<<endl;
}else{
       if(a[i]%2==0){
              x+=1;
}else{
              y+=1;
        } 
for(int j=1;j<=x;j++;){
     for(int k=x;k>=j;k-=){
             l*=k;
             l=l/(x-k+1);
       }
           m+=l;
}
if(y%2==1){
            for(int c=1;c<=y;c+=2){
                 for(int d=y;d>=c;d=d-1){
                        e*=d;
                        e=e/(y-c+1);
                     }
                        f+=e;
          }
    }else{
 for(int c=1;c<=y-1;c+=2){
                 for(int d=y;d>=c;d=d-1){
                        e*=d;
                        e=e/(y-c+1);
                     }
                        f+=e;
          }
}
cout<<m*f<<endl;
}
}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:21: error: expected ')' before ';' token
   47 | for(int j=1;j<=x;j++;){
      |    ~                ^
      |                     )
a.cc:47:22: error: expected primary-expression before ')' token
   47 | for(int j=1;j<=x;j++;){
      |                      ^
Language: C++

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cassert>
#include <complex>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <sstream>
#include <ctime>
#include <cctype>
#include <set>
#include <map>
#include <queue>
#include <bitset>
#include <deque>
#include <stack>
#include <memory.h>
#include <_mingw.h>
using namespace std;
int z=0,o=0,n,p;
int candy[51]; 
long long d2(int x){
	if(x==1){
		return 2;
	}
	if(x==0){
		return 1;
	}
	else{
		if(x%2==0){
			long long a=d2(x/2)*d2(x/2);
			return a;
		}
		else {
			long long a=d2((x-1)/2)*d2((x-1)/2)*2;
		}
	}
}
int main()
{
	long long ans=0;
	cin>>n>>p;
	for(int i=0;i<n;i++){
		cin>>candy[i];
		candy[i]=candy[i]%2;
		if(candy[i]==0)z++;
		else o++;
	}
	n-=1;
	cout<<d2(n);
    return 0;
}

Compiler output:
a.cc:24:10: fatal error: _mingw.h: No such file or directory
   24 | #include <_mingw.h>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <math.h>
#include <algorithm>
#include <set>
#include <deque>
#include <utility>
#include <map>

#define ll long long int
#define MAX 1000000

using namespace std;

ll cnt = 0;
ll a[55];
ll p;

void search(ll sum, ll i) //i番目の合計
{
	if (a[i] == -1) { //終了
		return;
	}

	if ((sum + a[i]) % 2 == p) {
		cnt++;
	}
	search(sum + a[i], i + 1);
	search(sum, i + 1);

}


int main(void)
{
	ll n;

	memset(a, -1, sizeof(a));

	cin >> n >> p;

	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	if (p == 0) {
		cnt++;
	}

	search(0, 0);

	cout << cnt << endl;

	return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:9: error: 'memset' was not declared in this scope
   40 |         memset(a, -1, sizeof(a));
      |         ^~~~~~
a.cc:11:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include <map>
  +++ |+#include <cstring>
   11 |
Language: C++

import java.util.Scanner;

public class Main {
    static Scanner sc = new Scanner(System.in);
    static int N = sc.nextInt();
    static int P = sc.nextInt();
    static int A[] = new int[N];

    public static void main(String[] args) {
        for(int i=0; i < N; i++) {
            A[i] = sc.nextInt();
        }

        int evenCount = 0;
        int oddCount = 0;
        for(int i=0; i < N; i++) {
            if (A[i] % 2 == 0) {
                evenCount ++;
            } else {
                oddCount ++;
            }
        }

        long a = 0;
        for(int i=0; i <= oddCount; i += 2) {
            a += combination(oddCount, i);
        }
        if(oddCount == 0) {
            a = 0;
        }
        long b = (int)Math.pow(2, evenCount);
        long result = b * a;

        System.out.println(result);
    }

    static long combination( int n, int m ) {
        long c = 1;
        m = ( n - m < m ? n - m : m );
        for( int ns = n - m + 1, ms = 1; ms <= m; ns ++, ms ++ ) {
            c *= ns;
            c /= ms;
        }
        return c;
    }
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <math.h>
#include <algorithm>
#include <set>
#include <deque>
#include <utility>
#include <map>

#define ll long long int
#define MAX 1000000

using namespace std;

ll cnt = 0;
ll a[55];
ll p;

void search(ll sum, ll i) //i番目の合計
{
	if (a[i] == -1) { //終了
		return;
	}

	if ((sum + a[i]) % 2 == p) {
		cnt++;
	}
	search(sum + a[i], i + 1);
	search(sum, i + 1);

}


int main(void)
{
	ll n;

	memset(a, -1, sizeof(a));

	cin >> n >> p;

	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	if (p == 0) {
		cnt++;
	}

	search(0, 0);

	cout << cnt << endl;

	return (0);
}




Compiler output:
a.cc: In function 'int main()':
a.cc:40:9: error: 'memset' was not declared in this scope
   40 |         memset(a, -1, sizeof(a));
      |         ^~~~~~
a.cc:11:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include <map>
  +++ |+#include <cstring>
   11 |
Language: C++

#include <iostream>

int main (void) {
  int N, P;
  int A[110];
  std::cin >> N >> P;

  int i;
  int odd = 0;
  int even = 0;
  for (i=0;i<N;i++) {
    std::cin >> A[i];
    if (A[i]%2==1) {
      odd++;
    } else {
      even++;
    }
  }

  // if (P%2==1) {                                                                                    
  //   odd--;                                                                                         
  // }                                                                                                

  long long int ans;
  if (odd==0 && P==1) {
    ans = 0;
  } else {
    ans = 1;
    if (odd>1) {
      for (i=0;i<(odd-1);i++) {
	ans *= 2;
      }
    }
    for (i=0;i<even;i++) {
      ans *= 2;
    }
  }

   std::cout << ans << std::endl;

  return 0;#include <iostream>

int main (void) {
  int N, P;
  int A[110];
  std::cin >> N >> P;

  int i;
  int odd = 0;
  int even = 0;
  for (i=0;i<N;i++) {
    std::cin >> A[i];
    if (A[i]%2==1) {
      odd++;
    } else {
      even++;
    }
  }

  // if (P%2==1) {                                                                                    
  //   odd--;                                                                                         
  // }                                                                                                

  long long int ans;
  if (odd==0 && P==1) {
    ans = 0;
  } else {
    ans = 1;
    if (odd>1) {
      for (i=0;i<(odd-1);i++) {
	ans *= 2;
      }
    }
    for (i=0;i<even;i++) {
      ans *= 2;
    }
  }

   std::cout << ans << std::endl;

  return 0;
}

}


Compiler output:
a.cc:41:12: error: stray '#' in program
   41 |   return 0;#include <iostream>
      |            ^
a.cc: In function 'int main()':
a.cc:41:13: error: 'include' was not declared in this scope
   41 |   return 0;#include <iostream>
      |             ^~~~~~~
a.cc:41:22: error: 'iostream' was not declared in this scope; did you mean 'std::iostream'?
   41 |   return 0;#include <iostream>
      |                      ^~~~~~~~
      |                      std::iostream
In file included from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/iosfwd:146:41: note: 'std::iostream' declared here
  146 |   typedef basic_iostream<char>          iostream;
      |                                         ^~~~~~~~
a.cc:43:1: error: expected primary-expression before 'int'
   43 | int main (void) {
      | ^~~
Language: C

//Written by Zhu Zeqi
//Come on,baby
//Hack,please
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<iterator>
#include<limits>
#include<list>
#include<locale>
#include<map>
#include<memory>
#include<new>
#include<numeric>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<typeinfo>
#include<utility>
#include<valarray>
#include<vector>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pii pair<int,int>
#define vi vector<int>
#define MAX 100000000000000000
#define MOD 1000000007
#define PI 3.141592653589793238462
#define INF 1000000000
typedef long long ll;
using namespace std;
ll a[55],ans;
ll comb(ll n,ll k)
{     
	if(n==k || k==0)
	return 1;
	else
	return comb(n-1,k)+comb(n-1,k-1);
}
int main(){
	//freopen("input.in","r",stdin);
	//freopen("output.out","w",stdout);
	ll n,p,cnt1=0,cnt2=0;
	cin>>n>>p;
	for(ll i=1;i<=n;i++)
	cin>>a[i];
	if(p==0){
		ans=1;
		for(ll i=1;i<=n;i++)
		if(a[i]%2==0)
		cnt1++;
		else
		cnt2++;
		if(cnt1>=1)
		for(ll j=1;j<=cnt1;j++){
			ans+=comb(cnt1,j);
		}
		if(cnt2>=2)
		for(ll j=2;j<=cnt2;j+=2){
			ans+=comb(cnt2,j);
		}
		cout<<ans;
	}
	else{
		int sol=0;
		ans=0;
		for(ll i=1;i<=n;i++)
		if(a[i]%2==0)
		cnt1++;
		else
		cnt2++;
		if(cnt1>=1)
		for(ll j=1;j<=cnt1;j++){
			sol+=comb(cnt1,j);
		}
		if(cnt2>=1)
		for(ll j=1;j<=cnt2;j+=2){
			ans+=comb(cnt2,j);
		}
		cout<<ans*(sol+1);
	}
	//system("pause");
	return 0;
}

Compiler output:
main.c:4:9: fatal error: cmath: No such file or directory
    4 | #include<cmath>
      |         ^~~~~~~
compilation terminated.
Language: C++

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

unsigned long long nCr(int n, int r) {
	unsigned long long ans = 1;
	for (int i = n; i > n - r; --i) {
		ans = ans*i;
	}
	for (int i = 1; i < r + 1; ++i) {
		ans = ans / i;
	}
	return ans;
}

int main(void)
{
	int N, P, a0 = 0, a1 = 0;
	cin >> N >> P;
	vector<int> A(N);
	unsigned long long int ans = 0;

	for (int i = 0; i < N; i++) {
		cin >> A[i];
		if (A[i] % 2) {
			a1++;
		} else {
			a0++;
		}
	}

	if (P==0) {
		ans += 1;
		for (int i = 1; i <= a0; i++) {
			ans *= i;
		}
		for (int i = 1; i <= a1; i++) {
			ans *= i;
		}ans /= 2;
		ans+=1;
	} else {
		if (a1 == 0) {
			cout << "0" << endl;
			return 0;
		}
		for (int i = 1; i <= round(a1/2); i+=2) {
			ans += nCr(a1,i);
		}ans *= 2;
		for (int i = 1; i <= a0; i++) {
			ans *= 2;
		}
	}

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:38: error: 'round' was not declared in this scope
   47 |                 for (int i = 1; i <= round(a1/2); i+=2) {
      |                                      ^~~~~
Language: C++

#include <stdio.h>
#include <iostream>
#include <queue>
#include <string>
#include <algorithm>
#include <cstdio>
#include <stack>
#include <vector>
#include <map>
#include <ctime>
#include <string.h>
#define inf 0x7fffffff
using namespace std;


int a,b,c,n,m,d,k,l[300010],o[300100][3],i;

int j[201000][10]={{1,0,-1,0},{0,-1,0,1}};
long long z[110][60][2],x,y;
char r[300],r1[600];
//deque<int> d;
vector<int> v[101000];
//A 65 a 97
//z 122 Z 90
/*struct P
{
    int x,y;
    bool operator<(const P &a)const
    {
        //printf("#%d %d\n",o[x],o[y]);
        return min(o[x],o[y])>min(o[a.x],o[a.y]);
    }
};*/
queue<int> q;

int f(int t,int w)
{
    if(t==a&&w==b) return 1;
    if(t==a) return 0;
    if(o[t][w]>=0) return o[t][w];
    i=( (w+o[t]) % 2);
    return o[t][w]=f(t+1,i)+f(t+1,w);
}

int main()
{
    memset(o,-1,sizeof(o));
    scanf("%d %d",&a,&b);
    for(int t=0;t<a;t++)
        scanf("%d",&o[t]);
    printf("%d",f(0,0));
}




Compiler output:
a.cc: In function 'int f(int, int)':
a.cc:41:18: error: invalid operands of types 'int*' and 'int' to binary 'operator%'
   41 |     i=( (w+o[t]) % 2);
      |         ~~~~~~~~ ^ ~
      |           |        |
      |           int*     int
Language: C++

#include <iostream>
using namespace std;
typedef long long ll;

int n, a[50], p, b = 0, c = 0;

ll nPr(ll n, ll r) {
	ll res = 1;
	for (int i = 0; i < r; i++) {
		res *= (n - i);
	}

	return res;
}

ll nCr(ll n, ll r) {
	//ll res = nPr(n, r) / nPr(r, r);
	double res = 1;
	for (int i = 0; i < r; i++) {
		res *= (n - i);
		res /= (i+1);
	}
	return (ll)res;
}

int main() {
	cin >> n >> p;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		if (a[i] % 2 == 0) {
			b++;
		}
		else {
			c++;
		}
	}

	//cout << "b:" << b << " c:" << c << endl;
	ll bsum = 0, csum = 0;
	bsum = (ll)pow(2, b);

	if (p == 0) {
		for (int i = 0; i <= c; i++) {
			if (i % 2 == 0) {
				csum += nCr(c, i);
			}
		}
	}
	else {
		for (int i = 0; i <= c; i++) {
			if (i % 2 == 1) {
				csum += nCr(c, i);
			}
		}
	}

	ll ans = bsum*csum;
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:20: error: 'pow' was not declared in this scope
   40 |         bsum = (ll)pow(2, b);
      |                    ^~~
Language: C++

#include <iostream>
using namespace std;
typedef long long ll;

int n, a[50], p, b = 0, c = 0;

ll nPr(ll n, ll r) {
	ll res = 1;
	for (int i = 0; i < r; i++) {
		res *= (n - i);
	}

	return res;
}

ll nCr(ll n, ll r) {
	//ll res = nPr(n, r) / nPr(r, r);
	double res = 1;
	for (int i = 0; i < r; i++) {
		res *= (n - i);
		res /= (i+1);
	}
	return (ll)res;
}

int main() {
	cin >> n >> p;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		if (a[i] % 2 == 0) {
			b++;
		}
		else {
			c++;
		}
	}

	//cout << "b:" << b << " c:" << c << endl;
	ll bsum = 0, csum = 0;
	bsum = pow(2, b);

	if (p == 0) {
		for (int i = 0; i <= c; i++) {
			if (i % 2 == 0) {
				csum += nCr(c, i);
			}
		}
	}
	else {
		for (int i = 0; i <= c; i++) {
			if (i % 2 == 1) {
				csum += nCr(c, i);
			}
		}
	}

	ll ans = bsum*csum;
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:16: error: 'pow' was not declared in this scope
   40 |         bsum = pow(2, b);
      |                ^~~
Language: C++

#include<iostream>
#include<utility>
#include<tuple>
#include<set>
#include<list>
#include<vector>
#include<map>
#include<algorithm>
#include<queue>

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FUNCTION__ << endl;
#define int long long

const long long MAXN = 100;
const long long MOD = 1e9+7;
const long long INF = __LONG_LONG_MAX__ / 2;

using namespace std;

int hoge[MAXN];

constexpr int power(int b, int i){
  if (i == 1) return b % MOD;
  if (i % 2 == 0) {
    return power(b*b % MOD, i/2) ;
  } else {
    return power(b*b % MOD, i/2)*b % MOD ;
  }
}

constexpr int factseed(int n){
  if (n == 0 ) return 1;
  return (n * (factseed(n-1))) % MOD;
}

constexpr int invMod(int n){
  return power(n,MOD - 2);
}


template<int N>
struct Facts {
    constexpr Facts() : arr() {
        for (auto i = 0; i != N; ++i){
            arr[i] = factseed(i); 
        }
    }
    int arr[N];
};

constexpr auto facts = Facts<MAXN>();
constexpr int fact(int n){
  return facts.arr[n];
}

template<int N>
struct Finv {
    constexpr Finv() : arr() {
        for (auto i = 0; i != N; ++i){
            arr[i] = invMod(fact(i)); 
        }
    }
    int arr[N];
};

constexpr auto finvs = Finv<MAXN>();

int combination(int m, int n){
  if(m<0 || n < 0 || m < n) return 0;
  return (((fact(m)*invMod(fact(n))) % MOD) * invMod(fact(m-n))) % MOD;
}

int perm(int m,int n){
  if (n == 0) return 1;
  return m * (perm (m-1, n-1));
}

signed main(){
    int N, P;
    cin >> N >> P;
    int even_counts = 0;
    int odd_counts = 0;
    for (int i = 0; i < N; i++){
      int a;
      cin >> a;
      if (a % 2 == 0){
       even_counts++;
      }
    }
    odd_counts = N - even_counts;
    if (P == 0){// must be even
      int prod = 0;
      for(int i = 0; i<= odd_counts / 2 ; i += 2){
        prod += combination(odd_counts, i);
      }
      printf("%lld\n",prod *(int)pow(2, even_counts + 1));
    } else {
      int prod = 0;
      for(int i = 1; i<= odd_counts / 2 ; i += 2){
        prod += combination(odd_counts, i);
      }
      printf("%lld\n",prod *(int)pow(2, even_counts + 1));
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:97:34: error: 'pow' was not declared in this scope
   97 |       printf("%lld\n",prod *(int)pow(2, even_counts + 1));
      |                                  ^~~
a.cc:103:34: error: 'pow' was not declared in this scope
  103 |       printf("%lld\n",prod *(int)pow(2, even_counts + 1));
      |                                  ^~~