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

/*input
4 6
1 2 100
3 1 100
2 4 100
4 3 100
1 4 100
3 2 100
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}

//}}}
const int maxn=15;
const int INF=0x3f3f3f3f;

int es[1<<maxn];
int adj[maxn][maxn];
int dp[maxn][1<<maxn];
int main(){
	IOS;
	int n,m;
	cin>>n>>m;
	ll tt=0;
	REP(i,m){
		int u,v,d;
		cin>>u>>v>>d;
		u--;v--;
		adj[u][v]=adj[v][u]=d;
		tt+=d;
	}
	for(int i=1;i<(1<<n);i++){
		int kk=i&-i;

		int tmp=0;
		while(kk%2==0){
			kk/=2;
			tmp++:
		}
		// if(tmp>=n) exit(0);
		int meow=i^(1<<tmp);
		es[i]=es[i^(1<<tmp)];
		for(int j=tmp+1;j<n;j++) if(i&(1<<j)){
			es[i]+=adj[tmp][j];
		}
	}
	REP(i,n) REP(j,1<<n) dp[i][j]=-INF;
	REP(mask,1<<n) for(int i=0;i<n;i++) if(mask&(1<<i)){
		if(i==0) dp[i][mask]=es[mask];
		else{
			int pre=mask^(1<<i);
			for(int sub=pre;sub>0;sub=(sub-1)&pre){
				REP(j,n) if(sub&(1<<j)){
					if(adj[j][i]) dp[i][mask]=max(dp[i][mask],dp[j][sub]+es[sub^mask]+adj[j][i]);
				}
			}
		}
	}
	cout<<tt-dp[n-1][(1<<n)-1]<<'\n';
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:30: error: expected ';' before ':' token
   59 |                         tmp++:
      |                              ^
      |                              ;
Language: C

15 22
8 13 33418
14 15 55849
7 10 15207
4 6 64328
6 9 86902
15 7 46978
8 14 53526
1 2 8720
14 12 37748
8 3 61543
6 5 32425
4 11 20932
3 12 55123
8 2 45333
9 12 77796
3 9 71922
12 15 70793
2 4 25485
11 6 1436
2 7 81563
7 11 97843
3 1 40491

Compiler output:
main.c:1:1: error: expected identifier or '(' before numeric constant
    1 | 15 22
      | ^~
Language: C++


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1<<15;
int n,m,c[15][15];
int p[N],dp[N][15];
void init()
{
	memset(p,0,sizeof(p));
	for(int i=0;i<(1<<n);i++)
		for(int j=0;j<n;j++)
			dp[i][j]=-1;
	for(int i=0;i<(1<<n);i++)
	{
		for(int j=0;j<n;j++)
		{
			if(((i>>j)&1)==0)
				continue;
			for(int k=j+1;k<n;k++)
			{
				if(((i>>k)&1)==0)
					continue;
				p[i]+=c[j][k];
			}
		}
	}
}
int main()
{
	while(cin>>n>>m)
	{
		int sum=0; 
		int u,v,w;
		memset(c,0,sizeof(c));
		while(m--)
		{
			scanf("%d%d%d",&u,&v,&w);
			u--,v--;
			c[u][v]=c[v][u]=w;
			sum+=w;
		}

        
		init();
		dp[1][0]=0;
		for(int i=0;i<(1<<n);i++)
		{
			for(int j=0;j<n;j++)
			{
				if(dp[i][j]==-1)
					continue;
				int x=(((1<<n)-1)^i)|(1<<j);	//y is some subset of x
				for(int y=x;y>=0;y--)
					y&=x,dp[i|y][j]=max(dp[i|y][j],dp[i][j]+p[y]);	
					
				for(int k=0;k<n;k++)
				{
					if((i>>k)&1)
						continue;
					if(c[j][k]==0)
						continue;
					dp[i|(1<<k)][k]=max(dp[i|(1<<k)][k],dp[i][j]+c[j][k]);
				}
			}
		}
		int ans=1e9;
		for(int i=0;i<(1<<n);i++)
			ans=min(ans,sum-dp[i][n-1]);
		cout<<ans<<endl;
	}
	return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:72:18: error: expected '}' at end of input
   72 |         return 0;
      |                  ^
a.cc:30:1: note: to match this '{'
   30 | {
      | ^
Language: C++

#include<bits/stdc++.h>
#define lowbit(x) (x&-x)
#define mem(a,b) memset(a,b,sizeof(a))
#define  For(i,a,b) for(int i=a,i##E=b;i<=i##E;++i)
#define rFor(i,a,b) for(int i=a,i##E=b;i>=i##E;--i)
using namespace std;
typedef long long LL;
const int N=16;
template<typename T>inline bool chkmin(T &a,const T &b){return a>b?a=b,1:0;}
template<typename T>inline bool chkmax(T &a,const T &b){return a<b?a=b,1:0;}
template<typename T>inline void read(T &x)
{
	x=0;int _f(0);char ch=getchar();
	while(!isdigit(ch))_f|=(ch=='-'),ch=getchar();
	while( isdigit(ch))x=x*10+ch-'0',ch=getchar();
	x=_f?-x:x;
}
inline void file()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt","r",stdin);
	freopen("out.txt","w",stdout);
#endif
}
int n,m,tot,dp[N][1<<N],ans;
int c[N],w[N][1<<N],can[1<<N];
int q[1<<N],cnt;
int main()
{
	int x,y,z;
	read(n),read(m);
	For(i,1,m)
	{
		read(x),read(y),read(z);
		c[x]|=(1<<(y-1)),w[x][1<<(y-1)]=z;
		c[y]|=(1<<(x-1)),w[y][1<<(x-1)]=z;
		ans+=z;
	}
	For(i,1,n)
	{
		cnt=0;
		for(int x=c[i];x;x=(x-1)&c[i])
			q[++cnt]=x;
		rFor(j,cnt,1)
		{
			int x=q[j];
			w[i][x]=w[i][x^lowbit(x)]+w[i][lowbit(x)];
		}
	}
	mem(dp,-inf);
	dp[1][1]=0;
	tot=(1<<n)-1;
	For(x,1,tot)
	{
		For(u,1,n)
			if(x&(1<<(u-1)))
				can[x]+=w[u][x&c[u]];
		can[x]>>=1;
	}
	For(x,1,tot)
		For(u,1,n)
		if(dp[u][x]>=0){
			int bx=tot^x;
			for(int sm=bx;sm;sm=(sm-1)&bx)
				chkmax(dp[u][x|sm],dp[u][x]+can[sm|(1<<(u-1))]);
			For(v,1,n)
				if(c[u]&(1<<(v-1))&&!(x&(1<<(v-1))))
					chkmax(dp[v][x|(1<<(v-1))],dp[u][x]+w[v][1<<(u-1)]);
		}
	printf("%d\n",ans-dp[n][tot]);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:17: error: 'inf' was not declared in this scope; did you mean 'ynf'?
   50 |         mem(dp,-inf);
      |                 ^~~
a.cc:3:27: note: in definition of macro 'mem'
    3 | #define mem(a,b) memset(a,b,sizeof(a))
      |                           ^
Language: C++

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

const int N=20;
int n,m,k,a[N],p2,T[N],E[N*N][3],ans=1<<30;
struct node
{
	int c,a,b;
	bool operator<(const node &o)const
	{
		return c>o.c;
	}
}ed[N*N];

int Findx(int x)
{
	if(T[x]==-1)return x;
	return T[x]=Findx(T[x]);
}

void Merge(int a,int b)
{
	int x=Findx(a),y=Findx(b);
	if(x!=y)T[x]=y;
}

void solve()
{
	memset(T,-1,sizeof(T));
	int i,j,now=0;k=0;
	for(i=1;i<=m;i++)
	{
	    if(a[E[i][0]]==2&&a[E[i][1]]==2)
	    	ed[++k]=(node){E[i][2],E[i][0],E[i][1]};
	    else
	        if(a[E[i][0]]!=a[E[i][1]])
	            if(a[E[i][0]]==2||a[E[i][1]]==2)
    	            if((a[E[i][0]]==1&&E[i][1]==1)||(a[E[i][1]]==1&&E[i][0]==1)||(a[E[i][0]]==3&&E[i][1]==n)||(a[E[i][1]]==3&&E[i][0]==n));
	                else now+=E[i][2];
	            else
	                now+=E[i][2];
	    //cerr<<a[E[i][0]]<<" "<<a[E[i][1]]<<" "<<E[i][0]<<" "<<E[i][1]<<"  "<<now<<endl;
	}
	sort(ed+1,ed+1+k);
	for(i=1,j=0;i<=k;i++)
	    if(Findx(ed[i].a)!=Findx(ed[i].b))
	        Merge(ed[i].a,ed[i].b),j++;
	    else
	        now+=ed[i].c;
	if(j==p2-1)
    	ans=min(ans,now);
}

void dfs(int i)
{
	if(i>=n)
	{
		solve();
		return ;
	}
	for(int j=1;j<=3;j++)
	{
	    a[i]=j;
		if(j==2)p2++;
		dfs(i+1);
		if(j==2)p2--;
	}
}

int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;i++)
	    cin>>E[i][0]>>E[i][1]>>E[i][2];
	a[1]=a[n]=2;p2=2;
	dfs(2);
	cout<<ans;
	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<(ll)n;++i)
using P = pair<ll,ll>;

ll factorial( ll n ){
  if( n == 1 ) return 1;
  return n*factorial(n-1);
}

ll comb( ll n, ll r ){
  if( n < r ) return 0;
  if( r == 0 || n == r ) return 1;
  if( r == 1 || n == r+1 ) return n;
  return factorial(n)/factorial(r)/factorial(n-r);
}

ll pow( ll x, ll n ){
	if( n == 0 ) return 1;
	ll t = pow(x,n/2);
	if( n%2 == 0 ){
		return t*t;
	}else{
		return t*t*x;
	}
}

int main() {
	ll n,p;cin >> n >> p;
	ll even = 0;
	ll odd = 0;
	rep(i,n){
		ll num;cin >> num;
		if( num%2 == 0 ) even++;
		else odd++;
	}
	if( p == 0 ){
		cout << pow(2,even)*pow(2,odd)/2 << endl;
	}else{
		if( odd == 0 ){
			cout << 0 << endl;
		}else{
			cout << (ll)pow(2,even)*(ll)pow(2,odd)/2 << endl;
		}
	}
	return 0;
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

int main() {
  int N,P;
  cin >>N >> P;
  vector<int>vec(N);
  long long cou0=0,cou1=0;
  long long ans=1,ans2=0,ansa,muri,ansb=0;
  
  for(int i=0;i<N;i++){
    cin >> vec.at(i);
      if(vec.at(i)%2==0)cou0++;
    else cou1++;
  }
  
  for(int i=0;i<cou0;i++){
    ans*=2;
  }
  
  
 
  
  if(P==1){
      for(int i=1;i<=cou1;i=i+2){
        int j= min(i,cou1-i);
       ansa = kaizyo(cou1,j)/ kaizyo(j,1);
        ansb+=ansa;
      }
    muri=ans*ansb;
    cout <<muri <<endl;
  }  
  else{
    for(int i=0; i<=cou1; i=i+2){
      ansa = kaizyo(cou1,j)/kaizyo(j,1);
      ansb+=ansa;
    }
    muri=ans*ansb;
    cout <<muri <<endl;
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >>N >> P;
      |   ^~~
a.cc:4:3: error: 'vector' was not declared in this scope
    4 |   vector<int>vec(N);
      |   ^~~~~~
a.cc:4:10: error: expected primary-expression before 'int'
    4 |   vector<int>vec(N);
      |          ^~~
a.cc:9:12: error: 'vec' was not declared in this scope
    9 |     cin >> vec.at(i);
      |            ^~~
a.cc:23:16: error: 'min' was not declared in this scope; did you mean 'main'?
   23 |         int j= min(i,cou1-i);
      |                ^~~
      |                main
a.cc:24:15: error: 'kaizyo' was not declared in this scope
   24 |        ansa = kaizyo(cou1,j)/ kaizyo(j,1);
      |               ^~~~~~
a.cc:28:5: error: 'cout' was not declared in this scope; did you mean 'cou1'?
   28 |     cout <<muri <<endl;
      |     ^~~~
      |     cou1
a.cc:28:19: error: 'endl' was not declared in this scope
   28 |     cout <<muri <<endl;
      |                   ^~~~
a.cc:32:26: error: 'j' was not declared in this scope
   32 |       ansa = kaizyo(cou1,j)/kaizyo(j,1);
      |                          ^
a.cc:32:14: error: 'kaizyo' was not declared in this scope
   32 |       ansa = kaizyo(cou1,j)/kaizyo(j,1);
      |              ^~~~~~
a.cc:36:5: error: 'cout' was not declared in this scope; did you mean 'cou1'?
   36 |     cout <<muri <<endl;
      |     ^~~~
      |     cou1
a.cc:36:19: error: 'endl' was not declared in this scope
   36 |     cout <<muri <<endl;
      |                   ^~~~
Language: C++

int main()
{
	int n, p;
	scanf("%d%d", &n, &p);
	int m = 0;
	rep(i, n) {
		int a;
		scanf("%d", &a);
		if(a % 2 == 1) m++;
	}
	if(m == 0) {
		ll ans = 1ll << n; //2^n
		if(p == 0) printf("%lld\n", ans);
		else printf("0\n");
	}
	else {
		ll ans = 1ll << (n - 1); //2^n-1
		printf("%lld\n", ans);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'scanf' was not declared in this scope
    4 |         scanf("%d%d", &n, &p);
      |         ^~~~~
a.cc:6:13: error: 'i' was not declared in this scope
    6 |         rep(i, n) {
      |             ^
a.cc:6:9: error: 'rep' was not declared in this scope
    6 |         rep(i, n) {
      |         ^~~
a.cc:12:17: error: 'll' was not declared in this scope
   12 |                 ll ans = 1ll << n; //2^n
      |                 ^~
a.cc:13:45: error: 'ans' was not declared in this scope
   13 |                 if(p == 0) printf("%lld\n", ans);
      |                                             ^~~
a.cc:13:28: error: 'printf' was not declared in this scope
   13 |                 if(p == 0) printf("%lld\n", ans);
      |                            ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main()
a.cc:14:22: error: 'printf' was not declared in this scope
   14 |                 else printf("0\n");
      |                      ^~~~~~
a.cc:14:22: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:17:17: error: 'll' was not declared in this scope
   17 |                 ll ans = 1ll << (n - 1); //2^n-1
      |                 ^~
a.cc:18:34: error: 'ans' was not declared in this scope
   18 |                 printf("%lld\n", ans);
      |                                  ^~~
a.cc:18:17: error: 'printf' was not declared in this scope
   18 |                 printf("%lld\n", ans);
      |                 ^~~~~~
a.cc:18:17: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#define rep(i,n) for (int i=0; i<(int)(n); i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  int n, p; cin >> n >> p;
  vector<int> A(n);
  rep(i,n) cin >> A[i];

  int oddcnt = 0;
  rep(i,n) {
    if (A[i] % 2) oddcnt++;
  }

  if (oddcnt == 0) {
    if (p == 1) {
      cout << 0 << endl;
    } else {
      cout << (1LL<<n) << endl;
    }
  } else {
    cout << (1LL<<n-1) << endl;
  }
  return 0;
}

Compiler output:
a.cc:5:11: error: 'pair' does not name a type
    5 | using P = pair<int, int>;
      |           ^~~~
a.cc: In function 'int main()':
a.cc:8:13: error: 'cin' was not declared in this scope
    8 |   int n, p; cin >> n >> p;
      |             ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #define rep(i,n) for (int i=0; i<(int)(n); i++)
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<int> A(n);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #define rep(i,n) for (int i=0; i<(int)(n); i++)
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> A(n);
      |          ^~~
a.cc:10:19: error: 'A' was not declared in this scope
   10 |   rep(i,n) cin >> A[i];
      |                   ^
a.cc:14:9: error: 'A' was not declared in this scope
   14 |     if (A[i] % 2) oddcnt++;
      |         ^
a.cc:19:7: error: 'cout' was not declared in this scope
   19 |       cout << 0 << endl;
      |       ^~~~
a.cc:19:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:20: error: 'endl' was not declared in this scope
   19 |       cout << 0 << endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #define rep(i,n) for (int i=0; i<(int)(n); i++)
a.cc:21:7: error: 'cout' was not declared in this scope
   21 |       cout << (1LL<<n) << endl;
      |       ^~~~
a.cc:21:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:27: error: 'endl' was not declared in this scope
   21 |       cout << (1LL<<n) << endl;
      |                           ^~~~
a.cc:21:27: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:24:5: error: 'cout' was not declared in this scope
   24 |     cout << (1LL<<n-1) << endl;
      |     ^~~~
a.cc:24:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:27: error: 'endl' was not declared in this scope
   24 |     cout << (1LL<<n-1) << endl;
      |                           ^~~~
a.cc:24:27: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

n, p = map(int, input().split())
la = [int(i) % 2 for i in input().split()]

n0 = sum(1 for a in la if a % 2 == 0)
n1 = sum(1 for a in la if a % 2 == 1)


def combi(n, k):
    c = 1
    for i in range(1, n + 1):
        c *= i
    for i in range(1, k + 1):
        c //= i
    for i in range(1, n - k + 1):
        c //= i
    return c


def answer():
    if p == 0:
        c0 = 2 ** n0
        c1 = 0
        for i in range(0, n1 + 1, 2):
            c1 += combi(n1, i)
        return c0 * c1
    else:
        c0 = 2 ** n0
        c1 = 0
        for i in range(1, n1 + 1, 2):
            c1 += combi(n1, i)
        return c0 * c1

print(answer())


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n, p = map(int, input().split())
      | ^
Language: C++

// lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで

#include <bits/stdc++.h>
#define mod 1000000007
#define INF 1001001001
#define ll long long
#define ln cout<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
std::vector<std::vector<long long>> comb(int n, int r) {
  std::vector<std::vector<long long>> v(n + 1,std::vector<long long>(n + 1, 0));
  for (int i = 0; i < v.size(); i++) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (int j = 1; j < v.size(); j++) {
    for (int k = 1; k < j; k++) {
      v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
    }
  }
  return v;
}

int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);

    ll a,b,c,d,m,n,maxi=0,f=0,mini=INF,sum=0;
    string str;
    ll p;
    cin>>n>>p;
    vector<ll> v(n);
    rep(i,n) cin>>v[i];
    ll ki=0;
    ll gu=0;
    rep(i,n) {
        if(v[i]%2)ki++;
        else gu++;
    }
    if(p==1&&ki%2==0){
        ki--;
        gu+=ki/2;
        for(ll i=1;i<gu;i++){
            
            sum+=comb((int)n,(int)i);
        }
        cout<<sum<<endl;
    }else{
    gu+=ki/2;
        for(ll i=1;i<gu;i++){
            sum+=(ll) comb((int)n,(int)i);
        }
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:16: error: no match for 'operator+=' (operand types are 'long long int' and 'std::vector<std::vector<long long int> >')
   48 |             sum+=comb((int)n,(int)i);
      |             ~~~^~~~~~~~~~~~~~~~~~~~~
a.cc:54:18: error: invalid cast from type 'std::vector<std::vector<long long int> >' to type 'long long int'
   54 |             sum+=(ll) comb((int)n,(int)i);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

map< long long, int > prime_factor(long long n) {
	map< long long, int > ret;
	for (long long i = 2; i * i <= n; i++) {
		while (n % i == 0) {
			ret[i]++;
			n /= i;
		}
	}
	if (n != 1) ret[n] = 1;
	return ret;
}

int main() {

	int n, p;
	cin >> n >> p;
	vector<int> a(n);
	int oddcount=0, evencount=0;

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

	if(oddcount==0 && p==0){cout << }

	if (p == 0) {
		if (oddcount == 0) { cout << (long long)pow(2, n) << endl;; }
		cout << (long long)pow(2, evencount)*(long long)pow(2, (oddcount) / 2) << endl;;
	}
	else {
		if (oddcount == 0 ) { cout << 0 << endl; }
		else {
			cout << (long long)pow(2, evencount)*(long long)pow(2, oddcount) / 2 << endl;;
		}
	}
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:41: error: expected primary-expression before '}' token
   34 |         if(oddcount==0 && p==0){cout << }
      |                                         ^
Language: C++


#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>

typedef unsigned long long ULLONG;
typedef long long LLONG;
static const LLONG MOD_NUM = 998244353;//1000000007;

template<class _T> static void getval(_T& a) {
	std::cin >> a;
}
template<class _T> static void getval(_T& a, _T& b) {
	std::cin >> a >> b;
}
template<class _T> static void getval(_T& a, _T& b, _T& c) {
	std::cin >> a >> b >> c;
}

static void exec();

int main()
{
	exec();
	fflush(stdout);
	return 0;
}

static void exec()
{
	int N, P;
	getval(N, P);

	int a, odd = 0;
	for (int i = 0; i < N; i++) {
		getval(a);
		if (a % 2) odd++;
	}

	LLONG ans = 0;
	if (odd == 0 && P) {
		printf("%lld\n", ans);
		return;
	}

	if (odd) {
		ans = tp_pow<LLONG>(2, N - 1);
	}
	else {
		ans = tp_pow<LLONG>(2, N);
	}
	printf("%lld\n", ans);
}


Compiler output:
a.cc: In function 'void exec()':
a.cc:56:23: error: 'tp_pow' was not declared in this scope
   56 |                 ans = tp_pow<LLONG>(2, N - 1);
      |                       ^~~~~~
a.cc:56:35: error: expected primary-expression before '>' token
   56 |                 ans = tp_pow<LLONG>(2, N - 1);
      |                                   ^
a.cc:59:23: error: 'tp_pow' was not declared in this scope
   59 |                 ans = tp_pow<LLONG>(2, N);
      |                       ^~~~~~
a.cc:59:35: error: expected primary-expression before '>' token
   59 |                 ans = tp_pow<LLONG>(2, N);
      |                                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr long long MOD = 1000000007;
constexpr long long INF = 1LL << 60;
const long double PI = acosl(-1.0);
constexpr long double EPS = 1e-11;
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main(){
ll n,p;
cin >> n >> p;
ll k = 0;
for (ll i = 0; i < n; i++) {
    ll t;
    cin >> t;
    if (t % 2 == 1) t++;
}
if(t==0){
    if (p == 0) cout << round(pow(2,n)) << endl;
    else
        cout << 0 << endl;
}
else
    cout << round(pow(2, n - 1)) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:4: error: 't' was not declared in this scope
   31 | if(t==0){
      |    ^
Language: C++

#include <iostream>
#include <vector>
#include <deque>
#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <list>
#include <unordered_set>
#include <tuple>
#include <cmath>
#include <limits>
#include <type_traits>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <set>
#include <bitset>
#include <regex>
#include <random>
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
#define rep(i,n)for(ll i=0;i<n;++i)
#define exout(x) printf("%.10f\n", x)
const double pi = acos(-1.0);
const ll MOD = 1000000007;
const ll INF = 1e10;
const ll MAX_N = 1010;

//組み合わせの余りを求める
ll fac[MAX_N], finv[MAX_N], inv[MAX_N];

void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX_N; i++) {
		fac[i] = fac[i - 1] * i;
	}
}

// 二項係数計算
long long COM(ll n, ll k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	if (n > k * 2) {

	}
	return fac[n] / (fac[k] * fac[n - k]);
}

ll dp[201010][2];
ll dx[4] = { 0,0,-1,1 };
ll dy[4] = { -1,1,0,0 };

//long longしか使わない
//素数は1より大きい
int main() {
	ll n, p;
	cin >> n >> p;
	vector<ll>a(n);
	bool flag = false;
	rep(i, n) {
		cin >> a[i];
		if (a[i] % 2)flag = true;
	}
	ans = 1;
	if (flag) {
		rep(i, n - 1) {
			ans *= 2;
		}
	}
	else {
		rep(i, n) {
			ans *= 2;
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   72 |         ans = 1;
      |         ^~~
      |         abs
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using P = pair<int, int>;
typedef long long ll;

ll mypow(ll x, ll n){
  if(n == 0)
    return 1;
 
  if(n % 2 == 0)
    return mypow(x * x, n / 2);
  else
    return x * mypow(x, n - 1);
}

//参考http://izumi-math.jp/I_Yanagita/binomial_theorem1.pdf

int main() {
  ll n, p;
  cin >> n >> p;
  int odd_number_count = 0;
  rep(i, n) {
    if(a % 2 != 0)odd_number_count++;
  }
  if(odd_number_count == 0){
    if(p == 0){
      cout << mypow(2, n) << endl;
      return 0;
    }else {
      cout << 0 << endl;
      return 0;
    }
  }
  cout << mypow(2, n - 1) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:8: error: 'a' was not declared in this scope
   24 |     if(a % 2 != 0)odd_number_count++;
      |        ^
Language: C++

#include <iostream>
#define ll long long
using namespace std;
int n, p, value[105];
ll memo[55][5005];
ll calculate(int i, ll sum){
    if(memo[i][sum]!=-1)return memo[i][sum];
    if(i>n){
        if(sum%2== p)return 1;
        else return 0;
    }
    ll t = calculate(i+1, sum+value[i]);
    ll nt = calculate(i+1, sum);
    memo[i][sum]=t+nt;
    return memo[i][sum];
}
int main(){
    memset(memo, -1, sizeof(memo));
    cin >> n >> p;
    for(int i=1; i<=n; i++){
        cin >> value[i];
    }
    cout << calculate(1, 0)<< endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'memset' was not declared in this scope
   18 |     memset(memo, -1, sizeof(memo));
      |     ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #define ll long long
Language: C++

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

int main(){

  int n,p; cin>>n>>p;

  int m =0;
  for(int i=0;i<n;i++){
      int a; cin>>a;
     if(a %2 == p) ++m;
  }


  if(m == 0)
    cout<< ( (p == 0? (1LL<<n):0) <<endl;
  else
    cout<<(1LL<<(n-1)) <<endl;


 return 0;
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:16:35: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   16 |     cout<< ( (p == 0? (1LL<<n):0) <<endl;
      |              ~~~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:16:41: error: expected ')' before ';' token
   16 |     cout<< ( (p == 0? (1LL<<n):0) <<endl;
      |            ~                            ^
      |                                         )
Language: C++

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

int main(){

  int n,p; cin>>n>>p;

  int m =0;
  for(int i=0;i<n;i++){
      int a; cin>>a;
     if(a %2 == p) ++m;
  }


  if(m == 0)
    cout<< (p == 0)?(1LL<<N):0) <<endl;
  else
    cout<<(1LL<<(N-1)) <<endl;


 return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:16:27: error: 'N' was not declared in this scope
   16 |     cout<< (p == 0)?(1LL<<N):0) <<endl;
      |                           ^
a.cc:18:18: error: 'N' was not declared in this scope
   18 |     cout<<(1LL<<(N-1)) <<endl;
      |                  ^
Language: C++

void solve(long long N, long long P, std::vector<long long> A) {
	int one  = 0;
  long long tmp = 0;
  for(int i  =0 ;i<N;i++)if(A[i]%2)one = 1;
     if(one == 0){
		if(P == 1)tmp = 0;
       else tmp = 1ll<<N;
     }
      else tmp = 1ll<<N-1;
  cout<<tmp<<'\n';
}

Compiler output:
a.cc:1:38: error: 'std::vector' has not been declared
    1 | void solve(long long N, long long P, std::vector<long long> A) {
      |                                      ^~~
a.cc:1:49: error: expected ',' or '...' before '<' token
    1 | void solve(long long N, long long P, std::vector<long long> A) {
      |                                                 ^
a.cc: In function 'void solve(long long int, long long int, int)':
a.cc:4:29: error: 'A' was not declared in this scope
    4 |   for(int i  =0 ;i<N;i++)if(A[i]%2)one = 1;
      |                             ^
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout<<tmp<<'\n';
      |   ^~~~
Language: C++

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

const long long MOD = 2;
#include <bits/stdc++.h>
using namespace std;

const long long MOD = 2;

void solve(long long N, long long P, std::vector<long long> A) {
	int one  = 0;
  long long tmp = 0;
  for(int i  =0 ;i<N;i++)if(A[i]%2)one = 1;
     if(one == 0){
		if(P == 1)tmp = 0;
       else tmp = 1ll<<N;
     }
      else tmp = 1ll<<N-1;
  cout<<tmp<<'\n';
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You
// use the default template now. You can remove this line by using your custom
// template)
int main() {
  long long N;
  scanf("%lld", &N);
  long long P;
  scanf("%lld", &P);
  std::vector<long long> A(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &A[i]);
  }
  solve(N, P, std::move(A));
  return 0;
}

void solve(long long N, long long P, std::vector<long long> A) {}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You
// use the default template now. You can remove this line by using your custom
// template)
int main() {
  long long N;
  scanf("%lld", &N);
  long long P;
  scanf("%lld", &P);
  std::vector<long long> A(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &A[i]);
  }
  solve(N, P, std::move(A));
  return 0;
}


Compiler output:
a.cc:8:17: error: redefinition of 'const long long int MOD'
    8 | const long long MOD = 2;
      |                 ^~~
a.cc:4:17: note: 'const long long int MOD' previously defined here
    4 | const long long MOD = 2;
      |                 ^~~
a.cc:38:6: error: redefinition of 'void solve(long long int, long long int, std::vector<long long int>)'
   38 | void solve(long long N, long long P, std::vector<long long> A) {}
      |      ^~~~~
a.cc:10:6: note: 'void solve(long long int, long long int, std::vector<long long int>)' previously defined here
   10 | void solve(long long N, long long P, std::vector<long long> A) {
      |      ^~~~~
a.cc:43:5: error: redefinition of 'int main()'
   43 | int main() {
      |     ^~~~
a.cc:25:5: note: 'int main()' previously defined here
   25 | int main() {
      |     ^~~~
Language: C++

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

const long long MOD = 2;

void solve(long long N, long long P, std::vector<long long> A) {
	int one  = 0;
  long long tmp = 0;
  for(int i  =0 ;i<N;i++)if(A[i]%2)one = 1;
     if(one == 0){
		if(P == 1)tmp = 0;
       else tmp = 1ll<<n;
     }
      else tmp = 1ll<<n-1;
  cout<<tmp<<'\n';
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You
// use the default template now. You can remove this line by using your custom
// template)
int main() {
  long long N;
  scanf("%lld", &N);
  long long P;
  scanf("%lld", &P);
  std::vector<long long> A(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &A[i]);
  }
  solve(N, P, std::move(A));
  return 0;
}


Compiler output:
a.cc: In function 'void solve(long long int, long long int, std::vector<long long int>)':
a.cc:12:24: error: 'n' was not declared in this scope
   12 |        else tmp = 1ll<<n;
      |                        ^
a.cc:14:23: error: 'n' was not declared in this scope
   14 |       else tmp = 1ll<<n-1;
      |                       ^
Language: C++

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

const long long MOD = 2;

void solve(long long N, long long P, std::vector<long long> A) {
	int one  = 0;
  for(int i  =0 ;i<N;i++)if(A[i]%2)one = 1;
     if(one == 0){
		if(P == 1)cout<<0;
       else cout<<(ll)pow(2,N);
     }
      else cout<<(ll)pow(2,N-1);
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You
// use the default template now. You can remove this line by using your custom
// template)
int main() {
  long long N;
  scanf("%lld", &N);
  long long P;
  scanf("%lld", &P);
  std::vector<long long> A(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &A[i]);
  }
  solve(N, P, std::move(A));
  return 0;
}


Compiler output:
a.cc: In function 'void solve(long long int, long long int, std::vector<long long int>)':
a.cc:11:20: error: 'll' was not declared in this scope
   11 |        else cout<<(ll)pow(2,N);
      |                    ^~
a.cc:13:19: error: 'll' was not declared in this scope
   13 |       else cout<<(ll)pow(2,N-1);
      |                   ^~
Language: C++

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

const long long MOD = 2;

void solve(long long N, long long P, std::vector<long long> A) {
	int one  = 0;
  for(int i  =0 ;i<N;i++}if(A[i]%2)one = 1;
     if(one){
		if(P == 1)return cout<<0;
       else return cout<<pow(2,n);
     }
      else return cout<<pow(2,n-1);
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You
// use the default template now. You can remove this line by using your custom
// template)
int main() {
  long long N;
  scanf("%lld", &N);
  long long P;
  scanf("%lld", &P);
  std::vector<long long> A(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &A[i]);
  }
  solve(N, P, std::move(A));
  return 0;
}


Compiler output:
a.cc: In function 'void solve(long long int, long long int, std::vector<long long int>)':
a.cc:8:25: error: expected ')' before '}' token
    8 |   for(int i  =0 ;i<N;i++}if(A[i]%2)one = 1;
      |      ~                  ^
      |                         )
a.cc:8:25: error: expected primary-expression before '}' token
a.cc: At global scope:
a.cc:8:26: error: expected unqualified-id before 'if'
    8 |   for(int i  =0 ;i<N;i++}if(A[i]%2)one = 1;
      |                          ^~
a.cc:9:6: error: expected unqualified-id before 'if'
    9 |      if(one){
      |      ^~
a.cc:13:7: error: expected unqualified-id before 'else'
   13 |       else return cout<<pow(2,n-1);
      |       ^~~~
a.cc:14:1: error: expected declaration before '}' token
   14 | }
      | ^
Language: C++

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

ll combo(ll a, ll b){
  if(b==0) return 1;
  else{
  ll ue=1;
  ll shita=1;
  for(ll i=a; i>=a-b+1; i--) ue*=i;
  for(ll i=1; i<=b; i++) shita*=i;
  return ue/shita;
  }
}

int main(){
  ll N, P; cin>>N>>P;
  vector<ll> B(N);
  ll odd=0;
  ll even=0;
  for(ll i=0; i<N; i++){
    ll A; cin>>A;
    if(A%2==0) even++;
    if(A%2==1) odd++;
  }
  if(odd==0) ll ans=pow(2, N);
  else ll ans=pow(2, N-1);
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: Java

import java.util.*;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int p = sc.nextInt();
        int odd = 0;
        for (int i = 0; i < n; i++) {
            if (sc.nextInt() % 2 == 1) {
                odd++;
            }
        }
        if (odd < 1) {
            System.out.println(p == 0 ? (long) Math.pow(2, n) : 0);
        } else {
            System.out.println((long) Math.pow(2, n - 1));
        }
    

Compiler output:
Main.java:20: error: reached end of file while parsing
        }
         ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	long long n,p,one=0,zero=0,a,ans;
	cin>>n>>p;
	for(int i=0;i<n;i++){
		cin>>a;
		if(a%2==0){
			zero++;
		}
		else{
			one++;
		}
	}/
	if(p==1 && one==0){
		cout<<"0"<<endl;
	}
	else{
	cout<<pow(2,n-1)<<endl;
	}
  return(0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: expected primary-expression before '/' token
   14 |         }/
      |          ^
a.cc:15:9: error: expected primary-expression before 'if'
   15 |         if(p==1 && one==0){
      |         ^~
a.cc:18:9: error: 'else' without a previous 'if'
   18 |         else{
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
#include <stdio.h>
#include <math.h>
using namespace std;
using vi = vector<int>;
using vll = vector<long long int>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<long long int>>;
using ll = long long int;

ll ncn(ll n){
    if(n == 1){return 2;}
    return ncn(n-1)*3*n;
}

int main(){
    ll N,P; cin >> N >> P;
    vll a(N);
    vll even(0), odd(0);
    for(int i=0; i<N; i++){
        cin >> a[i];
        if(a[i]%2==0){even.emplace_back(a[i]);}
        else{odd.emplace_back(a[i]);}
    }
    ll A = even.size(), B = odd.size();
    if(B==0&&P%2==1){
        cout << 0;
    }else if(B==0&&P%==0){
        ll ans = 2;
        for(int i=1; i<N; i++){
            ans *= 2;
        }
        cout << ans;
    }
    else{
        ll ans = 2;
        for(int i=1; i<N-1; i++){
            ans *= 2;
        }
        cout << ans;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:23: error: expected primary-expression before '=' token
   29 |     }else if(B==0&&P%==0){
      |                       ^
Language: Java

import java.math.BigDecimal;
import java.util.*;

public class Math {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int p = sc.nextInt();
        int o = 0, e = 0;
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            if(x % 2 == 0){
                e++;
            }else{
                o++;
            }
        }
        BigDecimal ans = new BigDecimal(0);
        for (int i = p; i <= o; i+=2) {
            for (int j = 0; j <= e; j++) {
                BigDecimal t = new BigDecimal(1).multiply(comb(o, i)).multiply(comb(e, j));
                ans = ans.add(t);
            }
        }
        System.out.println(ans);
        sc.close();

    }

    private static BigDecimal comb(int n, int r){
        BigDecimal ret = new BigDecimal(1);
        for (int i = 0; i < Math.min(r, n-r); i++) {
            ret = ret.multiply(new BigDecimal(n-i));
        }
        for (int i = 1; i <= Math.min(r, n-r); i++) {
            ret = ret.divide(new BigDecimal(i));
        }
        return ret;
    }

}



Compiler output:
Main.java:4: error: class Math is public, should be declared in a file named Math.java
public class Math {
       ^
Main.java:33: error: cannot find symbol
        for (int i = 0; i < Math.min(r, n-r); i++) {
                                ^
  symbol:   method min(int,int)
  location: class Math
Main.java:36: error: cannot find symbol
        for (int i = 1; i <= Math.min(r, n-r); i++) {
                                 ^
  symbol:   method min(int,int)
  location: class Math
3 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#define pb push_back
#define pp() pop_back()
#define V vector
#define P pair
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())
#define Q queue
#define pri priority_queue
#define Pri priority_queue<int,vector<int>,greater<int>>
#define PriP priority_queue<P<int,int>,vector<P<int,int>>,greater<P<int,int>>>
#define ff first.first
#define fs first.second
#define sf second.first
#define ss second.second
#define all(a)  (a).begin(),(a).end()
#define elif else if


int low(V<int> a,int b){
  decltype(a)::iterator c=lower_bound(a.begin(),a.end(),b);
  int d=c-a.bgn;
  return d;
}
int upp(V<int> a,int b){
  decltype(a)::iterator c=upper_bound(a.begin(),a.end(),b);
  int d=c-a.bgn;
  return d;
}
int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
}
int gcd(int a,int b){
  if(a%b==0)
    return b;
  return gcd(b,a%b);
}
int ketas(int a){
  string b=to_string(a);
  int c=0;
  fo(i,keta(a)){
    c+=b[i]-'0';
  }
  return c;
}
int INF=1000000007;
int kaijou(int a){
  int b=1;
  fo(i,a)
    b*=i+1;
  return b;
}

V<P<int,int>> factorize(int n){
  V<P<int,int>> res;
  for(int i=2; i*i<=n; i++){
    if(n%i)
      continue;
    res.emplace_back(i,0);
    while(n%i==0){
      n/=i;
      res.back().second++;
    }
  }
  if(n!=1)
    res.emplace_back(n,1);
  return res;
}

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

string s;
int a[500010];
signed main(){
  int n,p;
  cin>>n>>p;
  V<int> a(n);
  fo(i,n){
    cin>>a[i];
  }
  if(p==0){
    int b=1;
    fo(i,n){
      if(a[i]%==1){
        b=0;
        break;
      }
    }
    if(b){
      cout<<pow(2,n)<<endl;
      return 0;
    }
  }
  if(p==1){
    int b=1;
    fo(i,n){
      if(a[i]%=~1){
        b=0;
        break;
      }
    }
    if(b){
      cout<<0<<endl;
      return 0;
    }
  }
  int c=n-1;
  cout<<pow(2,c)<<endl;
}

  



Compiler output:
a.cc: In function 'int main()':
a.cc:99:16: error: expected primary-expression before '=' token
   99 |       if(a[i]%==1){
      |                ^
Language: C++

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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<pdd> vdd;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mem(a,b) memset(a, b, sizeof(a) )
#define all(x) (x).begin(),(x).end()
#define INF 1000000000000
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}

int main(){
    ll n,p;cin>>n>>p;
    vl a(n);
	rep(i,n)cin>>a[i];
	ll cnt1=0,cnt2=0;
	rep(i,n){
		if(a[i]%2==0)cnt1++;
		else cnt2++;
	}
	if(n==1){
		if(p==1&&a[0]%2==0){
			cout<<0<<endl;
			return 0;
		}
	}
	if(cnt1==n&&&p==1){
		cout<<0<<endl;
		return 0;
	}
	ll ans=1;
	while(cnt1>0){
		ans*=2;
		cnt1--;
	}
	while(cnt2>1){
		ans*=2;
		cnt2--;
	}
	cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:61:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   61 |         if(cnt1==n&&&p==1){
      |                     ~~^~~
Language: C++

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

int main() {
    long long n,p;
    cin >> n >> p;
    long long a[n];
    for(int i=0;i<n;i++){
        cin >> a[i];
        a[i]=a[i]%2;
    }
    long long dp[n+1];
    long long k[n+1];
    k[0]=1
    for(int i=1;i<+n;i++){
        k[i]=k[i-1]*2;
    }
    dp[0]=1;
    for(int i=1;i<=n;i++){
        if(a[i]%2==0){
            dp[i]=dp[i-1]*2;
        }
        else{
            dp[i]=(k[i-1]-dp[i-1])*2;
        }
    }
    if(p==0) cout << dp[n] << endl;
    else cout << k[n]-dp[n] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: expected ';' before 'for'
   14 |     k[0]=1
      |           ^
      |           ;
   15 |     for(int i=1;i<+n;i++){
      |     ~~~    
a.cc:15:17: error: 'i' was not declared in this scope
   15 |     for(int i=1;i<+n;i++){
      |                 ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>

#define DIV LLONG_MAX
long long mypow(long long k, long long n) {
	long long temp = 1;

	k = k % DIV;
	while (n) {
		if (n % 2) temp = temp * k % DIV;
		k = k * k % DIV;
		n = n / 2;
	}
	return temp % DIV;
}
long long cmb(long long n, long long r) {
	long long x = 1, y = 1, y_inv;
	long long min;

	if (n - r > r) min = r;
	else min = n - r;
	for (long long i = 0; i < min; i++) {
		x = x * (n - i) % DIV;
		y = y * (i + 1) % DIV;
	}
	return x * y % DIV;
}

int main(){
	int	n,p;
	int a;
	long long zero_cnt = 0, one_cnt = 0;
	long long ans = 0;

	scanf("%d %d", &n, &p);
	for (int i = 0; i < n; i++) {
		scanf("%d", &a);
		if (a % 2)one_cnt++;
		else zero_cnt++;
	}
	if (p) {
		for (long long i = 0; 2 * i + 1 <= one_cnt; i++)
			ans += cmb(one_cnt, 2 * i + 1);
	}
	else {
		for (long long i = 0; 2 * i <= one_cnt; i++)
			ans += cmb(one_cnt, 2 * i);
	}
	ans = ans * mypow(2, zero_cnt);
	printf("%lld", ans);
	return 0;


Compiler output:
main.c: In function 'main':
main.c:53:9: error: expected declaration or statement at end of input
   53 |         return 0;
      |         ^~~~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>

#define DIV LLONG_MAX
long long mypow(long long k, long long n) {
	long long temp = 1;

	k = k % DIV;
	while (n) {
		if (n % 2) temp = temp * k % DIV;
		k = k * k % DIV;
		n = n / 2;
	}
	return temp % DIV;
}
long long cmb(long long n, long long r) {
	long long x = 1, y = 1, y_inv;
	long long min;

	if (n - r > r) min = r;
	else min = n - r;
	for (long long i = 0; i < min; i++) {
		x = x * (n - i) % DIV;
		y = y * (i + 1) % DIV;
	}
	return x * y % DIV;
}

int main(){
	int	n,p;
	int a;
	long long zero_cnt = 0, one_cnt = 0;
	long long ans = 0;

	scanf("%d %d", &n, &p);
	for (int i = 0; i < n; i++) {
		scanf("%d", &a);
		if (a % 2)one_cnt++;
		else zero_cnt++;
	}
	if (p) {
		for (long long i = 0; 2 * i + 1 <= one_cnt; i++)
			ans += cmb(one_cnt, 2 * i + 1);
	}
	else {
		for (long long i = 0; 2 * i <= one_cnt; i++)
			ans += cmb(one_cnt, 2 * i);
	}
	ans = ans * mypow(2, zero_cnt);
	printf("%lld", ans);
	return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:53:18: error: expected '}' at end of input
   53 |         return 0;
      |                  ^
a.cc:31:11: note: to match this '{'
   31 | int main(){
      |           ^
Language: C++

#include<iostream>
#include <bits/stdc++.h>
#include <cmath>

int main()
{
  int N,P;
  cin >> N >> P;
  vector<int> vec(N);
  
  for (int i=0; i<N; i++){
    cin >> vec[i];
  }
  
  int even;
  double odd;
  even=0;
  odd=0;
  
  for (int i=0;i<N;i++){
    if (vec[i]%2==0){
      even++;
    }
  }
  odd = N-even;
  
  int ans;
  
  if (P%2==0){
    ans=std::pow(2,even)*floor(odd/2+1);
  }
  if (P%2==1){
    ans=std::pow(2,even)*floor(odd/2+1);
  }
  cout << ans<< endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   cin >> N >> P;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<int> vec(N);
      |   ^~~~~~
a.cc:9:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> vec(N);
      |          ^~~
a.cc:12:12: error: 'vec' was not declared in this scope
   12 |     cin >> vec[i];
      |            ^~~
a.cc:21:9: error: 'vec' was not declared in this scope
   21 |     if (vec[i]%2==0){
      |         ^~~
a.cc:35:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   35 |   cout << ans<< endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:35:17: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   35 |   cout << ans<< endl;
      |                 ^~~~
      |                 std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~