Language: C++

#include <bits/stdc++.h>
using namespace std;
#ifdef ENABLE_DEBUG_OUTPUT
#define DEBUG_LOG(s) cout << s << endl;
#else
#define DEBUG_LOG(s) void();
#endif

class Combination {
private:
    const int64_t mod = 1e16;
    vector<vector<int64_t>> comb;

    void init(int64_t max_size) {
        comb.assign(max_size, vector<int64_t>(max_size, 0));
        comb[0][0] = 1;
        for (auto i = 1; i < max_size; i++) {
            // 0個選ぶ組み合わせは1つしかない
            comb[i][0] = 1;
            for (auto j = 1; j < max_size; j++) {
                comb[i][j] = (comb[i - 1][j - 1] + comb[i - 1][j]) % mod;
            }
        }
    };
public:;
    explicit Combination(int64_t max_size) {
        assert(max_size <= 2000);
        // テーブル生成
        init(max_size + 1);
    };
    virtual ~Combination() = default;

    int64_t combination(int64_t n, int64_t k) {
        if (n < k) return 0;
        if (n < 0 or k < 0) return 0;
        return comb[n][k];
    };
};

int main(){
    int n, p; cin >> n >> p;
    Combination c = Combination(50);

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

    int64_t all_comb = 0, odd_comb = 0, even_comb = 0;
    for (auto i = 0; i <= n; i++) {
        all_comb += c.combination(n, i);
        if(odd >= i and i % 2) odd_comb += c.combination(odd, i);
        if(n - odd >= i) even_comb += c.combination(n - odd, i);
        cout << i << " " << all_comb << " " << odd_comb << " " << even_comb << endl;
    }

    if(p == 0) {
        cout << all_comb - odd_comb * even_comb << endl;
    } else {
        cout << odd_comb * even_comb << endl;
    }

    return 0;
}#include <bits/stdc++.h>
using namespace std;
#ifdef ENABLE_DEBUG_OUTPUT
#define DEBUG_LOG(s) cout << s << endl;
#else
#define DEBUG_LOG(s) void();
#endif

class Combination {
private:
    const int64_t mod = 1e16;
    vector<vector<int64_t>> comb;

    void init(int64_t max_size) {
        comb.assign(max_size, vector<int64_t>(max_size, 0));
        comb[0][0] = 1;
        for (auto i = 1; i < max_size; i++) {
            // 0個選ぶ組み合わせは1つしかない
            comb[i][0] = 1;
            for (auto j = 1; j < max_size; j++) {
                comb[i][j] = (comb[i - 1][j - 1] + comb[i - 1][j]) % mod;
            }
        }
    };
public:;
    explicit Combination(int64_t max_size) {
        assert(max_size <= 2000);
        // テーブル生成
        init(max_size + 1);
    };
    virtual ~Combination() = default;

    int64_t combination(int64_t n, int64_t k) {
        if (n < k) return 0;
        if (n < 0 or k < 0) return 0;
        return comb[n][k];
    };
};

int main(){
    int n, p; cin >> n >> p;
    Combination c = Combination(50);

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

    int64_t all_comb = 0, odd_comb = 0, even_comb = 0;
    for (auto i = 0; i <= n; i++) {
        all_comb += c.combination(n, i);
        if(odd >= i and i % 2) odd_comb += c.combination(odd, i);
        if(n - odd >= i) even_comb += c.combination(n - odd, i);
//        cout << i << " " << all_comb << " " << odd_comb << " " << even_comb << endl;
    }

    if(p == 0) {
        cout << all_comb - odd_comb * even_comb << endl;
    } else {
        cout << odd_comb * even_comb << endl;
    }

    return 0;
}

Compiler output:
a.cc:66:2: error: stray '#' in program
   66 | }#include <bits/stdc++.h>
      |  ^
a.cc:66:3: error: 'include' does not name a type
   66 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:74:7: error: redefinition of 'class Combination'
   74 | class Combination {
      |       ^~~~~~~~~~~
a.cc:9:7: note: previous definition of 'class Combination'
    9 | class Combination {
      |       ^~~~~~~~~~~
a.cc:105:5: error: redefinition of 'int main()'
  105 | int main(){
      |     ^~~~
a.cc:40:5: note: 'int main()' previously defined here
   40 | int main(){
      |     ^~~~