Language: C++

#![allow(unused_mut)]
#![allow(non_snake_case)]
#![allow(unused_imports)]
use std::collections::HashSet;
use std::collections::HashMap;
use std::collections::BTreeSet;
use std::collections::VecDeque;
use std::cmp::{max, min};
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
fn main() {
    input! {
        n: u64,
        a: u64,
        xs: [u64; n],
    }
    let mut hm = HashMap::new();
    for x in xs.iter() {
        if hm.contains_key(x) {
            let h = hm.get_mut(x).unwrap();
            *h += 1;
        } else {
            hm.insert(x, 1);
        }
    }

    let mut cnt = 0;
    // 1 << d := pow(2, d)
    for i in 0..1 << xs.len() {
        let mut sum = 0;
        let mut ret  =  0;
        for j in 0..xs.len() {
            // iのj番目ビットが立っているか -> jがiに含まれるか
            if 1 << j & i == 0 {
                sum += xs[j];
                ret += 1;
            }
        }
        if ret != 0 && sum % ret == 0 && sum / ret == a {
            cnt+=1;
        }
    }
    println!("{}", cnt);
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #![allow(unused_mut)]
      |  ^
a.cc:2:2: error: invalid preprocessing directive #!
    2 | #![allow(non_snake_case)]
      |  ^
a.cc:3:2: error: invalid preprocessing directive #!
    3 | #![allow(unused_imports)]
      |  ^
a.cc:10:2: error: invalid preprocessing directive #[
   10 | #[allow(unused_macros)]
      |  ^
a.cc:28:2: error: invalid preprocessing directive #[
   28 | #[allow(unused_macros)]
      |  ^
a.cc:39:2: error: invalid preprocessing directive #[
   39 | #[allow(unused_macros)]
      |  ^
a.cc:46:10: error: too many decimal points in number
   46 |         (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
      |          ^~~~~~~
a.cc:79:14: error: too many decimal points in number
   79 |     for i in 0..1 << xs.len() {
      |              ^~~~
a.cc:82:18: error: too many decimal points in number
   82 |         for j in 0..xs.len() {
      |                  ^~~~~~~~~
a.cc:4:1: error: 'use' does not name a type
    4 | use std::collections::HashSet;
      | ^~~
a.cc:5:1: error: 'use' does not name a type
    5 | use std::collections::HashMap;
      | ^~~
a.cc:6:1: error: 'use' does not name a type
    6 | use std::collections::BTreeSet;
      | ^~~
a.cc:7:1: error: 'use' does not name a type
    7 | use std::collections::VecDeque;
      | ^~~
a.cc:8:1: error: 'use' does not name a type
    8 | use std::cmp::{max, min};
      | ^~~
a.cc:11:1: error: 'macro_rules' does not name a type
   11 | macro_rules! input {
      | ^~~~~~~~~~~
a.cc:29:1: error: 'macro_rules' does not name a type
   29 | macro_rules! input_inner {
      | ^~~~~~~~~~~
a.cc:40:1: error: 'macro_rules' does not name a type
   40 | macro_rules! read_value {
      | ^~~~~~~~~~~
a.cc:61:1: error: 'fn' does not name a type
   61 | fn main() {
      | ^~