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

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
ll h(ll n,ll j){
  ll k=1;
  for(int i=n;i>=n-j+1;i--){
    k*=i;
  }
  for(int i=j,i>0;j--){
    k/=i;
  }
  return k;
}
ll kk(ll n){
  ll k=1;
  rep(i,n){
    k*=2;
  }
  return k;
}
int main(){
  ll n,p;
  cin>>n>>p;
  vll a(n);
  ll a0=0;
  ll a1=0;
  rep(i,n){
    cin>>a[i];
    if(a[i]%2==0) a0++;
    else a1++;
  }
  sort(all(a));
  ll ans=0;
  if(p){
    ans+=a1;
    ll k=3;
    while(a1-k>=1){
      ans+=h(a1,k);
      k+=2;
    }
    ans*=kk(a0);
    COUT(ans);
  }
  else{
    ll k=2;   
    while(a1-k>=1){
      ans+=h(a1,k);
      k+=2;
    }
    ans*=kk(a0);
  }
  COUT(ans);
}
    


Compiler output:
a.cc: In function 'long long int h(long long int, long long int)':
a.cc:41:16: error: expected ';' before '>' token
   41 |   for(int i=j,i>0;j--){
      |                ^
      |                ;
a.cc:41:16: error: expected primary-expression before '>' token
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
ll h(ll n,ll j){
  ll k=1;
  for(int i=n;i>=n-j+1;i--){
    k*=i;
  }
  for(int i=j,i>0;j--){
    k/=i;
  }
  return k;
}
ll kk(ll n){
  ll k=1;
  rep(i,n){
    k*=2;
  }
  return k;
}
int main(){
  ll n,p;
  cin>>n>>p;
  vll a(n);
  ll a0=0;
  ll a1=0;
  rep(i,n){
    cin>>a[i];
    if(a[i]%2==0) a0++;
    else a1++;
  }
  sort(all(a));
  ll ans=0;
  if(p){
    ans+=a1;
    ll k=3;
    while(a1-k>=1){
      ans+=h(a1,k);
      k+=2;
    }
    ans*=kk(a0);
    COUT(ans);
  }
  else{
    ll k=2;   
    while(a1-k>=1){
      ans+=h(a1,k);
      k+=2;
    }
    ans*=kk(a0);
    

Compiler output:
a.cc: In function 'long long int h(long long int, long long int)':
a.cc:41:16: error: expected ';' before '>' token
   41 |   for(int i=j,i>0;j--){
      |                ^
      |                ;
a.cc:41:16: error: expected primary-expression before '>' token
a.cc: In function 'int main()':
a.cc:82:17: error: expected '}' at end of input
   82 |     ans*=kk(a0);
      |                 ^
a.cc:76:7: note: to match this '{'
   76 |   else{
      |       ^
a.cc:82:17: error: expected '}' at end of input
   82 |     ans*=kk(a0);
      |                 ^
a.cc:53:11: note: to match this '{'
   53 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
signed main(){
  int N,P; cin>>N>>P;
  vii A(N+1,vi(2));
  REP(i,1,N){
    int X; cin>>X;
    if(X%2==0){
      dp[i][0]=dp[i-1][0]+1;
      dp[i][1]=dp[i-1][1]+1;
    }
    else{
      dp[i][0]=dp[i-1][1]+1;
      dp[i][1]=dp[i-1][0]+1;
    }
  }
  cout<<dp[N][P]<<endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:21:7: error: 'dp' was not declared in this scope; did you mean 'dup'?
   21 |       dp[i][0]=dp[i-1][0]+1;
      |       ^~
      |       dup
a.cc:25:7: error: 'dp' was not declared in this scope; did you mean 'dup'?
   25 |       dp[i][0]=dp[i-1][1]+1;
      |       ^~
      |       dup
a.cc:29:9: error: 'dp' was not declared in this scope; did you mean 'dup'?
   29 |   cout<<dp[N][P]<<endl;
      |         ^~
      |         dup
Language: C++

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

long long cob(long long x, long long y){
  long long tmp1 = 1;
  for(int i = x; i > x - y; i++){
    tmp1 *= i;
  }
  long long tmp2 = 1;
  for(int i = 1; i < y + 1; i++){
    tmp2 *= i;
  }
  return tmp1 / tmp2;
}

int main(){
  long long n, p; cin >> n >> p;
  vector<int> a(n);
  long long x = 0;
  for(int i = 0; i < n; i++){
    long long tmp; cin >> tmp;
    if(tmp % 2 == 1) x++;
  }
  long long y = n - x;
  long long out = 0;
  if(p == 0){
    int i = 0;
    while(i <= x){
      out += cob(x, i);
      i += 2;
    }
  }else{
    int = 1;
    while(i <= x){
      out += cob(x, i);
      i += 2;
    }
  }
  long long out2 = 1;
  for(int i = 0; i < y; i++){
    out2 *= 2;
  }
  cout << out * out2;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:9: error: expected unqualified-id before '=' token
   33 |     int = 1;
      |         ^
a.cc:34:11: error: 'i' was not declared in this scope
   34 |     while(i <= x){
      |           ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <iomanip>
#include<string>
#include <stack>
#include<queue>
#include<map>
#include <stdlib.h>
#include <set>
typedef long long ll;
using namespace std;

int main() {

	 int n,p,ans=0;
	 bool gu=true;
	 cin>>n>>p;
	 vector<int>a(n);
	 for(int i=0;i<n;i++){
		 cin>>a[i];
		 if(a[i]%2!=0) gu=false;
	 }
	 if(gu==true){
		 if(p==0){
			 cout << fixed << setprecision(15) <<pow(2,n) << endl;
		 }else if(p==1){
			 cout<<"0"<<endl;
		 }
	 }else{
		 cout << fixed << setprecision(15) << pow(2,n-1) << endl;
	 }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:62: error: 'pow' was not declared in this scope
   29 |                          cout << fixed << setprecision(15) <<pow(2,n) << endl;
      |                                                              ^~~
a.cc:34:55: error: 'pow' was not declared in this scope
   34 |                  cout << fixed << setprecision(15) << pow(2,n-1) << endl;
      |                                                       ^~~
Language: C++

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <utility>
#include<Math.h>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include<string>
#include <stack>
#include<queue>
#include<map>
#include <stdlib.h>
#include <bits/stdc++.h>
#include <set>
typedef long long ll;
using namespace std;

int main() {

	 int n,p,ans=0;
	 bool gu=true;
	 cin>>n>>p;
	 vector<int>a(n);
	 for(int i=0;i<n;i++){
		 cin>>a[i];
		 if(a[i]%2!=0) gu=false;
	 }
	 if(gu==true){
		 if(p==0){
			 cout << fixed << setprecision(15) <<pow(2,n) << endl;
		 }else if(p==1){
			 cout<<"0"<<endl;
		 }
	 }else{
		 cout << fixed << setprecision(15) << pow(2,n-1) << endl;
	 }

}


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

#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define NIL -1
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数

//-------------------------------------------------
//コピペするとこ


int conbi(int n,int k){
  int a = 1 ;
  REP(i,k){
    a *=(n-k) ;
  }
  REP(i,k){
    a /= (i+1) ;
  }
  return a ;
}

int jo(int n){
  int a = 1;
  REP(i,n){
    a *= 2 ;
  }
  return a ;
}


//-------------------------------------------------


int main()
{
  int n ;
  cin >> n ;
  int p ;
  cin >> p ;
  int ck = 0 ;
  int cg = 0 ;
  int ans = 1 ;
  
  REP(i,n){
    int a ;
    cin >> a ;
    if(a%2==0){
      cg++ ;
    }
    else{
      ck++ ;
    }
  }
  
  if(p==0){
    for(int i=0;i<=ck;i+=2){
      ans *= combi(ck,i) ;
    }
    ans += jo(cg) ;
  }
  else{
    for(int i=1;i<=ck;i+=2){
      ans *= combi(ck,i) ;
    }
    ans *= jo(cg) ;
  }
      
    
  
  cout <<ans <<endl ;
  
  return 0 ;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:79:14: error: 'combi' was not declared in this scope; did you mean 'conbi'?
   79 |       ans *= combi(ck,i) ;
      |              ^~~~~
      |              conbi
a.cc:85:14: error: 'combi' was not declared in this scope; did you mean 'conbi'?
   85 |       ans *= combi(ck,i) ;
      |              ^~~~~
      |              conbi
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int P = sc.necrInt();
    int odd = 0;
    for (int i = 0; i < N; i ++) {
      if (sc.nextInt()%2 == 1) odd++;
    }
    
    long oddComb = 0;
    for (int i = 1; i <= odd; i+=2) {
      oddComb += comb(odd, i);
    }
    
    System.out.println(p == 1
      ? oddComb : (1L<<N)-oddComb);
  }
  private static long comb(int a, int b) {
    long numer = 1;
    long denom = 1;
    for (int i = 0; i < b; i++) {
      numer *= a-i;
      denom *= i+1;
    }
    return numer/denom;
  }
}

Compiler output:
Main.java:7: error: cannot find symbol
    int P = sc.necrInt();
              ^
  symbol:   method necrInt()
  location: variable sc of type Scanner
Main.java:18: error: cannot find symbol
    System.out.println(p == 1
                       ^
  symbol:   variable p
  location: class Main
2 errors
Language: Java

import java.util.*;

public class Main {
  pubkic static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int P = sc.necrInt();
    int odd = 0;
    for (int i = 0; i < N; i ++) {
      if (sc.nextInt()%2 == 1) odd++;
    }
    
    long oddComb = 0;
    for (int i = 1; i <= odd; i+=2) {
      oddComb += comb(odd, i);
    }
    
    System.out.println(p == 1
      ? oddComb : (1L<<N)-oddComb;
  }
  private static long comb(int a, int b) {
    long numer = 1;
    long denom = 1;
    for (int i = 0; i < b; i++) {
      numer *= a-i;
      denom *= i+1;
    }
    return numer/denom;
  }
}

Compiler output:
Main.java:4: error: <identifier> expected
  pubkic static void main(String[] args) {
        ^
Main.java:19: error: ')' or ',' expected
      ? oddComb : (1L<<N)-oddComb;
                                 ^
2 errors
Language: C++

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

int main(){
  int n,p; cin>>n>>p;
  int C[n+1][n+1];
  long long c0=0,c1=0;
  for(int i=0;i<n;i++){
    int a; cin>>a;
    if(a%2==0) c0++;
    else c1++;
  }C[0][0]=1;
  for(int i=1;i<=n;i++){
    for(int j=0;j<=i;j++){
      if(j==0 || j==i) C[i][j]=1;
      else C[i][j]=C[i-1][j-1]+C[i-1][j];
    }
  }
  long long re=pow(2,c0) ans=0;
  for(int bit=0;bit<=c1;bit++){
    if(bit%2==p) ans+=re*C[n][bit];
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:26: error: expected ',' or ';' before 'ans'
   19 |   long long re=pow(2,c0) ans=0;
      |                          ^~~
a.cc:21:18: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |     if(bit%2==p) ans+=re*C[n][bit];
      |                  ^~~
      |                  abs
a.cc:23:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double lld;
ll MOD = (1e9)+7;
void fastIO(){
  ios_base::sync_with_stdio(0); cin.tie(0);
}
int main(){
  fastIO();
  ll n,c,x;
  cin>>n>>c;
  int par=0,impar=0;
  for(int i=0;i<n;i++){
  	cin>>x;
  	x%2==0?par++:impar++;
  }
  ll ans = 1;
  if(impar){
  	for(int i=0;i<impar+par-1;i++){
  		ans*=2;
  	}
  }else{
  	for(int i=0;i<n;i++){
  		ans*=2;
  	}
  }
  cout<<ans<<endl;
}  


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++

#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main() {
  long long int64_t a,b,c[110],d[110],e,f,g[110],h[110];
  cin >>a>>b;
   e =0,f=0;
  for(int i=0;i<a;i++)
    cin >> c[i];
  
  for(int i=0;i<a;i++){
    
   d[i] = c[i]%2;
   
  if( d[i] ==0){
    e ++;
  }
  else{
    f++;
  }
  }
  g[0] =1,h[0]=1;
  for(int i=0;i<e;i++){
    g[i+1] =2*g[i];
  }
  for(int i=0;i<f-1;i++){
    h[i+1] =2*h[i];
  }
 
  if(b ==1&&f==0){
    cout <<"0" <<endl;
    
   
  }
  else if(f==0){
    cout << g[e+1] << endl;
  }
  else{
    cout << h[f-1]*g[e] << endl;
  }
}
 
  
  
  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:5:21: error: expected initializer before 'a'
    5 |   long long int64_t a,b,c[110],d[110],e,f,g[110],h[110];
      |                     ^
a.cc:6:9: error: 'a' was not declared in this scope
    6 |   cin >>a>>b;
      |         ^
a.cc:6:12: error: 'b' was not declared in this scope
    6 |   cin >>a>>b;
      |            ^
a.cc:7:4: error: 'e' was not declared in this scope
    7 |    e =0,f=0;
      |    ^
a.cc:7:9: error: 'f' was not declared in this scope
    7 |    e =0,f=0;
      |         ^
a.cc:9:12: error: 'c' was not declared in this scope
    9 |     cin >> c[i];
      |            ^
a.cc:13:4: error: 'd' was not declared in this scope
   13 |    d[i] = c[i]%2;
      |    ^
a.cc:13:11: error: 'c' was not declared in this scope
   13 |    d[i] = c[i]%2;
      |           ^
a.cc:22:3: error: 'g' was not declared in this scope
   22 |   g[0] =1,h[0]=1;
      |   ^
a.cc:22:11: error: 'h' was not declared in this scope
   22 |   g[0] =1,h[0]=1;
      |           ^
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main() {
  long long int a,b,c[110],d[110],e,f,g[110],h[110];
  cin >>a>>b;
   e =0,f=0;
  for(int i=0;i<a;i++)
    cin >> c[i];
  
  for(int i=0;i<a;i++){
    
   d[i] = c[i]%2;
   
  if( d[i] ==0){
    e ++;
  }
  else{
    f++;
  }
  }
  g =1,h=1;
  for(int i=0;i<e;i++){
    g *=2;
  }
  for(int i=0;i<f-1;i++){
    h*=2;
  }
 
  if(b ==1&&f==0){
    cout <<"0" <<endl;
    
   
  }
  else if(f==0){
    cout << g << endl;
  }
  else{
    cout << f*g << endl;
  }
}
 
  
  
  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:22:5: error: incompatible types in assignment of 'int' to 'long long int [110]'
   22 |   g =1,h=1;
      |   ~~^~
a.cc:22:9: error: incompatible types in assignment of 'int' to 'long long int [110]'
   22 |   g =1,h=1;
      |        ~^~
a.cc:24:7: error: invalid operands of types 'long long int [110]' and 'int' to binary 'operator*'
   24 |     g *=2;
      |     ~~^~~
a.cc:24:7: note:   in evaluation of 'operator*=(long long int [110], int)'
a.cc:27:6: error: invalid operands of types 'long long int [110]' and 'int' to binary 'operator*'
   27 |     h*=2;
      |     ~^~~
a.cc:27:6: note:   in evaluation of 'operator*=(long long int [110], int)'
a.cc:39:14: error: invalid operands of types 'long long int' and 'long long int [110]' to binary 'operator*'
   39 |     cout << f*g << endl;
      |             ~^~
      |             | |
      |             | long long int [110]
      |             long long int
Language: C++

#include <bits/stdc++.h>

using namespace std;

const int maxn = 50 + 10;
long long int a[maxn];

long long int tavan(int a, int b)
{
    long long int jav = 1;
    int (int i = 0; i < b; i ++)
    {
        jav *= a;
    }
    return jav;
}

int main()
{
    long long int n, k, e = 0, o = 0, jav = 0;
    cin >> n >> k;

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

    jav *= (long long int) tavan(2, e);
    jav *= (long long int) tavan(2, o - 1);

    /*if (e == 0 && k == 1)
    {
        jav = pow(2, (o - 1));
    }
    else if (o == 0 && k == 0)
    {
        jav = pow (2, e);
    }
    else if (o == 0 && k == 1)
    {
        jav = 0;
    }
    else if (k == 1 || k == 0)
    {
        jav = pow (2, e) * pow(2, (o - 1));
    }
    */
    cout << jav;
    return 0;
}


Compiler output:
a.cc: In function 'long long int tavan(int, int)':
a.cc:11:5: error: expected primary-expression before 'int'
   11 |     int (int i = 0; i < b; i ++)
      |     ^~~
a.cc:11:21: error: 'i' was not declared in this scope
   11 |     int (int i = 0; i < b; i ++)
      |                     ^
Language: C++

#include <iostream>
//using namespace std;long n,x,a,i,b;int main(){for(cin>>n>>x;n>i;i++){cin>>a;b+=a%2;}cout << (b?1<<n:x?0:1<<--n) << endl;}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
using namespace std;int main(){long long n,x;cin>>n>>x;for(int i = 0; n > i; i++){int a;cin>>a;if(a%2==1){cout << (long long)pow(2,n)/2 << endl;return 0;}}cout << (x==0?(long long)pow(2,n):0) << endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:126: error: 'pow' was not declared in this scope
    2 | using namespace std;int main(){long long n,x;cin>>n>>x;for(int i = 0; n > i; i++){int a;cin>>a;if(a%2==1){cout << (long long)pow(2,n)/2 << endl;return 0;}}cout << (x==0?(long long)pow(2,n):0) << endl;}
      |                                                                                                                              ^~~
a.cc:2:181: error: 'pow' was not declared in this scope
    2 | using namespace std;int main(){long long n,x;cin>>n>>x;for(int i = 0; n > i; i++){int a;cin>>a;if(a%2==1){cout << (long long)pow(2,n)/2 << endl;return 0;}}cout << (x==0?(long long)pow(2,n):0) << endl;}
      |                                                                                                                                                                                     ^~~
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
int main(){
  long long n,x;cin>>n>>x;
  for(int i = 0; n > i; i++)int a;cin>>a;if(a%2==1){cout << (long long)pow(2,n)/2 << endl;return 0;}
  cout << (x==0?(long long)pow(2,n):0) << endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:6:40: error: 'a' was not declared in this scope
    6 |   for(int i = 0; n > i; i++)int a;cin>>a;if(a%2==1){cout << (long long)pow(2,n)/2 << endl;return 0;}
      |                                        ^
Language: C++

N, P = map(int,input().split())
A = list(map(int,input().split()))
dp = [[[0 for k in range(2)] for j in range(N+1)] for i in range(N+1)] #dp[i][j][k]は1-iまででj個選んだ時にmod2がkとなる選び方
dp[1][0][0] = 1
if(A[0] % 2 == 0):
    dp[1][1][0] = 1
else:
    dp[1][1][1] = 1
for i in range(2, N+1):
    for j in range(i+1):
        if(j == 0):
            dp[i][j][0] = 1
        else:
            if(A[i-1] % 2 == 0):
                dp[i][j][0] = dp[i-1][j-1][0] + dp[i-1][j][0]
                dp[i][j][1] = dp[i-1][j-1][1] + dp[i-1][j][1]
            else:
                dp[i][j][0] = dp[i-1][j-1][1] + dp[i-1][j][0]
                dp[i][j][1] = dp[i-1][j-1][0] + dp[i-1][j][1]
ans = 0
if(P == 0):
    for i in range(N+1):
        ans += dp[N][i][0]
else:
    for i in range(N+1):
        ans += dp[N][i][1]
print(str(ans))

Compiler output:
a.cc:3:72: error: stray '#' in program
    3 | dp = [[[0 for k in range(2)] for j in range(N+1)] for i in range(N+1)] #dp[i][j][k]は1-iまででj個選んだ時にmod2がkとなる選び方
      |                                                                        ^
a.cc:1:1: error: 'N' does not name a type
    1 | N, P = map(int,input().split())
      | ^
Language: C++

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

int main(){
  int N, P;
  cin >> N >> P;
  for(int i=0; i<N; i++){
    int A; cin >> A;
  }
  cout << (long long)pow(2, N-1) << endl;
  return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incluce; did you mean #include?
    1 | #incluce<bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   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 | #incluce<bits/stdc++.h>
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout << (long long)pow(2, N-1) << endl;
      |   ^~~~
a.cc:10:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:22: error: 'pow' was not declared in this scope
   10 |   cout << (long long)pow(2, N-1) << endl;
      |                      ^~~
a.cc:10:37: error: 'endl' was not declared in this scope
   10 |   cout << (long long)pow(2, N-1) << endl;
      |                                     ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #incluce<bits/stdc++.h>
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 99999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(20) << S << endl
#define Vecpr(K,L1,L2,N) vector<pair<L1,L2>> K(N)
#define Vec(K,L,N,S) vector<L> K(N,S)
#define DV(K,L,N,M,R) vector<vector<L>> K(N, vector<L>(M,R))
#define pint pair<int,int>
#define Lower(v,X) lower_bound(v.begin(),v.end(),X)-v.begin();
#define mod 1000000007
#define MAX 5100000
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main(){
   lli A,B,C,L,R,N,M,K,X=0,Y=0,W,H=INF,sum=0,num=0,flag=0;string S,T,O;
   cin >> N >> K;
   Vec(P,lli,N,0);rep(i,0,N)cin >> P[i];
   rep(i,0,N)if(P[i]%2)flag=1;
   if(!flag){
     A=pow(2,N);
      if(!K)Out(A);
      else Out(0);
   }
  A=pow(2,N-1);
   else Out(A);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:4: error: 'else' without a previous 'if'
   37 |    else Out(A);
      |    ^~~~
Language: C++

#include <cstdio>
#include <climits>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <utility>
#include <queue>
#include <cstring>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
const long long MOD = 1000000007;

typedef long long ll;

  
int
main(int argc, char *argv[])
{
  int n, p, a, f = 0;
  cin >> n >> p;
  rep(i, n) {
    cin >> a[i];
  }
  
  ll dp[60][3];
  dp[0][0] = 1;
  dp[0][1] = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] % 2) {
      dp[i][0] = dp[i - 1][0] + dp[i - 1][1];
      dp[i][1] = dp[i][0];
    } else {
      dp[i][0] = (ll)2 * dp[i - 1][0];
      dp[i][1] = dp[i][0];
    }
  }
  cout << dp[n][p] << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:23:13: error: invalid types 'int[int]' for array subscript
   23 |     cin >> a[i];
      |             ^
a.cc:30:10: error: invalid types 'int[int]' for array subscript
   30 |     if (a[i] % 2) {
      |          ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <math.h>
using namespace std;
typedef long long int ll;

int main(){
	int n,p; cin >> n >> p;
	vector<int> a(n);
	int odd=0;
	for(int i=0;i<n;i++){
		cin >> a[i];
		if(a[i]%2==1)odd++;
	}
	if(p==1&&odd==0){
		cout << 0 << endl;
		return 0;
	}
	ll ans;
	else if(p==0&&odd==0){
		ans=pow(2,n);
	}
	else{
		ans=pow(2,n-1);
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'else' without a previous 'if'
   22 |         else if(p==0&&odd==0){
      |         ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
using namespace std;
int n, m;
int a[2005];
long long ans;
int f[10005]={0};
int main(){
    cin >> n >> p;
    for (int i=1; i<=n; i++) cin >> a[i];
    f[0]=1;
    for (int i=1; i<=n; i++)
      for (int j=5000; j>=a[i]; j--)
        if (f[j-a[i]]>0) f[j]+=f[j-a[i]]; 
	if (p%2==1){
		for (int i=1; i<=4999; i+=2){
			ans+=f[i];
		}
	}
	else {
		for (int i=0; i<=5000; i+=2){
			ans+=f[i];
		}
	}
	if (ans!=0) cout << ans << endl;
	else return 0;
	return 0;	
} 

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  long int n,p,e=0,a=1,b=0;cin>>n>>p;
  for(int i=0;i<n;i++){
    int a;cin>>a;
    if(a%2)e++;
  }
  if(e>0){
    for(int i=0;i<e;;i++)a*=2;
  }
  if(p==0){
    for(int i=0;i<=n-e;i+=2){
      long int c=1;
      for(int j=n-e-i+1;j<=n-e;j++)c*=j;
      for(int j=1;j<=i;j++)c/=j;
      b+=c;
    }
    cout<<a*b<<endl;
  }
  else{
    for(int i=1;i<=n-e;i+=2){
      long int c=1;
      for(int j=n-e-i+1;j<=n-e;j++)c*=j;
      for(int j=1;j<=i;j++)c/=j;
      b+=c;
    }
    cout<<a*b<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: expected primary-expression before ';' token
   10 |     for(int i=0;i<e;;i++)a*=2;
      |                     ^
a.cc:10:21: error: expected ')' before ';' token
   10 |     for(int i=0;i<e;;i++)a*=2;
      |        ~            ^
      |                     )
a.cc:10:22: error: 'i' was not declared in this scope
   10 |     for(int i=0;i<e;;i++)a*=2;
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = (int)1e9 + 7;
const int INF = (int)100100100;

void comb(vector<vector <long long int> > &v){
  for(int i = 0;i <v.size(); i++){
    v[i][0]=1;
    v[i][i]=1;
  }
  for(int k = 1;k <v.size();k++){
    for(int j = 1;j<k;j++){
      v[k][j]=(v[k-1][j-1]+v[k-1][j]);
    }
  }
}

int main() {
    //ll N; cin >> N;
    //ll N,M; cin >> N >> M;
    //string S; cin >> S;
    //ll H,W; cin >> H >> W;
    ll N,P;
    cin >> N >> P;
    ll odd=0,even=0;
    for(int i=0;i<N;i++){
        int a;
        cin >> a;
        if(a%2==0)even++;
        else odd++;
    }
    if (odd==0){
        if(P==0){
            ll ans=pow(2,N);
            cout << ans;
        }
        else cout << 0 << endl;
    }
    ll ans=pow(2,N-1);
    else cout << ans << endl;
    
}

/*



 */


Compiler output:
a.cc: In function 'int main()':
a.cc:41:5: error: 'else' without a previous 'if'
   41 |     else cout << ans << endl;
      |     ^~~~
Language: C++

45 1
17 55 85 55 74 20 90 67 40 70 39 89 91 50 16 24 14 43 24 66 25 9 89 71 41 16 53 13 61 15 85 72 62 67 42 26 36 66 4 87 59 91 4 25 26


Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 45 1
      | ^~
Language: C++

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

#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define repr(i,n) for(int i=(n);i>=0;--i)
#define cinv(n,vec) VL (vec)(n);for(auto&v:vec)cin>>v;
#define int long long
#define itn int
#define pb push_back
#define m_p make_pair
#define m_t make_tuple
#define eb emplace_back
#define p_p(a,b) pb(m_p(a,b))
#define all(a) a.begin(),a.end()
#define SORT(a) sort(all(a))
#define RSORT(a) sort(all(a),greater<>())
#define UNIQUE(a) a.erase(unique(all(a)),a.end())
#define SZ(a) (ll)(a.size())
#define ENDL cout<<endl
#define debg(a) cout<<#a<<" "<<a<<endl;
#define debgp(a) cout<<#a<<" "<<a.fi<<" : "<<a.se<<endl
#define call(a) for(auto i:a)cout<<i<<" ";cout<<endl
#define show(a) for(cont &y:a){for(cont &x:y){cout<<x<<" ";}cout<<endl;}
#define out(a) cout<<(a)<<endl
#define cont const auto
#define fi first
#define se second
#define V vector
#define P pair
#define T tuple
#define VV(type,name,y,x,a) vector<vector<type>> name = vector<vector<type>>(y,vector<type>(x,a))
#define PQ priority_queue
typedef long long ll;
typedef double D;
typedef long double LD;
typedef string str;
typedef vector<ll> VL;
typedef pair<ll,ll> PL;
typedef vector<pair<ll,ll>> VP;
typedef tuple<ll,ll,ll> T3;
typedef tuple<ll,ll,ll,ll> T4;
const long long INF = 1LL<<60;
const long long MOD = 1e9+7;
void Yes(){cout<<"Yes"<<endl;}
void No(){cout<<"No"<<endl;}
void YN(bool b){cout<<(b?"Yes":"No")<<endl;}
template<class T>inline T gcd(T a,T b){if(b==0)return a; return(gcd(b,a%b));}
template<class T>inline T lcm(T a,T b){return a/gcd(a,b)*b;}
template<class T>inline bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}

void comb(V<VL>&n){
  rep(i,SZ(n)){
    n[i][0]=1;
    n[i][i]=1;
  }
  reps(i,SZ(n)-1)
    reps(j,i-1)
      n[i][j]=n[i-1][j-1]+n[i-1][j];
}

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n,p;
  cin>>n>>p;
  vector<long> a(n);
  rep(i,n)cin>>a[i];

  int even=0,odd=0;
  for(auto e:a)(e&1?odd:even)++;
  if(odd==0){
    if(p==0)out(pow(2,n));
    else out(0);
  }
  else{
    out(pow(2,n-1));
  }
  
  
  return 0;
}

// WA
/*

Compiler output:
a.cc:87:1: error: unterminated comment
   87 | /*
      | ^
Language: C

#include <stdio.h>
 
int main(void) {
    int N, P, A[55], i, n_e, n_o;
    long long c;
    scanf("%d %d", &N, &P);
    n_e=0; n_o=0;
    for (i=1; i<=N; i++) {
        scanf("%d", &A[i]);
        if ((A[i])%2 == 0) n_e+=1;
        else n_o+=1;
    }
    if (n_o!=0) {
        c=1;
        for (i=1; i<=N-1; i++) {
            c*=2;
    }
    else if (P==1) c=0;
    else {
        c=1;
        for (i=1; i<=N; i++) {
            c*=2;
    }
    printf("%lld\n", c);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:5: error: expected '}' before 'else'
   18 |     else if (P==1) c=0;
      |     ^~~~
main.c:26:1: error: expected declaration or statement at end of input
   26 | }
      | ^
Language: C++

long long int N,P;
cin>>N>>P;
long long int A[N];
long long int S = 0,s=0,B=0;

for(int x = 0;x<N;x++){
    cin>>A[x];
}for(int x = 0;x<N;x++){
    if(A[x]%2==0){
        S++;
    }else{
        s++;
    }
}
if(P==0){
    B+=1;
    long long int D=0,C = S*(S+1)/2;
    for(int x = s-1;x>0;x-=2){
        D+=x;
    }
B+=C+D;
}if(P==1){
   for(int x = s;x>0;x-=2){
        B+=x;
    }
}
cout<<B<<"\n";
}

Compiler output:
a.cc:2:1: error: 'cin' does not name a type
    2 | cin>>N>>P;
      | ^~~
a.cc:3:17: error: size of array 'A' is not an integral constant-expression
    3 | long long int A[N];
      |                 ^
a.cc:6:1: error: expected unqualified-id before 'for'
    6 | for(int x = 0;x<N;x++){
      | ^~~
a.cc:6:15: error: 'x' does not name a type
    6 | for(int x = 0;x<N;x++){
      |               ^
a.cc:6:19: error: 'x' does not name a type
    6 | for(int x = 0;x<N;x++){
      |                   ^
a.cc:8:2: error: expected unqualified-id before 'for'
    8 | }for(int x = 0;x<N;x++){
      |  ^~~
a.cc:8:16: error: 'x' does not name a type
    8 | }for(int x = 0;x<N;x++){
      |                ^
a.cc:8:20: error: 'x' does not name a type
    8 | }for(int x = 0;x<N;x++){
      |                    ^
a.cc:15:1: error: expected unqualified-id before 'if'
   15 | if(P==0){
      | ^~
a.cc:22:2: error: expected unqualified-id before 'if'
   22 | }if(P==1){
      |  ^~
a.cc:27:1: error: 'cout' does not name a type
   27 | cout<<B<<"\n";
      | ^~~~
a.cc:28:1: error: expected declaration before '}' token
   28 | }
      | ^
Language: C++

long long int N,P;
cin>>N>>P;
long long int A[N];
long long int S = 0,s=0,B=0;

for(int x = 0;x<N;x++){
    cin>>A[x];
}for(int x = 0;x<N;x++){
    if(A[x]%2==0){
        S++;
    }else{
        s++;
    }
}
if(P==0){
    B+=1;
    long long int D=0,C = S*(S+1)/2;
    for(int x = s-1;x>0;x-=2){
        D+=x;
    }
B+=C+D;
}if(P==1){
   for(int x = s;x>0;x-=2){
        B+=x;
    }
}
cout<<B<<"\n";

Compiler output:
a.cc:2:1: error: 'cin' does not name a type
    2 | cin>>N>>P;
      | ^~~
a.cc:3:17: error: size of array 'A' is not an integral constant-expression
    3 | long long int A[N];
      |                 ^
a.cc:6:1: error: expected unqualified-id before 'for'
    6 | for(int x = 0;x<N;x++){
      | ^~~
a.cc:6:15: error: 'x' does not name a type
    6 | for(int x = 0;x<N;x++){
      |               ^
a.cc:6:19: error: 'x' does not name a type
    6 | for(int x = 0;x<N;x++){
      |                   ^
a.cc:8:2: error: expected unqualified-id before 'for'
    8 | }for(int x = 0;x<N;x++){
      |  ^~~
a.cc:8:16: error: 'x' does not name a type
    8 | }for(int x = 0;x<N;x++){
      |                ^
a.cc:8:20: error: 'x' does not name a type
    8 | }for(int x = 0;x<N;x++){
      |                    ^
a.cc:15:1: error: expected unqualified-id before 'if'
   15 | if(P==0){
      | ^~
a.cc:22:2: error: expected unqualified-id before 'if'
   22 | }if(P==1){
      |  ^~
a.cc:27:1: error: 'cout' does not name a type
   27 | cout<<B<<"\n";
      | ^~~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<queue>
#include<stack>
#include<string>

using namespace std;
const int INF = 1<<30;
typedef long long int ll;

int main(){
	int n, p;cin>>n>>p;
	int m=0;
	for(int i=0;i<n;i++){
		int t;cin>>t;
		m+=(t%2!=0);
	}
	if(m==0) cout<<(p==0?(int)pow((float)2, n):0)<<endl;
	else cout<<ll(pow((float)2, m-1)*pow((float)2, n-m))<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:21:68: error: expected '}' at end of input
   21 |         else cout<<ll(pow((float)2, m-1)*pow((float)2, n-m))<<endl;
      |                                                                    ^
a.cc:13:11: note: to match this '{'
   13 | int main(){
      |           ^
Language: C++

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

typedef long long ll;

int main(){
  ll n,q;
  cin >> n >> q;
  ll a[n];
  for(int i=0;i<n;i++) cin >> a[i];
  ll x=0,y=0;
  for(int i=0;i<n;i++){
    if(a[i]%2==0){
      x++;
    }
    else{
      y++;
    }
  }
  if(y!=0){
    cout << (ll)pow(2,n-1) << endl;
  }
  else{
    if(p==0){
      cout << (ll)pow(2,n) << endl;
    }
    else{
      cout << 0 << endl;
    }
  }
}
      


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

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

typedef long long ll;

int main(){
  ll n,q;
  cin >> n >> q;
  for(int i=0;i<n;i++) cin >> a[i];
  ll x=0,y=0;
  for(int i=0;i<n;i++){
    if(a[i]%2==0){
      x++;
    }
    else{
      y++;
    }
  }
  if(y!=0){
    cout << (ll)pow(2,n-1) << endl;
  }
  else{
    if(p==0){
      cout << (ll)pow(2,n) << endl;
    }
    else{
      cout << 0 << endl;
    }
  }
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:10:31: error: 'a' was not declared in this scope
   10 |   for(int i=0;i<n;i++) cin >> a[i];
      |                               ^
a.cc:13:8: error: 'a' was not declared in this scope
   13 |     if(a[i]%2==0){
      |        ^
a.cc:24:8: error: 'p' was not declared in this scope
   24 |     if(p==0){
      |        ^
Language: C++

#include<iostream>
#include<cmath>
#include<numeric>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n;i++)
#define int64 long long
#define yokuwaruprime (10*10*10*10*10*10*10*10*10+7)
using namespace std;

int64 power2(int n){
  int64 ans=1;
  rep(i,n){
    ans*=2;
  }
  return ans;
}

int main(){
  int n,p,a=0,b=0;
  cin>>n>>p;
  int a[n];
  rep(i,n){
    cin>>a[i];
    if(a[i]%2!=0){
      a++;
    }else{
      b++;
    }
  }
  if(a==0){
    if(p==0){
      cout<<power2(n);
    }else{
      cout<<0;
    }
  }else{
    cout<<power2(n-1);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:7: error: conflicting declaration 'int a [n]'
   25 |   int a[n];
      |       ^
a.cc:23:11: note: previous declaration as 'int a'
   23 |   int n,p,a=0,b=0;
      |           ^
a.cc:27:11: error: invalid types 'int[int]' for array subscript
   27 |     cin>>a[i];
      |           ^
a.cc:28:9: error: invalid types 'int[int]' for array subscript
   28 |     if(a[i]%2!=0){
      |         ^
Language: C

#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<cmath>
using namespace std;
long long cmb(int a, int b){
  long long s=1;
  for(int i=1;i<=b;i++){
    s=s*(a+1-i)/i;
  }
  return s;
}
int main(){
  int n, p;
  cin >> n >> p;
  vector<int> m(2,0);
  int a,i;
  for(i=0;i<n;i++){
    cin >> a;
    m[a%2]++;
  }
  long long ans=(long long)exp2(m[0]),t=0;
  for(i=p;i<=m[1];i+=2){
    t+=cmb(m[1],i);
  }
  ans*=t;
  cout << ans << endl;
}

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

#include<iostream>
using namespace std;
long long n,p,ans=1,a,cnt0,cnt1;
main(){
    cin>>n>>p;
    for(int i=0;i<n;i++){
        cin>>a;
        ans*=2;
        if(a%2)cnt1++;
        else cnt0++;
    }
    if(cnt0==n and p==0)cout<<ans<<endl;
    else if(cnt==n and p==1)cout<<0<<endl;
    else cout<<ans/2<<endl;
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:13:13: error: 'cnt' was not declared in this scope; did you mean 'int'?
   13 |     else if(cnt==n and p==1)cout<<0<<endl;
      |             ^~~
      |             int
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include<cstdio>

using namespace std;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;

const int  INF = 1e9;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
const int SIZE = 100;


int main() {
	ll n, p;
	ll odd, even;
	odd = even = 0;
	scanf("%lld %lld", &n, &p);
	vector<ll> a(n);
	for (ll i = 0; i < n; i++) {
		scanf("%lld", &a[i]);
		if (a[i] % 2 == 0) {
			even++;
		}
		else {
			odd++;
		}
	}

	if (p == 0) {
		if (odd == 0) {
			printf("%lld\n", (ll)pow(2, n));
			return 0;
		}
		else {
			printf("%lld\n", (ll)pow(2, n - 1));
			return 0;
		}
	}
	else {
		if (odd >= 1) {
			printf("%lld\n", (ll)pow(2, n - 1));
			return 0;
		}
		else {
			printf("%lld\n", (ll)0);
			return 0;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:46: error: 'pow' was not declared in this scope
   37 |                         printf("%lld\n", (ll)pow(2, n));
      |                                              ^~~
a.cc:41:46: error: 'pow' was not declared in this scope
   41 |                         printf("%lld\n", (ll)pow(2, n - 1));
      |                                              ^~~
a.cc:47:46: error: 'pow' was not declared in this scope
   47 |                         printf("%lld\n", (ll)pow(2, n - 1));
      |                                              ^~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include<cstdio>

using namespace std;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;

const int  INF = 1e9;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
const int SIZE = 100;


int main() {
	ll n, p;
	ll odd, even;
	odd = even = 0;
	scanf_s("%lld %lld", &n, &p);
	vector<ll> a(n);
	for (ll i = 0; i < n; i++) {
		scanf_s("%lld", &a[i]);
		if (a[i] % 2 == 0) {
			even++;
		}
		else {
			odd++;
		}
	}

	if (p == 0) {
		if (odd == 0) {
			printf("%lld\n", (ll)pow(2, n));
			return 0;
		}
		else {
			printf("%lld\n", (ll)pow(2, n - 1));
			return 0;
		}
	}
	else {
		if (odd >= 1) {
			printf("%lld\n", (ll)pow(2, n - 1));
			return 0;
		}
		else {
			printf("%lld\n", (ll)0);
			return 0;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   23 |         scanf_s("%lld %lld", &n, &p);
      |         ^~~~~~~
      |         scanf
a.cc:37:46: error: 'pow' was not declared in this scope
   37 |                         printf("%lld\n", (ll)pow(2, n));
      |                                              ^~~
a.cc:41:46: error: 'pow' was not declared in this scope
   41 |                         printf("%lld\n", (ll)pow(2, n - 1));
      |                                              ^~~
a.cc:47:46: error: 'pow' was not declared in this scope
   47 |                         printf("%lld\n", (ll)pow(2, n - 1));
      |                                              ^~~
Language: C++

#include<bits/stdc++.h>
#include<math.h>
using namespace std;
typedef long long ll;
int main()
{
    int N, P; cin >> N >> P;
    ll ans = 1;
    vector<int> A(N);
    for(int i = 0; i < N; i++)
    {
        cin >> A.at(i);
    }
    int X = 0, Y = 0;
    for(int i = 0; i < N; i++)
    {
        if(A.at(i) % 2 == 0)
        {
            X++; //A中の偶数袋の個数
        }
        else
        {
            Y++; //A中の奇数袋の個数
        }
    }
    ll ans = 1;
    for(int i = 0; i < N-1; i++)
    {
        ans *= 2;
    }
    if(X == N && P == 0)
    {
        cout << 2*ans <<endl;
    }
    else if(X == N && P == 1)
    {
        cout << 0 << endl;
    }
    else
    {
        cout << ans << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:8: error: redeclaration of 'll ans'
   26 |     ll ans = 1;
      |        ^~~
a.cc:8:8: note: 'll ans' previously declared here
    8 |     ll ans = 1;
      |        ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
int n,p;
  cin >> n >> p;
  bool gusu==true;
  int a[n];
  for (int i=0;i<n;i++){
    cin >> a[i];
    if (a[i]%2==1)gusu=false;
  }
  if (p==0 && gusu)cout << pow(2,n) <<endl;
  else if (p==1 && gusu) cout << 0 <<endl;
  else cout <<pow(2,n-1)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: expected initializer before '==' token
    6 |   bool gusu==true;
      |            ^~
a.cc:10:19: error: 'gusu' was not declared in this scope
   10 |     if (a[i]%2==1)gusu=false;
      |                   ^~~~
a.cc:12:15: error: 'gusu' was not declared in this scope
   12 |   if (p==0 && gusu)cout << pow(2,n) <<endl;
      |               ^~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main(){
  int n,p;
  scanf("%d %d", &n,&p);
  int k0=0,k1=0;
  for(int i=0;i<n;i++){
    int a;
    scanf("%d", &a);
    if(a%2==0){
      k0++;
    }else{
      k1++;
    }
  }
  ll ans;
  if(k1==0){
    ans=(1LL<<n);
  }else{
    ans=(1LL<<(n-1));
  }
  if(p==1){
    ans=(aLL<<n)-ans;
  }
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: 'll' was not declared in this scope
   18 |   ll ans;
      |   ^~
a.cc:20:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |     ans=(1LL<<n);
      |     ^~~
      |     abs
a.cc:22:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   22 |     ans=(1LL<<(n-1));
      |     ^~~
      |     abs
a.cc:25:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |     ans=(aLL<<n)-ans;
      |     ^~~
      |     abs
a.cc:25:10: error: 'aLL' was not declared in this scope
   25 |     ans=(aLL<<n)-ans;
      |          ^~~
a.cc:27:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   27 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
	int n, p; cin >> n >> p;
	int A[n];
	for (int i = 0; i < n; i++) {
		cin >> A[i];
	}
	int cnt_even = 0, cnt_odd = 0;
	for (int i = 0; i < n; i++) {
		if (A[i] % 2 == 0) cnt_even++;
		else cnt_odd++;
	}
	long long ans = 0;
	if (cnt_odd == 0) {
		if (p == 0) cout << pow(2, n) << endl;
		else cout << 0 << endl;
	}
	else {
		cout << pow(2, N - 1) << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:32: error: 'N' was not declared in this scope
   20 |                 cout << pow(2, N - 1) << endl;
      |                                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define uint unsigned int
#define llong long long int
#define ullong unsigned long long int
#define rep(i, n) for (int i = 0; i < n; ++i)
const static long long int MOD = 1000000000 + 7;
const static int dy[] = {0, 1, 0, -1};
const static int dx[] = {1, 0, -1, 0};

template<typename T> T combination(T n, T r)
{
    if (r == 0 || r == n)
        return (1);
    else if (r == 1)
        return (n);
    return (combination(n - 1, r - 1) + combination(n - 1, r));
}

int main(int argc, char *argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n, p, a, even = 0, odd = 0;
    cin >> n >> p;
    rep(i, n) {
        cin >> a;
        if (a % 2) ++odd;
        else ++even;
    }

    llong ans = 0;
    rep(i, odd + 1) {
        if (p) {
            if (i % 2) ans += combination(odd, i);
        } else {
            if (!(i % 2)) ans += combination(odd, i);
        }
    }
    ans *= pow(2, even)

    cout << ans << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:40:24: error: expected ';' before 'cout'
   40 |     ans *= pow(2, even)
      |                        ^
      |                        ;
   41 | 
   42 |     cout << ans << endl;
      |     ~~~~
Language: C++

#include <iostream>
#include <math.h>
#include <algorithm>
#include <set>
#include <map>
#include <string>
using namespace std;
typedef long long ll;
#define rep(i,s,n)for(ll i=s;i<n;i++)
#define repe(i,s,n)for(ll i=s;i<=n;i++)
#define rep_r(i,s,n)for(ll i=n-1;i>=s;i--)
#define repe_r(i,s,n)for(ll i=s;i<=n;i++)
static const ll MOD = 1e9 + 7;
//static const ll MOD = 1;
static const ll MAX_L = (ll)1 << 62;

static const ll FACT_SIZE = 1000000;

int main() {
	ll n, p; cin >> n >> p;
	ll o = 0, e = 0;
	rep(i, 0, n) {
		ll a; cin >> a;
		if (a & 1) o++;
		else e++;
	}

	ll p = 0;
	if (o == 0) {
		if (p == 1) cout << 0 << endl;
		else p = e;
	}
	else p = o + e - 1;

	ll ans = 1;
	rep(i, 0, p) {
		ans *= 2;
	}
	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:12: error: redeclaration of 'll p'
   28 |         ll p = 0;
      |            ^
a.cc:20:15: note: 'll p' previously declared here
   20 |         ll n, p; cin >> n >> p;
      |               ^